Index: plications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AbstractAddressEditAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AbstractAddressEditAction.java	(revision 24104)
+++ 	(revision )
@@ -1,246 +1,0 @@
-/*
- * 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.fixAddresses.gui;
-
-import java.awt.event.ActionEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.command.Command;
-import org.openstreetmap.josm.command.SequenceCommand;
-import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
-import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener;
-import org.openstreetmap.josm.plugins.fixAddresses.ICommandListener;
-import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
-import org.openstreetmap.josm.plugins.fixAddresses.StringUtils;
-
-/**
- * Base class for all address related action. An action can work as well on all addresses collected by the
- * container or on the active selection.
- * By default, the action is disabled and the updateEnabledState(...) have to be implemented by
- * subclasses. There are also two separate <tt>actionPerformedXX</tt> methods to do the action on
- * container or on selection items.
- * Most actions will work in both cases, so it is recommended to have one single method which
- * accepts a list of addresses or streets and executes the tasks to be done by this action.
- *  
- * @author Oliver Wieland <oliver.wieland@online.de>
- */
-
-@SuppressWarnings("serial")
-public abstract class AbstractAddressEditAction extends JosmAction implements IAddressEditContainerListener, ICommandListener {	
-	private AddressEditSelectionEvent event;
-	protected AddressEditContainer container;
-	private List<Command> commands;
-	private String txName;
-
-	/**
-	 * @param name
-	 * @param icon
-	 */
-	public AbstractAddressEditAction(String name, String iconName, String tooltip) {
-		super(name, iconName, tooltip, null, true);
-		
-		setEnabled(false);
-	}
-
-	/**
-	 * @param name
-	 */
-	public AbstractAddressEditAction(String name) {
-		this(name, null, "");
-	}
-	
-	/**
-	 * Gets the current address container.
-	 * @return the container
-	 */
-	public AddressEditContainer getContainer() {
-		return container;
-	}
-
-	/**
-	 * @param container the container to set
-	 */
-	public void setContainer(AddressEditContainer container) {
-		if (container != null) { // remove old listener first
-			container.removeChangedListener(this);
-		}
-		this.container = container;
-		updateEnabledState();
-		if (container != null) {
-			container.addChangedListener(this);
-		}
-	}
-
-	/**
-	 * @return the event
-	 */
-	protected AddressEditSelectionEvent getEvent() {
-		return event;
-	}
-
-	/**
-	 * @param event the event to set
-	 */
-	protected void setEvent(AddressEditSelectionEvent event) {
-		this.event = event;
-		updateEnabledState();
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-	 */
-	@Override
-	public void actionPerformed(ActionEvent arg0) {
-		if (event != null) { // use the event acquired previously.
-			addressEditActionPerformed(event);	
-			event = null; // consume event
-		} else {
-			if (container != null) {
-				addressEditActionPerformed(container);
-			} else { // call super class hook
-				actionPerformed(arg0);
-			}
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.actions.JosmAction#updateEnabledState()
-	 */
-	@Override
-	protected void updateEnabledState() {
-		if (this.event != null) {
-			updateEnabledState(this.event);
-		} else {
-			if (container != null) {
-				updateEnabledState(container);
-			} else {
-				super.updateEnabledState();
-			}
-		}
-	}
-
-	/**
-	 * Updates 'enabled' state depending on the given address container object.
-	 * @param container The address container (maybe null).
-	 * @return
-	 */
-	protected abstract void updateEnabledState(AddressEditContainer container);
-	
-	/**
-	 * Updates 'enabled' state depending on the current selection.
-	 * @param container The selection event.
-	 * @return
-	 */
-	protected abstract void updateEnabledState(AddressEditSelectionEvent event);
-
-	/**
-	 * Redirected action handler for doing actions on a address selection.
-	 * @param ev
-	 */
-	public abstract void addressEditActionPerformed(AddressEditSelectionEvent ev);
-	
-	/**
-	 * Redirected action handler for doing actions on an address container.
-	 * @param ev
-	 */
-	public abstract void addressEditActionPerformed(AddressEditContainer container);
-	
-	
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#containerChanged(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	public void containerChanged(AddressEditContainer container) {
-		updateEnabledState();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
-	 */
-	@Override
-	public void entityChanged(IOSMEntity node) {
-		updateEnabledState();		
-	}
-	
-	/**
-	 * Begins the transaction (command sequence). Must be called by every subclass before
-	 * any modification on OSM objects starts.
-	 *
-	 * @param txName the name of the transaction (e. g. "change address tags").
-	 */
-	public void beginTransaction(String txName) {
-		if (commands != null && commands.size() > 0) {
-			throw new RuntimeException("TX has not been closed (missing finishTransaction?)");
-		}
-		
-		commands = new ArrayList<Command>();
-		if (StringUtils.isNullOrEmpty(txName)) {
-			throw new RuntimeException("Transaction must have a name");
-		}
-		this.txName = txName;
-	}
-	
-	/**
-	 * Finishes the transaction and passes the command sequence to the framework.
-	 */
-	public void finishTransaction() {
-		if (commands == null) {
-			throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
-		}
-		// execute the command
-		Main.main.undoRedo.add(new SequenceCommand(txName, commands));
-		commands.clear();
-		container.invalidate();
-	}
-	
-	/**
-	 * Begins the transaction for a single object.
-	 *
-	 * @param entity the entity
-	 */
-	public void beginObjectTransaction(IOSMEntity entity) {
-		if (entity != null) {
-			entity.addCommandListener(this);
-		} else {
-			throw new RuntimeException("Entity must not be null");
-		}
-	}
-	
-	/**
-	 * Finishes the transaction for a single object.
-	 *
-	 * @param entity the entity
-	 */
-	public void finishObjectTransaction(IOSMEntity entity) {
-		if (entity != null) {
-			entity.removeCommandListener(this);
-		} else {
-			throw new RuntimeException("Entity must not be null");
-		}
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.ICommandListener#commandIssued(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity, org.openstreetmap.josm.command.Command)
-	 */
-	@Override
-	public void commandIssued(IOSMEntity entity, Command command) {
-		if (commands == null) {
-			throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
-		}
-		commands.add(command);
-	}
-}
Index: /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java	(revision 24104)
+++ /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java	(revision 24105)
@@ -55,4 +55,10 @@
 import org.openstreetmap.josm.plugins.fixAddresses.OSMStreet;
 import org.openstreetmap.josm.plugins.fixAddresses.StringUtils;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.ApplyAllGuessesAction;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AssignAddressToStreetAction;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.GuessAddressDataAction;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.RemoveAddressTagsAction;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.SelectAddressesInMapAction;
 import org.openstreetmap.josm.tools.ImageProvider;
 
Index: plications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/ApplyAllGuessesAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/ApplyAllGuessesAction.java	(revision 24104)
+++ 	(revision )
@@ -1,127 +1,0 @@
-/*
- * 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.fixAddresses.gui;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.Point;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.JTable;
-
-import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
-import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
-import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
-
-/**
- * Applies the guessed values for a set of addresses. 
- * @author Oliver Wieland <oliver.wieland@online.de>
- * 
- */
-
-@SuppressWarnings("serial")
-public class ApplyAllGuessesAction extends AbstractAddressEditAction implements MouseListener{
-
-	public ApplyAllGuessesAction() {
-		//super(tr("Apply all guesses"), "applyguesses_24", "Turns all guesses into the corresponding tag values.");
-		super(tr("Apply all guesses"), "applyguesses_24", "Turns all guesses into the corresponding tag values.");
-	}
-
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		if (ev == null || ev.getSelectedUnresolvedAddresses() == null) return;
-		// fix SELECTED items only
-		List<OSMAddress> addrToFix = ev.getSelectedUnresolvedAddresses();
-		applyGuesses(addrToFix);
-	}
-
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(container != null && container.getNumberOfGuesses() > 0);
-	}
-
-	private void applyGuesses(List<OSMAddress> addrToFix) {
-		beginTransaction(tr("Applied guessed values"));
-		List<OSMAddress> addrToFixShadow = new ArrayList<OSMAddress>(addrToFix);
-		for (OSMAddress aNode : addrToFixShadow) {
-			beginObjectTransaction(aNode);
-			aNode.applyAllGuesses();
-			finishObjectTransaction(aNode);
-		}
-		finishTransaction();
-	}
-
-	@Override
-	protected void updateEnabledState(AddressEditSelectionEvent event) {
-		// do nothing here
-	}
-
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		if (container == null || container.getUnresolvedAddresses() == null) return;
-		
-		List<OSMAddress> addrToFix = container.getUnresolvedAddresses();
-		applyGuesses(addrToFix);		
-	}
-
-	@Override
-	public void mouseClicked(MouseEvent e) {
-		JTable table = (JTable)e.getSource();
-		Point p = e.getPoint();
-		if(e.getClickCount() == 2) {						
-			AddressEditTableModel model = (AddressEditTableModel) table.getModel();
-			if (model != null) {
-				int row = table.rowAtPoint(p);
-				IOSMEntity node = model.getEntityOfRow(row);
-				if (node instanceof OSMAddress) {
-					beginTransaction(tr("Applied guessed values for ") + node.getOsmObject());
-					beginObjectTransaction(node);
-					OSMAddress aNode = (OSMAddress) node;
-					if (aNode.hasGuessedStreetName()) {
-						aNode.applyAllGuesses();
-					}
-					finishObjectTransaction(node);
-					finishTransaction();
-				}
-			}
-		}
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent arg0) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public void mouseExited(MouseEvent arg0) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public void mousePressed(MouseEvent arg0) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent arg0) {
-		// TODO Auto-generated method stub
-		
-	}
-}
Index: plications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AssignAddressToStreetAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AssignAddressToStreetAction.java	(revision 24104)
+++ 	(revision )
@@ -1,78 +1,0 @@
-/*
- * 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.fixAddresses.gui;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
-import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
-import org.openstreetmap.josm.plugins.fixAddresses.OSMStreet;
-
-/**
- * Assigns one or more selected addresses to a street, i. e. the name of the street is 
- * used as value for the addr:street tag. 
- * @author Oliver Wieland <oliver.wieland@online.de>
- * 
- */
-public class AssignAddressToStreetAction extends AbstractAddressEditAction  {
-
-	public AssignAddressToStreetAction() {
-		super(tr("Assign address to street"), "assignstreet_24", "Assign the selected address(es) to the selected street.");
-	}
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -6180491357232121384L;
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {		
-		OSMStreet streetNode = ev.getSelectedStreet();
-						
-		if (streetNode != null && ev.getSelectedUnresolvedAddresses() != null) {
-			beginTransaction(tr("Set street name") + " '" + streetNode.getName() + "'");
-			for (OSMAddress addrNode : ev.getSelectedUnresolvedAddresses()) {
-				beginObjectTransaction(addrNode);
-				addrNode.assignStreet(streetNode);
-				finishObjectTransaction(addrNode);
-			}
-			finishTransaction();
-		}
-		
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void updateEnabledState(AddressEditSelectionEvent ev) {
-		setEnabled(ev.getSelectedStreet() != null && ev.getSelectedUnresolvedAddresses() != null);
-	}
-
-	@Override
-	public void updateEnabledState(AddressEditContainer container) {
-		// we only accept a selection here
-		setEnabled(false);
-	}
-
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		// we only accept a selection: nothing to do here		
-	}
-
-
-}
Index: plications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/GuessAddressDataAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/GuessAddressDataAction.java	(revision 24104)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/*
- * 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.fixAddresses.gui;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.util.List;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
-import org.openstreetmap.josm.plugins.fixAddresses.GuessAddressRunnable;
-import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
-import org.openstreetmap.josm.plugins.fixAddresses.IProgressMonitorFinishedListener;
-
-/**
- * Guesses address tags by picking the closest street node with a name. The same is done (some day)
- * with city, post code, state,... However, I strongly encourage you to check the result.
- * @author Oliver Wieland <oliver.wieland@online.de>
- * 
- */
-
-@SuppressWarnings("serial")
-public class GuessAddressDataAction extends AbstractAddressEditAction implements IProgressMonitorFinishedListener {
-
-	public GuessAddressDataAction() {
-		super(tr("Guess address data"), "guessstreets_24", "Tries to guess the street name by picking the name of the closest way.");
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void updateEnabledState(AddressEditSelectionEvent ev) {
-		setEnabled(ev != null && ev.getUnresolvedAddressTable() != null);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(container != null && container.getNumberOfIncompleteAddresses() > 0);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		if (container == null) return;
-		if (container.getUnresolvedAddresses() == null) return;
-				
-		internalGuessAddresses(container.getIncompleteAddresses());
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		if (ev == null || ev.getSelectedUnresolvedAddresses() == null) return;
-		
-		// guess tags for selected addresses only
-		internalGuessAddresses(ev.getSelectedUnresolvedAddresses());		
-	}
-	
-	/**
-	 * Internal method to start several threads guessing tag values for the given list of addresses.
-	 * @param addrNodes
-	 */
-	private void internalGuessAddresses(List<OSMAddress> nodes) {
-		GuessAddressRunnable aft = new GuessAddressRunnable(nodes, tr("Guess street names"));
-		aft.addFinishListener(this);
-		Main.worker.submit(aft);
-	}
-
-	@Override
-	public void finished() {
-		if (container != null) {
-			container.invalidate();
-		}
-	}
-}
Index: plications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/RemoveAddressTagsAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/RemoveAddressTagsAction.java	(revision 24104)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/*
- * 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.fixAddresses.gui;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
-import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
-
-@SuppressWarnings("serial")
-public class RemoveAddressTagsAction extends AbstractAddressEditAction {
-
-	public RemoveAddressTagsAction() {
-		super(tr("Remove address tags"), "removeaddrtags_24", tr("Removes address related tags from the object."));
-	}
-
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		beginTransaction(tr("Remove address tags"));
-		for (OSMAddress aNode : ev.getSelectedUnresolvedAddresses()) {
-			beginObjectTransaction(aNode);
-			aNode.removeAllAddressTags();
-			finishObjectTransaction(aNode);
-		}
-		finishTransaction();		
-	}
-
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		// do nothing
-	}
-
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(false);
-	}
-
-	@Override
-	protected void updateEnabledState(AddressEditSelectionEvent event) {
-		if (event == null) {
-			setEnabled(false);
-		}
-		
-		setEnabled(event.getSelectedUnresolvedAddresses() != null);
-	}
-
-}
Index: plications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/SelectAddressesInMapAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/SelectAddressesInMapAction.java	(revision 24104)
+++ 	(revision )
@@ -1,101 +1,0 @@
-/*
- * 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/>.
- */
-/**
- * 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/>.
- */
-
-/* File created on 30.10.2010 */
-package org.openstreetmap.josm.plugins.fixAddresses.gui;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
-import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
-
-/**
- *
- * @author Oliver Wieland <oliver.wieland@online.de>
- * 
- */
-
-@SuppressWarnings("serial")
-public class SelectAddressesInMapAction extends AbstractAddressEditAction {
-
-	public SelectAddressesInMapAction() {
-		// we simply use the existing icon :-|
-		super(tr("Select in map"), "selectall", "Selects selected addresses in the map");
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
-		if (ev == null) return;
-		
-		internalSelectAddresses(ev.getSelectedUnresolvedAddresses());
-	}
-
-	@Override
-	public void addressEditActionPerformed(AddressEditContainer container) {
-		internalSelectAddresses(container.getUnresolvedAddresses());		
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.AddressEditContainer)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditContainer container) {
-		setEnabled(container != null && container.getNumberOfIncompleteAddresses() > 0);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
-	 */
-	@Override
-	protected void updateEnabledState(AddressEditSelectionEvent event) {
-		setEnabled(event != null && event.getSelectedUnresolvedAddresses() != null);
-	}
-
-	/**
-	 * Internal helper to select the given addresses in the map. 
-	 * @param addrToSel
-	 */
-	private void internalSelectAddresses(List<OSMAddress> addrToSel) {
-		if (addrToSel == null) return;
-		
-		List<OsmPrimitive> sel = new ArrayList<OsmPrimitive>();
-		
-		for (OSMAddress aNode : addrToSel) {
-			sel.add(aNode.getOsmObject());
-		}
-
-		getCurrentDataSet().setSelected(sel);
-	}
-
-}
Index: /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java	(revision 24105)
+++ /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java	(revision 24105)
@@ -0,0 +1,247 @@
+/*
+ * 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.fixAddresses.gui.actions;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.SequenceCommand;
+import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
+import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener;
+import org.openstreetmap.josm.plugins.fixAddresses.ICommandListener;
+import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
+import org.openstreetmap.josm.plugins.fixAddresses.StringUtils;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent;
+
+/**
+ * Base class for all address related action. An action can work as well on all addresses collected by the
+ * container or on the active selection.
+ * By default, the action is disabled and the updateEnabledState(...) have to be implemented by
+ * subclasses. There are also two separate <tt>actionPerformedXX</tt> methods to do the action on
+ * container or on selection items.
+ * Most actions will work in both cases, so it is recommended to have one single method which
+ * accepts a list of addresses or streets and executes the tasks to be done by this action.
+ *  
+ * @author Oliver Wieland <oliver.wieland@online.de>
+ */
+
+@SuppressWarnings("serial")
+public abstract class AbstractAddressEditAction extends JosmAction implements IAddressEditContainerListener, ICommandListener {	
+	private AddressEditSelectionEvent event;
+	protected AddressEditContainer container;
+	private List<Command> commands;
+	private String txName;
+
+	/**
+	 * @param name
+	 * @param icon
+	 */
+	public AbstractAddressEditAction(String name, String iconName, String tooltip) {
+		super(name, iconName, tooltip, null, true);
+		
+		setEnabled(false);
+	}
+
+	/**
+	 * @param name
+	 */
+	public AbstractAddressEditAction(String name) {
+		this(name, null, "");
+	}
+	
+	/**
+	 * Gets the current address container.
+	 * @return the container
+	 */
+	public AddressEditContainer getContainer() {
+		return container;
+	}
+
+	/**
+	 * @param container the container to set
+	 */
+	public void setContainer(AddressEditContainer container) {
+		if (container != null) { // remove old listener first
+			container.removeChangedListener(this);
+		}
+		this.container = container;
+		updateEnabledState();
+		if (container != null) {
+			container.addChangedListener(this);
+		}
+	}
+
+	/**
+	 * @return the event
+	 */
+	protected AddressEditSelectionEvent getEvent() {
+		return event;
+	}
+
+	/**
+	 * @param event the event to set
+	 */
+	public void setEvent(AddressEditSelectionEvent event) {
+		this.event = event;
+		updateEnabledState();
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	@Override
+	public void actionPerformed(ActionEvent arg0) {
+		if (event != null) { // use the event acquired previously.
+			addressEditActionPerformed(event);	
+			event = null; // consume event
+		} else {
+			if (container != null) {
+				addressEditActionPerformed(container);
+			} else { // call super class hook
+				actionPerformed(arg0);
+			}
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.actions.JosmAction#updateEnabledState()
+	 */
+	@Override
+	protected void updateEnabledState() {
+		if (this.event != null) {
+			updateEnabledState(this.event);
+		} else {
+			if (container != null) {
+				updateEnabledState(container);
+			} else {
+				super.updateEnabledState();
+			}
+		}
+	}
+
+	/**
+	 * Updates 'enabled' state depending on the given address container object.
+	 * @param container The address container (maybe null).
+	 * @return
+	 */
+	protected abstract void updateEnabledState(AddressEditContainer container);
+	
+	/**
+	 * Updates 'enabled' state depending on the current selection.
+	 * @param container The selection event.
+	 * @return
+	 */
+	protected abstract void updateEnabledState(AddressEditSelectionEvent event);
+
+	/**
+	 * Redirected action handler for doing actions on a address selection.
+	 * @param ev
+	 */
+	public abstract void addressEditActionPerformed(AddressEditSelectionEvent ev);
+	
+	/**
+	 * Redirected action handler for doing actions on an address container.
+	 * @param ev
+	 */
+	public abstract void addressEditActionPerformed(AddressEditContainer container);
+	
+	
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#containerChanged(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
+	 */
+	@Override
+	public void containerChanged(AddressEditContainer container) {
+		updateEnabledState();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
+	 */
+	@Override
+	public void entityChanged(IOSMEntity node) {
+		updateEnabledState();		
+	}
+	
+	/**
+	 * Begins the transaction (command sequence). Must be called by every subclass before
+	 * any modification on OSM objects starts.
+	 *
+	 * @param txName the name of the transaction (e. g. "change address tags").
+	 */
+	public void beginTransaction(String txName) {
+		if (commands != null && commands.size() > 0) {
+			throw new RuntimeException("TX has not been closed (missing finishTransaction?)");
+		}
+		
+		commands = new ArrayList<Command>();
+		if (StringUtils.isNullOrEmpty(txName)) {
+			throw new RuntimeException("Transaction must have a name");
+		}
+		this.txName = txName;
+	}
+	
+	/**
+	 * Finishes the transaction and passes the command sequence to the framework.
+	 */
+	public void finishTransaction() {
+		if (commands == null) {
+			throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
+		}
+		// execute the command
+		Main.main.undoRedo.add(new SequenceCommand(txName, commands));
+		commands.clear();
+		container.invalidate();
+	}
+	
+	/**
+	 * Begins the transaction for a single object.
+	 *
+	 * @param entity the entity
+	 */
+	public void beginObjectTransaction(IOSMEntity entity) {
+		if (entity != null) {
+			entity.addCommandListener(this);
+		} else {
+			throw new RuntimeException("Entity must not be null");
+		}
+	}
+	
+	/**
+	 * Finishes the transaction for a single object.
+	 *
+	 * @param entity the entity
+	 */
+	public void finishObjectTransaction(IOSMEntity entity) {
+		if (entity != null) {
+			entity.removeCommandListener(this);
+		} else {
+			throw new RuntimeException("Entity must not be null");
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.fixAddresses.ICommandListener#commandIssued(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity, org.openstreetmap.josm.command.Command)
+	 */
+	@Override
+	public void commandIssued(IOSMEntity entity, Command command) {
+		if (commands == null) {
+			throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
+		}
+		commands.add(command);
+	}
+}
Index: /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java	(revision 24105)
+++ /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java	(revision 24105)
@@ -0,0 +1,129 @@
+/*
+ * 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.fixAddresses.gui.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JTable;
+
+import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
+import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
+import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditTableModel;
+
+/**
+ * Applies the guessed values for a set of addresses. 
+ * @author Oliver Wieland <oliver.wieland@online.de>
+ * 
+ */
+
+@SuppressWarnings("serial")
+public class ApplyAllGuessesAction extends AbstractAddressEditAction implements MouseListener{
+
+	public ApplyAllGuessesAction() {
+		//super(tr("Apply all guesses"), "applyguesses_24", "Turns all guesses into the corresponding tag values.");
+		super(tr("Apply all guesses"), "applyguesses_24", "Turns all guesses into the corresponding tag values.");
+	}
+
+	@Override
+	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+		if (ev == null || ev.getSelectedUnresolvedAddresses() == null) return;
+		// fix SELECTED items only
+		List<OSMAddress> addrToFix = ev.getSelectedUnresolvedAddresses();
+		applyGuesses(addrToFix);
+	}
+
+	@Override
+	protected void updateEnabledState(AddressEditContainer container) {
+		setEnabled(container != null && container.getNumberOfGuesses() > 0);
+	}
+
+	private void applyGuesses(List<OSMAddress> addrToFix) {
+		beginTransaction(tr("Applied guessed values"));
+		List<OSMAddress> addrToFixShadow = new ArrayList<OSMAddress>(addrToFix);
+		for (OSMAddress aNode : addrToFixShadow) {
+			beginObjectTransaction(aNode);
+			aNode.applyAllGuesses();
+			finishObjectTransaction(aNode);
+		}
+		finishTransaction();
+	}
+
+	@Override
+	protected void updateEnabledState(AddressEditSelectionEvent event) {
+		// do nothing here
+	}
+
+	@Override
+	public void addressEditActionPerformed(AddressEditContainer container) {
+		if (container == null || container.getUnresolvedAddresses() == null) return;
+		
+		List<OSMAddress> addrToFix = container.getUnresolvedAddresses();
+		applyGuesses(addrToFix);		
+	}
+
+	@Override
+	public void mouseClicked(MouseEvent e) {
+		JTable table = (JTable)e.getSource();
+		Point p = e.getPoint();
+		if(e.getClickCount() == 2) {						
+			AddressEditTableModel model = (AddressEditTableModel) table.getModel();
+			if (model != null) {
+				int row = table.rowAtPoint(p);
+				IOSMEntity node = model.getEntityOfRow(row);
+				if (node instanceof OSMAddress) {
+					beginTransaction(tr("Applied guessed values for ") + node.getOsmObject());
+					beginObjectTransaction(node);
+					OSMAddress aNode = (OSMAddress) node;
+					if (aNode.hasGuessedStreetName()) {
+						aNode.applyAllGuesses();
+					}
+					finishObjectTransaction(node);
+					finishTransaction();
+				}
+			}
+		}
+	}
+
+	@Override
+	public void mouseEntered(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void mouseExited(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void mousePressed(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void mouseReleased(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+}
Index: /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AssignAddressToStreetAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AssignAddressToStreetAction.java	(revision 24105)
+++ /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AssignAddressToStreetAction.java	(revision 24105)
@@ -0,0 +1,79 @@
+/*
+ * 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.fixAddresses.gui.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
+import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
+import org.openstreetmap.josm.plugins.fixAddresses.OSMStreet;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent;
+
+/**
+ * Assigns one or more selected addresses to a street, i. e. the name of the street is 
+ * used as value for the addr:street tag. 
+ * @author Oliver Wieland <oliver.wieland@online.de>
+ * 
+ */
+public class AssignAddressToStreetAction extends AbstractAddressEditAction  {
+
+	public AssignAddressToStreetAction() {
+		super(tr("Assign address to street"), "assignstreet_24", "Assign the selected address(es) to the selected street.");
+	}
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -6180491357232121384L;
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
+	 */
+	@Override
+	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {		
+		OSMStreet streetNode = ev.getSelectedStreet();
+						
+		if (streetNode != null && ev.getSelectedUnresolvedAddresses() != null) {
+			beginTransaction(tr("Set street name") + " '" + streetNode.getName() + "'");
+			for (OSMAddress addrNode : ev.getSelectedUnresolvedAddresses()) {
+				beginObjectTransaction(addrNode);
+				addrNode.assignStreet(streetNode);
+				finishObjectTransaction(addrNode);
+			}
+			finishTransaction();
+		}
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
+	 */
+	@Override
+	public void updateEnabledState(AddressEditSelectionEvent ev) {
+		setEnabled(ev.getSelectedStreet() != null && ev.getSelectedUnresolvedAddresses() != null);
+	}
+
+	@Override
+	public void updateEnabledState(AddressEditContainer container) {
+		// we only accept a selection here
+		setEnabled(false);
+	}
+
+	@Override
+	public void addressEditActionPerformed(AddressEditContainer container) {
+		// we only accept a selection: nothing to do here		
+	}
+
+
+}
Index: /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/GuessAddressDataAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/GuessAddressDataAction.java	(revision 24105)
+++ /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/GuessAddressDataAction.java	(revision 24105)
@@ -0,0 +1,95 @@
+/*
+ * 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.fixAddresses.gui.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.util.List;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
+import org.openstreetmap.josm.plugins.fixAddresses.GuessAddressRunnable;
+import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
+import org.openstreetmap.josm.plugins.fixAddresses.IProgressMonitorFinishedListener;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent;
+
+/**
+ * Guesses address tags by picking the closest street node with a name. The same is done (some day)
+ * with city, post code, state,... However, I strongly encourage you to check the result.
+ * @author Oliver Wieland <oliver.wieland@online.de>
+ * 
+ */
+
+@SuppressWarnings("serial")
+public class GuessAddressDataAction extends AbstractAddressEditAction implements IProgressMonitorFinishedListener {
+
+	public GuessAddressDataAction() {
+		super(tr("Guess address data"), "guessstreets_24", "Tries to guess the street name by picking the name of the closest way.");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
+	 */
+	@Override
+	public void updateEnabledState(AddressEditSelectionEvent ev) {
+		setEnabled(ev != null && ev.getUnresolvedAddressTable() != null);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
+	 */
+	@Override
+	protected void updateEnabledState(AddressEditContainer container) {
+		setEnabled(container != null && container.getNumberOfIncompleteAddresses() > 0);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer)
+	 */
+	@Override
+	public void addressEditActionPerformed(AddressEditContainer container) {
+		if (container == null) return;
+		if (container.getUnresolvedAddresses() == null) return;
+				
+		internalGuessAddresses(container.getIncompleteAddresses());
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent)
+	 */
+	@Override
+	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+		if (ev == null || ev.getSelectedUnresolvedAddresses() == null) return;
+		
+		// guess tags for selected addresses only
+		internalGuessAddresses(ev.getSelectedUnresolvedAddresses());		
+	}
+	
+	/**
+	 * Internal method to start several threads guessing tag values for the given list of addresses.
+	 * @param addrNodes
+	 */
+	private void internalGuessAddresses(List<OSMAddress> nodes) {
+		GuessAddressRunnable aft = new GuessAddressRunnable(nodes, tr("Guess street names"));
+		aft.addFinishListener(this);
+		Main.worker.submit(aft);
+	}
+
+	@Override
+	public void finished() {
+		if (container != null) {
+			container.invalidate();
+		}
+	}
+}
Index: /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/RemoveAddressTagsAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/RemoveAddressTagsAction.java	(revision 24105)
+++ /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/RemoveAddressTagsAction.java	(revision 24105)
@@ -0,0 +1,59 @@
+/*
+ * 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.fixAddresses.gui.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
+import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent;
+
+@SuppressWarnings("serial")
+public class RemoveAddressTagsAction extends AbstractAddressEditAction {
+
+	public RemoveAddressTagsAction() {
+		super(tr("Remove address tags"), "removeaddrtags_24", tr("Removes address related tags from the object."));
+	}
+
+	@Override
+	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+		beginTransaction(tr("Remove address tags"));
+		for (OSMAddress aNode : ev.getSelectedUnresolvedAddresses()) {
+			beginObjectTransaction(aNode);
+			aNode.removeAllAddressTags();
+			finishObjectTransaction(aNode);
+		}
+		finishTransaction();		
+	}
+
+	@Override
+	public void addressEditActionPerformed(AddressEditContainer container) {
+		// do nothing
+	}
+
+	@Override
+	protected void updateEnabledState(AddressEditContainer container) {
+		setEnabled(false);
+	}
+
+	@Override
+	protected void updateEnabledState(AddressEditSelectionEvent event) {
+		if (event == null) {
+			setEnabled(false);
+		}
+		
+		setEnabled(event.getSelectedUnresolvedAddresses() != null);
+	}
+
+}
Index: /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java
===================================================================
--- /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java	(revision 24105)
+++ /applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java	(revision 24105)
@@ -0,0 +1,102 @@
+/*
+ * 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/>.
+ */
+/**
+ * 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/>.
+ */
+
+/* File created on 30.10.2010 */
+package org.openstreetmap.josm.plugins.fixAddresses.gui.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
+import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
+import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent;
+
+/**
+ *
+ * @author Oliver Wieland <oliver.wieland@online.de>
+ * 
+ */
+
+@SuppressWarnings("serial")
+public class SelectAddressesInMapAction extends AbstractAddressEditAction {
+
+	public SelectAddressesInMapAction() {
+		// we simply use the existing icon :-|
+		super(tr("Select in map"), "selectall", "Selects selected addresses in the map");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
+	 */
+	@Override
+	public void addressEditActionPerformed(AddressEditSelectionEvent ev) {
+		if (ev == null) return;
+		
+		internalSelectAddresses(ev.getSelectedUnresolvedAddresses());
+	}
+
+	@Override
+	public void addressEditActionPerformed(AddressEditContainer container) {
+		internalSelectAddresses(container.getUnresolvedAddresses());		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.AddressEditContainer)
+	 */
+	@Override
+	protected void updateEnabledState(AddressEditContainer container) {
+		setEnabled(container != null && container.getNumberOfIncompleteAddresses() > 0);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openstreetmap.josm.plugins.addressEdit.gui.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditSelectionEvent)
+	 */
+	@Override
+	protected void updateEnabledState(AddressEditSelectionEvent event) {
+		setEnabled(event != null && event.getSelectedUnresolvedAddresses() != null);
+	}
+
+	/**
+	 * Internal helper to select the given addresses in the map. 
+	 * @param addrToSel
+	 */
+	private void internalSelectAddresses(List<OSMAddress> addrToSel) {
+		if (addrToSel == null) return;
+		
+		List<OsmPrimitive> sel = new ArrayList<OsmPrimitive>();
+		
+		for (OSMAddress aNode : addrToSel) {
+			sel.add(aNode.getOsmObject());
+		}
+
+		getCurrentDataSet().setSelected(sel);
+	}
+
+}
