1 | package org.openstreetmap.josm.plugins.osminspector.gui;
|
---|
2 |
|
---|
3 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
4 |
|
---|
5 | import java.awt.event.KeyEvent;
|
---|
6 | import java.util.Collections;
|
---|
7 |
|
---|
8 | import javax.swing.JTextPane;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.gui.MainApplication;
|
---|
11 | import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
|
---|
12 | import org.openstreetmap.josm.plugins.osminspector.OsmInspectorLayer;
|
---|
13 | import org.openstreetmap.josm.plugins.osminspector.OsmInspectorLayer.BugInfo;
|
---|
14 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
15 |
|
---|
16 | public class OsmInspectorBugInfoDialog extends ToggleDialog {
|
---|
17 |
|
---|
18 | private JTextPane bugTextArea;
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Builds the content panel for this dialog
|
---|
22 | */
|
---|
23 | protected void buildContentPanel() {
|
---|
24 | MainApplication.getMap().addToggleDialog(this, true);
|
---|
25 |
|
---|
26 | bugTextArea = new JTextPane();
|
---|
27 | createLayout(bugTextArea, true, Collections.emptyList());
|
---|
28 | bugTextArea.setText("This is a demo");
|
---|
29 | this.add(bugTextArea);
|
---|
30 | }
|
---|
31 |
|
---|
32 | public OsmInspectorBugInfoDialog(OsmInspectorLayer layer) {
|
---|
33 |
|
---|
34 | super(tr("OsmBugInfo"), "select",
|
---|
35 | tr("Open a OSM Inspector selection list window."), Shortcut.registerShortcut("subwindow:select",
|
---|
36 | tr("Toggle: {0}", tr("Current Selected Bug Info")),
|
---|
37 | KeyEvent.VK_D, Shortcut.ALT_SHIFT), 150, // default
|
---|
38 | // height
|
---|
39 | true // default is "show dialog"
|
---|
40 | );
|
---|
41 | buildContentPanel();
|
---|
42 | }
|
---|
43 |
|
---|
44 | public void updateDialog(OsmInspectorLayer l) {
|
---|
45 | }
|
---|
46 |
|
---|
47 | public void setBugDescription(BugInfo i){
|
---|
48 | bugTextArea.setText(i.getContentString());
|
---|
49 | }
|
---|
50 |
|
---|
51 | @Override
|
---|
52 | public void hideNotify() {
|
---|
53 | if (dialogsPanel != null) {
|
---|
54 | super.hideNotify();
|
---|
55 | }
|
---|
56 | }
|
---|
57 | }
|
---|