Index: applications/editors/josm/plugins/tagging-preset-tester/build.xml
===================================================================
--- applications/editors/josm/plugins/tagging-preset-tester/build.xml	(revision 29757)
+++ applications/editors/josm/plugins/tagging-preset-tester/build.xml	(revision 29758)
@@ -26,5 +26,5 @@
 -->
 <project name="tagging-preset-tester" default="dist" basedir=".">
-    <property name="commit.message" value="fix shortcuts conflict"/>
+    <property name="commit.message" value="[josm_tagging_preset_tester] fix #josm8879: make all panels active by default and use current selection"/>
     <property name="plugin.main.version" value="4980"/>
     <property name="josm" location="../../core/dist/josm-custom.jar"/>
Index: applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTester.java
===================================================================
--- applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTester.java	(revision 29757)
+++ applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTester.java	(revision 29758)
@@ -19,5 +19,10 @@
 import javax.swing.JPanel;
 
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.tagging.TaggingPreset;
 
@@ -32,19 +37,25 @@
     private JPanel panel = new JPanel(new BorderLayout());
 
-    public void reload() {
+    public final void reload() {
         Vector<TaggingPreset> allPresets = new Vector<TaggingPreset>(TaggingPreset.readAll(Arrays.asList(args), true));
         taggingPresets.setModel(new DefaultComboBoxModel(allPresets));
     }
 
-    public void reselect() {
+    public final void reselect() {
         taggingPresetPanel.removeAll();
         TaggingPreset preset = (TaggingPreset)taggingPresets.getSelectedItem();
         if (preset == null)
             return;
-        Collection<OsmPrimitive> x = Collections.emptySet();
+        Collection<OsmPrimitive> x;
+        if (Main.main.hasEditLayer()) {
+            x = Main.main.getCurrentDataSet().getSelected();
+        } else {
+            x = makeFakeSuitablePrimitive(preset);
+        }
         JPanel p = preset.createPanel(x);
-        p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-        if (p != null)
+        if (p != null) {
+            p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
             taggingPresetPanel.add(p, BorderLayout.NORTH);
+        }
         panel.validate();
         panel.repaint();
@@ -61,4 +72,5 @@
         panel.add(taggingPresetPanel, BorderLayout.CENTER);
         taggingPresets.addActionListener(new ActionListener(){
+            @Override
             public void actionPerformed(ActionEvent e) {
                 reselect();
@@ -69,4 +81,5 @@
         JButton b = new JButton(tr("Reload"));
         b.addActionListener(new ActionListener(){
+            @Override
             public void actionPerformed(ActionEvent e) {
                 int i = taggingPresets.getSelectedIndex();
@@ -81,5 +94,4 @@
         setContentPane(panel);
         setSize(300,500);
-        setVisible(true);
     }
 
@@ -94,3 +106,22 @@
         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     }
+
+    private Collection<OsmPrimitive> makeFakeSuitablePrimitive(TaggingPreset preset) {
+        if (preset.typeMatches(Collections.singleton(TaggingPreset.PresetType.NODE))) {
+            return Collections.<OsmPrimitive>singleton(new Node());
+        } else if (preset.typeMatches(Collections.singleton(TaggingPreset.PresetType.WAY))) {
+            return Collections.<OsmPrimitive>singleton(new Way());
+        } else if (preset.typeMatches(Collections.singleton(TaggingPreset.PresetType.RELATION))) {
+            return Collections.<OsmPrimitive>singleton(new Relation());
+        } else if (preset.typeMatches(Collections.singleton(TaggingPreset.PresetType.CLOSEDWAY))) {
+            Way w = new Way();
+            w.addNode(new Node(new LatLon(0,0)));
+            w.addNode(new Node(new LatLon(0,1)));
+            w.addNode(new Node(new LatLon(1,1)));
+            w.addNode(new Node(new LatLon(0,0)));
+            return Collections.<OsmPrimitive>singleton(w);
+        } else {
+            return Collections.emptySet();
+        }
+    }
 }
Index: applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTesterAction.java
===================================================================
--- applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTesterAction.java	(revision 29757)
+++ applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTesterAction.java	(revision 29758)
@@ -36,8 +36,9 @@
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
         Collection<String> coll = TaggingPreset.getPresetSources();
 
-        if (coll.size() == 0) {
+        if (coll.isEmpty()) {
             JOptionPane.showMessageDialog(Main.parent, tr("You have to specify tagging preset sources in the preferences first."));
             return;
@@ -46,5 +47,5 @@
         String[] taggingPresetSources = new String [coll.size()];
         coll.toArray(taggingPresetSources);
-        new TaggingPresetTester(taggingPresetSources);
+        new TaggingPresetTester(taggingPresetSources).setVisible(true);
     }
 }
