Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/ImageryXmlBoundsPlugin.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/ImageryXmlBoundsPlugin.java	(revision 28657)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/ImageryXmlBoundsPlugin.java	(revision 29461)
@@ -18,5 +18,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.ExtensionFileFilter;
-import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MapFrame;
@@ -24,6 +23,5 @@
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginInformation;
-import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.ShowBoundsListAction;
-import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.ShowBoundsPropertiesAction;
+import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.ShowBoundsAction;
 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.ShowBoundsSelectionAction;
 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.downloadtask.DownloadXmlBoundsTask;
@@ -46,15 +44,15 @@
      * Action showing bounds of the selected closed ways in Selection dialog 
      */
-	private final ShowBoundsListAction selectionListAction = new ShowBoundsListAction();
+	private final ShowBoundsAction selectionListAction = new ShowBoundsAction();
 
     /**
      * Action showing bounds of the selected multipolygons in Properties dialog 
      */
-    private final ShowBoundsPropertiesAction propertiesListAction = new ShowBoundsPropertiesAction();
+    private final ShowBoundsAction propertiesListAction = new ShowBoundsAction();
     
 	/**
      * Action showing bounds of the selected multipolygons in Relations dialog
      */
-	private final ShowBoundsListAction relationListAction = new ShowBoundsListAction();
+	private final ShowBoundsAction relationListAction = new ShowBoundsAction();
 
     /**
@@ -82,7 +80,5 @@
 		Main.toolbar.register(selectionAction);
 		// Allow JOSM to download *.imagery.xml files
-		if (Version.getInstance().getVersion() >= 4523) {
-		    Main.main.menu.openLocation.addDownloadTaskClass(DownloadXmlBoundsTask.class);
-		}
+		Main.main.menu.openLocation.addDownloadTaskClass(DownloadXmlBoundsTask.class);
 	}
 	
@@ -102,10 +98,21 @@
 		if (newFrame != null) {
 		    // Initialize dialogs actions only after the main frame is created 
-            newFrame.selectionListDialog.addPopupMenuSeparator();
-            newFrame.selectionListDialog.addPopupMenuAction(selectionListAction);
-            newFrame.propertiesDialog.addMembershipPopupMenuSeparator();
-            newFrame.propertiesDialog.addMembershipPopupMenuAction(propertiesListAction);
-			newFrame.relationListDialog.addPopupMenuSeparator();
-			newFrame.relationListDialog.addPopupMenuAction(relationListAction);
+            newFrame.selectionListDialog.getPopupMenuHandler().addSeparator();
+            newFrame.selectionListDialog.getPopupMenuHandler().addAction(selectionListAction);
+            newFrame.propertiesDialog.getMembershipPopupMenuHandler().addSeparator();
+            newFrame.propertiesDialog.getMembershipPopupMenuHandler().addAction(propertiesListAction);
+			newFrame.relationListDialog.getPopupMenuHandler().addSeparator();
+			newFrame.relationListDialog.getPopupMenuHandler().addAction(relationListAction);
+		} else if (oldFrame != null) {
+            // Remove listeners from previous frame to avoid memory leaks
+		    if (oldFrame.relationListDialog != null) {
+		        oldFrame.relationListDialog.getPopupMenuHandler().removeAction(relationListAction);
+		    }
+		    if (oldFrame.propertiesDialog != null) {
+		        oldFrame.propertiesDialog.getMembershipPopupMenuHandler().removeAction(propertiesListAction);
+		    }
+		    if (oldFrame.selectionListDialog != null) {
+		        oldFrame.selectionListDialog.getPopupMenuHandler().removeAction(selectionListAction);
+		    }
 		}
 	}
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java	(revision 28657)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java	(revision 29461)
@@ -19,4 +19,5 @@
 import java.awt.Font;
 import java.awt.event.ActionEvent;
+import java.util.Collection;
 
 import javax.swing.Box;
@@ -27,4 +28,6 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.OsmPrimitiveAction;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsLayer;
 
@@ -34,5 +37,5 @@
  */
 @SuppressWarnings("serial")
-public class ShowBoundsAction extends ComputeBoundsAction {
+public class ShowBoundsAction extends ComputeBoundsAction implements OsmPrimitiveAction {
 
 	public ShowBoundsAction() {
@@ -58,3 +61,8 @@
         JOptionPane.showMessageDialog(Main.parent, box, ACTION_NAME, JOptionPane.PLAIN_MESSAGE);
 	}
+
+    @Override
+    public void setPrimitives(Collection<? extends OsmPrimitive> primitives) {
+        updateOsmPrimitives(primitives);
+    }
 }
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsListAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsListAction.java	(revision 28657)
+++ 	(revision )
@@ -1,50 +1,0 @@
-//    JOSM Imagery XML Bounds plugin.
-//    Copyright (C) 2011 Don-vip
-//
-//    This program is free software: you can redistribute it and/or modify
-//    it under the terms of the GNU General Public License as published by
-//    the Free Software Foundation, either version 3 of the License, or
-//    (at your option) any later version.
-//
-//    This program is distributed in the hope that it will be useful,
-//    but WITHOUT ANY WARRANTY; without even the implied warranty of
-//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//    GNU General Public License for more details.
-//
-//    You should have received a copy of the GNU General Public License
-//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-package org.openstreetmap.josm.plugins.imageryxmlbounds.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.JList;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-
-/**
- * 
- * @author Don-vip
- *
- */
-@SuppressWarnings("serial")
-public class ShowBoundsListAction extends ShowBoundsAction implements ListSelectionListener {
-
-	@Override
-	public void valueChanged(ListSelectionEvent e) {
-		if (!e.getValueIsAdjusting()) {
-			JList list = (JList) e.getSource();
-			if (list.getModel().getSize() > list.getSelectionModel().getMaxSelectionIndex()) {
-				List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
-				for (Object value : list.getSelectedValues()) {
-					if (value instanceof OsmPrimitive) {
-						primitives.add((OsmPrimitive) value);
-					}
-				}
-				updateOsmPrimitives(primitives);
-			}
-		}
-	}
-}
Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsPropertiesAction.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsPropertiesAction.java	(revision 28657)
+++ 	(revision )
@@ -1,38 +1,0 @@
-//    JOSM Imagery XML Bounds plugin.
-//    Copyright (C) 2011 Don-vip
-//
-//    This program is free software: you can redistribute it and/or modify
-//    it under the terms of the GNU General Public License as published by
-//    the Free Software Foundation, either version 3 of the License, or
-//    (at your option) any later version.
-//
-//    This program is distributed in the hope that it will be useful,
-//    but WITHOUT ANY WARRANTY; without even the implied warranty of
-//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//    GNU General Public License for more details.
-//
-//    You should have received a copy of the GNU General Public License
-//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-package org.openstreetmap.josm.plugins.imageryxmlbounds.actions;
-
-import java.util.Collections;
-
-import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog.RelationRelated;
-
-@SuppressWarnings("serial")
-public class ShowBoundsPropertiesAction extends ShowBoundsAction implements RelationRelated {
-
-    protected Relation relation;
-    
-    @Override
-    public Relation getRelation() {
-        return relation;
-    }
-
-    @Override
-    public void setRelation(Relation relation) {
-        this.relation = relation;
-        updateOsmPrimitives(Collections.singleton(relation));
-    }
-}
