Last change
on this file since 627 was 627, checked in by framm, 16 years ago |
|
-
Property svn:eol-style
set to
native
|
File size:
1.0 KB
|
Line | |
---|
1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
2 | package org.openstreetmap.josm.gui.dialogs;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.awt.Component;
|
---|
7 | import java.awt.event.ActionEvent;
|
---|
8 |
|
---|
9 | import javax.swing.AbstractAction;
|
---|
10 | import javax.swing.JList;
|
---|
11 | import javax.swing.JOptionPane;
|
---|
12 | import javax.swing.JPopupMenu;
|
---|
13 |
|
---|
14 | import org.openstreetmap.josm.Main;
|
---|
15 | import org.openstreetmap.josm.gui.layer.Layer;
|
---|
16 | import org.openstreetmap.josm.tools.ImageProvider;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Popup menu handler for the layer list.
|
---|
20 | */
|
---|
21 | public class LayerListPopup extends JPopupMenu {
|
---|
22 |
|
---|
23 | public final static class InfoAction extends AbstractAction {
|
---|
24 | private final Layer layer;
|
---|
25 | public InfoAction(Layer layer) {
|
---|
26 | super(tr("Info"), ImageProvider.get("info"));
|
---|
27 | this.layer = layer;
|
---|
28 | }
|
---|
29 | public void actionPerformed(ActionEvent e) {
|
---|
30 | JOptionPane.showMessageDialog(Main.parent, layer.getInfoComponent());
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 | public LayerListPopup(final JList layers, final Layer layer) {
|
---|
35 | for (Component c : layer.getMenuEntries())
|
---|
36 | add(c);
|
---|
37 | }
|
---|
38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.