Index: trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 11973)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 11974)
@@ -144,4 +144,41 @@
     }
 
+    static final class PluginInformationAction extends AbstractAction {
+        private final PluginInformation info;
+
+        PluginInformationAction(PluginInformation info) {
+            super(tr("Information"));
+            this.info = info;
+        }
+
+        /**
+         * Returns plugin information text.
+         * @return plugin information text
+         */
+        public String getText() {
+            StringBuilder b = new StringBuilder();
+            for (Entry<String, String> e : info.attr.entrySet()) {
+                b.append(e.getKey());
+                b.append(": ");
+                b.append(e.getValue());
+                b.append('\n');
+            }
+            return b.toString();
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent event) {
+            String text = getText();
+            JosmTextArea a = new JosmTextArea(10, 40);
+            a.setEditable(false);
+            a.setText(text);
+            a.setCaretPosition(0);
+            if (!GraphicsEnvironment.isHeadless()) {
+                JOptionPane.showMessageDialog(Main.parent, new JScrollPane(a), tr("Plugin information"),
+                        JOptionPane.INFORMATION_MESSAGE);
+            }
+        }
+    }
+
     /**
      * Description of a deprecated plugin
@@ -1408,22 +1445,5 @@
             pluginTab.add(new JLabel(name), GBC.std());
             pluginTab.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL));
-            pluginTab.add(new JButton(new AbstractAction(tr("Information")) {
-                @Override
-                public void actionPerformed(ActionEvent event) {
-                    StringBuilder b = new StringBuilder();
-                    for (Entry<String, String> e : info.attr.entrySet()) {
-                        b.append(e.getKey());
-                        b.append(": ");
-                        b.append(e.getValue());
-                        b.append('\n');
-                    }
-                    JosmTextArea a = new JosmTextArea(10, 40);
-                    a.setEditable(false);
-                    a.setText(b.toString());
-                    a.setCaretPosition(0);
-                    JOptionPane.showMessageDialog(Main.parent, new JScrollPane(a), tr("Plugin information"),
-                            JOptionPane.INFORMATION_MESSAGE);
-                }
-            }), GBC.eol());
+            pluginTab.add(new JButton(new PluginInformationAction(info)), GBC.eol());
 
             JosmTextArea description = new JosmTextArea(info.description == null ? tr("no description available")
Index: trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java	(revision 11973)
+++ trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java	(revision 11974)
@@ -21,4 +21,9 @@
 import org.openstreetmap.josm.data.osm.Way;
 
+/**
+ * The context switch offers possibility to use tags of referenced primitive when constructing primitive name.
+ * @author jttt
+ * @since 4546
+ */
 public class ContextSwitchTemplate implements TemplateEntry {
 
@@ -244,4 +249,11 @@
     }
 
+    /**
+     * Constructs a new {@code ContextSwitchTemplate}.
+     * @param match match
+     * @param template template
+     * @param searchExpressionPosition search expression position
+     * @throws ParseError if a parse error occurs, or if the match transformation returns the same primitive
+     */
     public ContextSwitchTemplate(Match match, TemplateEntry template, int searchExpressionPosition) throws ParseError {
         Match m = transform(match, searchExpressionPosition);
