Index: applications/editors/josm/plugins/AddressEdit/README
===================================================================
--- applications/editors/josm/plugins/AddressEdit/README	(revision 23816)
+++ applications/editors/josm/plugins/AddressEdit/README	(revision 23816)
@@ -0,0 +1,6 @@
+README 
+======
+
+This plugin offers handy functions to fix addresses.
+
+Author: Oliver Wieland <oliver.wieland@online.de>
Index: applications/editors/josm/plugins/AddressEdit/REVISION
===================================================================
--- applications/editors/josm/plugins/AddressEdit/REVISION	(revision 23815)
+++ 	(revision )
@@ -1,3 +1,0 @@
-svn: '.' is not a working copy<?xml version="1.0"?>
-<info>
-
Index: applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressNode.java
===================================================================
--- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressNode.java	(revision 23815)
+++ applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressNode.java	(revision 23816)
@@ -94,7 +94,40 @@
 	 */
 	public String getCountry() {
+		if (!TagUtils.hasAddrCountryTag(osmObject)) {
+			return MISSING_TAG;
+		}
 		return TagUtils.getAddrCountryValue(osmObject);
 	}
 	
+	
+	
+	@Override
+	public int compareTo(INodeEntity o) {
+		if (o == null || !(o instanceof AddressNode)) {
+			return -1;
+		}
+		AddressNode other = (AddressNode) o;
+		
+		int cc = 0;
+		cc = this.getCountry().compareTo(other.getCountry());
+		if ( cc  == 0) {
+			cc = this.getState().compareTo(other.getState());
+			
+			if (cc  == 0) {
+				cc = this.getCity().compareTo(other.getCity());
+				
+				if (cc  == 0) {
+					cc = this.getStreet().compareTo(other.getStreet());
+					
+					if (cc  == 0) {
+						cc = this.getHouseNumber().compareTo(other.getHouseNumber());
+					}
+				}
+			}
+		}
+		
+		return cc;
+	}
+
 	@Override
 	public String toString() {
Index: applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressVisitor.java
===================================================================
--- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressVisitor.java	(revision 23815)
+++ applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressVisitor.java	(revision 23816)
@@ -30,4 +30,5 @@
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -131,5 +132,8 @@
 	
 	public List<StreetNode> getStreetList() {
-		return new ArrayList<StreetNode>(streetDict.values());
+		
+		ArrayList<StreetNode> sortedList = new ArrayList<StreetNode>(streetDict.values());
+		Collections.sort(sortedList);
+		return sortedList;
 	}
 
Index: applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/INodeEntity.java
===================================================================
--- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/INodeEntity.java	(revision 23815)
+++ applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/INodeEntity.java	(revision 23816)
@@ -18,5 +18,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 
-public interface INodeEntity {
+public interface INodeEntity extends Comparable<INodeEntity> {
 	/**
 	 * Gets the underlying OSM object.
Index: applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/NodeEntityBase.java
===================================================================
--- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/NodeEntityBase.java	(revision 23815)
+++ applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/NodeEntityBase.java	(revision 23816)
@@ -20,5 +20,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 
-public class NodeEntityBase implements INodeEntity {
+public class NodeEntityBase implements INodeEntity, Comparable<INodeEntity> {
 	public static final String ANONYMOUS = tr("No name");
 	
@@ -74,4 +74,10 @@
 	}
 
+	@Override
+	public int compareTo(INodeEntity o) {
+		if (o == null || !(o instanceof NodeEntityBase)) return -1;
+		return this.getName().compareTo(o.getName());
+	}
+
 	
 }
Index: applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/StreetNode.java
===================================================================
--- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/StreetNode.java	(revision 23815)
+++ applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/StreetNode.java	(revision 23816)
@@ -15,4 +15,5 @@
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
@@ -48,4 +49,5 @@
 		
 		children.add(segment);
+		Collections.sort(children);
 	}
 	
Index: applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/AddressEditDialog.java
===================================================================
--- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/AddressEditDialog.java	(revision 23815)
+++ applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/AddressEditDialog.java	(revision 23816)
@@ -36,5 +36,5 @@
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreeSelectionModel;
 
 public class AddressEditDialog extends JFrame implements ActionListener, TreeSelectionListener {
@@ -72,8 +72,12 @@
 		setLocation(100, 100);
 
+		// TODO: Proper init, if model is null
 		if (model != null) {
 			JPanel streetPanel = new JPanel(new BorderLayout());
 			streetsTree = new JTree(new DefaultTreeModel(model.getStreetsTree()));
+			streetsTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
 			streetsTree.addTreeSelectionListener(this);
+			streetsTree.setCellRenderer(new StreetTreeCellRenderer());
+			
 			JScrollPane scroll1 = new JScrollPane(streetsTree);
 			streetPanel.add(scroll1, BorderLayout.CENTER);
@@ -84,4 +88,5 @@
 			unresolvedTree = new JTree(new DefaultTreeModel(model.getUnresolvedAddressesTree()));
 			unresolvedTree.addTreeSelectionListener(this);
+			
 			JScrollPane scroll2 = new JScrollPane(unresolvedTree);
 			unresolvedPanel.add(scroll2, BorderLayout.CENTER);
