source: josm/trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanel.java@ 11057

Last change on this file since 11057 was 9059, checked in by Don-vip, 8 years ago

checkstyle

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.dialogs.changeset;
3
4import java.awt.BorderLayout;
5import java.beans.PropertyChangeEvent;
6import java.beans.PropertyChangeListener;
7
8import javax.swing.BorderFactory;
9import javax.swing.JPanel;
10import javax.swing.JScrollPane;
11
12import org.openstreetmap.josm.data.osm.Changeset;
13import org.openstreetmap.josm.gui.tagging.TagEditorModel;
14import org.openstreetmap.josm.gui.tagging.TagTable;
15
16/**
17 * This panel displays the tags of the currently selected changeset in the {@link ChangesetCacheManager}
18 *
19 */
20public class ChangesetTagsPanel extends JPanel implements PropertyChangeListener {
21
22 private TagEditorModel model;
23
24 protected void build() {
25 setLayout(new BorderLayout());
26 setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
27 model = new TagEditorModel();
28 TagTable tblTags = new TagTable(model, 0);
29 tblTags.setEnabled(false);
30 add(new JScrollPane(tblTags), BorderLayout.CENTER);
31 }
32
33 /**
34 * Constructs a new {@code ChangesetTagsPanel}.
35 */
36 public ChangesetTagsPanel() {
37 build();
38 }
39
40 /* ---------------------------------------------------------------------------- */
41 /* interface PropertyChangeListener */
42 /* ---------------------------------------------------------------------------- */
43 @Override
44 public void propertyChange(PropertyChangeEvent evt) {
45 if (!evt.getPropertyName().equals(ChangesetCacheManagerModel.CHANGESET_IN_DETAIL_VIEW_PROP))
46 return;
47 Changeset cs = (Changeset) evt.getNewValue();
48 if (cs == null) {
49 model.clear();
50 } else {
51 model.initFromPrimitive(cs);
52 }
53 }
54}
Note: See TracBrowser for help on using the repository browser.