Index: applications/editors/josm/plugins/scripting/scripts/AddHouseNumbers.groovy
===================================================================
--- applications/editors/josm/plugins/scripting/scripts/AddHouseNumbers.groovy	(revision 25083)
+++ applications/editors/josm/plugins/scripting/scripts/AddHouseNumbers.groovy	(revision 25107)
@@ -1,2 +1,3 @@
+
 /*
  * This scripts sets a sequence of house numbers on the currently selected nodes.
@@ -6,4 +7,9 @@
 
 import java.awt.BorderLayout;
+import javax.swing.JComponent;
+
+import java.awt.event.KeyEvent;
+
+import javax.swing.KeyStroke;
 
 import groovy.swing.SwingBuilder;
@@ -30,4 +36,5 @@
 import javax.swing.JLabel;
 
+import javax.swing.Action;
 import javax.swing.BorderFactory;
 import javax.swing.JTextField;
@@ -38,4 +45,12 @@
 
 class AddHouseNumberDialog extends JDialog {
+	
+	static private AddHouseNumberDialog instance;
+	static def  AddHouseNumberDialog getInstance() {
+		if (instance == null){
+			instance = new AddHouseNumberDialog()
+		}
+		return instance
+	}
 	
 	private JTextField tfStart;
@@ -52,5 +67,5 @@
 		<html>
 		Enter the <strong>first house number</strong> to be applied to the currently selected nodes
-		and the amount by which the house number is <strong>incremented</strong>.
+		and the <strong>increment</strong> between consecutive house numbers.
 		</html>
 		"""
@@ -61,4 +76,5 @@
 		SwingBuilder swing = new SwingBuilder()
 		return swing.panel(){
+			emptyBorder([5,5,5,5],parent:true)
 			gridBagLayout()
 			label(text: "Start:", 
@@ -67,7 +83,10 @@
 			)
 			tfStart = textField(constraints: gbc(gridx:1,gridy:0,weightx:1.0, weighty:0.0, fill: GridBagConstraints.HORIZONTAL, insets:[2,2,2,2]))
+			SelectAllOnFocusGainedDecorator.decorate(tfStart)
 			label(text: "Increment:", horizontalAlignment: JLabel.LEFT, constraints: gbc(gridx:0,gridy:1,weightx:0.0, weighty:0.0, anchor: GridBagConstraints.WEST, insets:[2,2,2,2]))
 			tfIncrement = textField(constraints: gbc(gridx:1,gridy:1,weightx:1.0, weighty:0.0, fill: GridBagConstraints.HORIZONTAL, anchor: GridBagConstraints.WEST, insets:[2,2,2,2]))
+			SelectAllOnFocusGainedDecorator.decorate(tfIncrement)
 			panel(constraints: gbc(gridx:0,gridy:2,weightx:1.0, weighty:1.0, gridwidth:2, fill: GridBagConstraints.BOTH, insets:[2,2,2,2]))
+			tfIncrement.text = "2"
 		} 
 	}
@@ -76,34 +95,28 @@
 		SwingBuilder swing = new SwingBuilder()
 		return swing.panel(layout: new FlowLayout(FlowLayout.CENTER)) {
+		    def actApply = action(name: "Apply", smallIcon: ImageProvider.get("ok"), closure: {apply(); setVisible(false)})
+			def btnApply = button(action: actApply)
+			btnApply.setFocusable(true)
+			btnApply.registerKeyboardAction(actApply, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0, false), JComponent.WHEN_FOCUSED)
+		    					
 			button(text: "Cancel", icon: ImageProvider.get("cancel"), actionPerformed: {setVisible(false)})
-			button(text: "Apply", icon: ImageProvider.get("ok"), actionPerformed: {
-				apply()
-				setVisible(false)
-			})
 		}
 	}
-	
+		
 	def apply() {
 		def start
+		def incr
 		try {
 			start = tfStart.text.trim().toInteger()
+			incr = tfIncrement.text.trim().toInteger()
 		} catch(NumberFormatException e){
 			e.printStackTrace()
 			return
 		}
-		def incr
-		try  {
-			incr = tfIncrement.text.trim().toInteger()
-		} catch(NumberFormatException e){
-			e.printStackTrace()
-			return
-		} 
-		def nodes = getCurrentlySelectedNodes()
-		def cmds = []
-		nodes.each {Node n ->
+		def cmds = getCurrentlySelectedNodes().collect { Node n ->
 			Node nn = new Node(n)
 			nn.put("addr:housenumber", start.toString())
 			start += incr
-			cmds << new ChangeCommand(n, nn)			
+			return new ChangeCommand(n, nn)			
 		}
 		if (cmds.isEmpty()) return
@@ -112,5 +125,5 @@
 	
 	def build() {
-		setTitle("Set house numbers")
+		title = "Set house numbers"
 		def cp = getContentPane()
 		cp.setLayout(new BorderLayout())
@@ -121,5 +134,5 @@
 	
 	def getCurrentDataSet() {
-		def layer = Main?.map?.mapView?.getActiveLayer()
+		def layer = Main?.map?.mapView?.activeLayer
 		if (layer == null) return null
 		if (! (layer instanceof OsmDataLayer)) return null
@@ -142,4 +155,4 @@
 }
 
-def dialog = new AddHouseNumberDialog()
-dialog.setVisible(true)
+AddHouseNumberDialog.instance.setVisible(true)
+
