Index: src/org/openstreetmap/josm/Main.java
===================================================================
--- src/org/openstreetmap/josm/Main.java	(revision 67)
+++ src/org/openstreetmap/josm/Main.java	(revision 68)
@@ -3,5 +3,4 @@
 
 import java.awt.BorderLayout;
-import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.Point;
@@ -11,5 +10,7 @@
 import java.io.File;
 import java.util.Arrays;
-import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.StringTokenizer;
 
 import javax.swing.JFrame;
@@ -66,5 +67,5 @@
 	 * The main panel.
 	 */
-	private Container panel;
+	public JPanel panel;
 	/**
 	 * The mapFrame currently loaded.
@@ -80,4 +81,8 @@
 	 */
 	public File currentDirectory = new File(".");
+
+	private OpenAction openAction;
+
+	private DownloadAction downloadAction;
 	
 	/**
@@ -87,4 +92,5 @@
 	public Main() {
 		super("Java Open Street Map - Editor");
+		Main.main = this;
 		setLayout(new BorderLayout());
 		panel = new JPanel(new BorderLayout());
@@ -93,8 +99,7 @@
 		setVisible(true);
 		
-		// creating actions
-		DownloadAction downloadAction = new DownloadAction();
+		downloadAction = new DownloadAction();
 		UploadAction uploadAction = new UploadAction();
-		OpenAction openAction = new OpenAction();
+		openAction = new OpenAction();
 		SaveAction saveAction = new SaveAction();
 		ExitAction exitAction = new ExitAction();
@@ -188,8 +193,29 @@
 		setupUiDefaults();
 
+		LinkedList<String> arguments = new LinkedList<String>(Arrays.asList(args));
+
+		if (arguments.contains("--help")) {
+			System.out.println("Java OpenStreetMap Editor");
+			System.out.println();
+			System.out.println("usage:");
+			System.out.println("\tjava -jar josm.jar <options>");
+			System.out.println();
+			System.out.println("options:");
+			System.out.println("\t--help                                  Show this help");
+			System.out.println("\t--download=minlat,minlon,maxlat,maxlon  Download the bounding box");
+			System.out.println("\t--open=file(.osm|.xml|.gpx|.txt|.csv)   Open the specific file");
+			System.out.println("\t--no-fullscreen                         Don't launch in fullscreen mode");
+			System.out.println("\t--reset-preferences                     Reset the preferences to default");
+			System.exit(0);
+		}
+
+		
 		// load preferences
 		String errMsg = null;
 		try {
-			pref.load();
+			if (arguments.remove("--reset-preferences"))
+				pref.save();
+			else
+				pref.load();
 		} catch (PreferencesException e1) {
 			e1.printStackTrace();
@@ -211,10 +237,9 @@
 		}
 		
-		main = new Main();
+		new Main();
 		main.setVisible(true);
 
-		Collection<String> arguments = Arrays.asList(args);
-
-		if (arguments.contains("--show-modifiers")) {
+
+		if (arguments.remove("--show-modifiers")) {
 			Point p = main.getLocationOnScreen();
 			Dimension s = main.getSize();
@@ -223,5 +248,5 @@
 		}
 		
-		if (!arguments.contains("--no-fullscreen")) {
+		if (!arguments.remove("--no-fullscreen")) {
 			if (Toolkit.getDefaultToolkit().isFrameStateSupported(MAXIMIZED_BOTH))
 				main.setExtendedState(MAXIMIZED_BOTH); // some platform are able to maximize
@@ -231,6 +256,41 @@
 			}
 		}
-	}
-
+
+		for (Iterator<String> it = arguments.iterator(); it.hasNext();) {
+			String s = it.next();
+			if (s.startsWith("--open=")) {
+				main.openAction.openFile(new File(s.substring(7)));
+				it.remove();
+			} else if (s.startsWith("--download=")) {
+				downloadFromParamString(false, s.substring(11));
+				it.remove();
+			} else if (s.startsWith("--downloadgps=")) {
+				downloadFromParamString(true, s.substring(14));
+				it.remove();
+			}
+		}
+		
+		if (!arguments.isEmpty()) {
+			String s = "Unknown Parameter:\n";
+			for (String arg : arguments)
+				s += arg+"\n";
+			JOptionPane.showMessageDialog(main, s);
+		}
+	}
+
+
+	private static void downloadFromParamString(boolean rawGps, String s) {
+		StringTokenizer st = new StringTokenizer(s, ",");
+		if (st.countTokens() != 4) {
+			JOptionPane.showMessageDialog(main, "Download option does not take "+st.countTokens()+" bounding parameter.");
+			return;
+		}
+
+		try {
+			main.downloadAction.download(rawGps, Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));
+		} catch (NumberFormatException e) {
+			JOptionPane.showMessageDialog(main, "Could not parse the Coordinates.");
+		}
+	}
 
 	/**
Index: src/org/openstreetmap/josm/actions/AboutAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/AboutAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/AboutAction.java	(revision 68)
@@ -38,5 +38,5 @@
 	
 	public AboutAction() {
-		super("About", "about", "Display the about screen.", KeyEvent.VK_A, null);
+		super("About", "about", "Display the about screen.", KeyEvent.VK_A);
 	}
 	
Index: src/org/openstreetmap/josm/actions/AutoScaleAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 68)
@@ -3,4 +3,6 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+
+import javax.swing.KeyStroke;
 
 import org.openstreetmap.josm.gui.MapFrame;
@@ -18,6 +20,5 @@
 	
 	public AutoScaleAction(MapFrame mapFrame) {
-		super("Auto Scale", "autoscale", "Zoom the view to show the whole layer. Disabled if the view is moved.",
-				KeyEvent.VK_A, null);
+		super("Auto Scale", "autoscale", "Zoom the view to show the whole layer. Disabled if the view is moved.", "Alt-A", KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_MASK));
 		mapView = mapFrame.mapView;
 	}
Index: src/org/openstreetmap/josm/actions/DownloadAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/DownloadAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/DownloadAction.java	(revision 68)
@@ -66,6 +66,6 @@
 
 	public DownloadAction() {
-		super("Download from OSM", "download", "Download map data from the OSM server.", KeyEvent.VK_D, 
-				KeyStroke.getAWTKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
+		super("Download from OSM", "download", "Download map data from the OSM server.", "Ctrl-Shift-D", 
+				KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
 	}
 
@@ -254,15 +254,87 @@
 		}
 
-		final OsmServerReader osmReader = new OsmServerReader(b.latlon[0], b.latlon[1], b.latlon[2], b.latlon[3]);
+		double minlon = b.latlon[0];
+		double minlat = b.latlon[1];
+		double maxlon = b.latlon[2];
+		double maxlat = b.latlon[3];
+		download(rawGps.isSelected(), minlon, minlat, maxlon, maxlat);
+		return DownloadStatus.FINISHED;
+	}
+	
+	/**
+	 * Read a bookmark from the current set edit fields. If one of the fields is
+	 * empty or contain illegal chars, <code>null</code> is returned.
+	 * The name of the bookmark is <code>null</code>.
+	 * @return A bookmark containing information from the edit fields and rawgps
+	 * 		checkbox.
+	 */
+	Bookmark readBookmark() {
+		try {
+			Bookmark b = new Bookmark();
+			for (int i = 0; i < 4; ++i) {
+				if (latlon[i].getText().equals(""))
+					return null;
+				b.latlon[i] = Double.parseDouble(latlon[i].getText());
+			}
+			b.rawgps = rawGps.isSelected();
+			return b;
+		} catch (NumberFormatException x) {
+			return null;
+		}
+	}
+	
+	
+	/**
+	 * Extrakt URL arguments.
+	 */
+	private Map<String, Double> readArgs(String s) {
+		int i = s.indexOf('?');
+		if (i == -1)
+			return new HashMap<String, Double>();
+		String[] args = s.substring(i+1).split("&");
+		HashMap<String, Double> map = new HashMap<String, Double>();
+		for (String arg : args) {
+			int eq = arg.indexOf('=');
+			if (eq != -1) {
+				try {
+					map.put(arg.substring(0, eq), Double.parseDouble(arg.substring(eq + 1)));
+				} catch (NumberFormatException e) {
+				}				
+			}
+		}
+		return map;
+	}
+	
+	/**
+	 * Set the four edit fields to the given bounds coordinates.
+	 */
+	private void setEditBounds(Bounds b) {
+		GeoPoint bottomLeft = b.min;
+		GeoPoint topRight = b.max;
+		if (bottomLeft.isOutSideWorld())
+			bottomLeft = new GeoPoint(-89.999, -179.999); // do not use the Projection constants, since this looks better.
+		if (topRight.isOutSideWorld())
+			topRight = new GeoPoint(89.999, 179.999);
+		latlon[0].setText(""+bottomLeft.lat);
+		latlon[1].setText(""+bottomLeft.lon);
+		latlon[2].setText(""+topRight.lat);
+		latlon[3].setText(""+topRight.lon);
+		for (JTextField f : latlon)
+			f.setCaretPosition(0);
+	}
+
+	/**
+	 * Do the download for the given area.
+	 */
+	public void download(final boolean rawGps, double minlat, double minlon, double maxlat, double maxlon) {
+		final OsmServerReader osmReader = new OsmServerReader(minlat, minlon, maxlat, maxlon);
 		new Thread(new PleaseWaitRunnable("Downloading data"){
 			@Override
 			public void realRun() {
 				try {
-					String name = latlon[0].getText() + " "
-							+ latlon[1].getText() + " x " + latlon[2].getText()
-							+ " " + latlon[3].getText();
+					String name = latlon[0].getText() + " " + latlon[1].getText() + " x " + latlon[2].getText() + " " + latlon[3].getText();
 
 					Layer layer = null;
-					if (rawGps.isSelected()) {
+					if (rawGps) {
 						layer = new RawGpsDataLayer(osmReader.parseRawGps(), name);
 					} else {
@@ -273,5 +345,5 @@
 							closeDialog();
 							JOptionPane.showMessageDialog(Main.main,
-									"No data imported.");
+							"No data imported.");
 						}
 
@@ -303,67 +375,4 @@
 			}
 		}).start();
-		return DownloadStatus.FINISHED;
-	}
-	
-	/**
-	 * Read a bookmark from the current set edit fields. If one of the fields is
-	 * empty or contain illegal chars, <code>null</code> is returned.
-	 * The name of the bookmark is <code>null</code>.
-	 * @return A bookmark containing information from the edit fields and rawgps
-	 * 		checkbox.
-	 */
-	Bookmark readBookmark() {
-		try {
-			Bookmark b = new Bookmark();
-			for (int i = 0; i < 4; ++i) {
-				if (latlon[i].getText().equals(""))
-					return null;
-				b.latlon[i] = Double.parseDouble(latlon[i].getText());
-			}
-			b.rawgps = rawGps.isSelected();
-			return b;
-		} catch (NumberFormatException x) {
-			return null;
-		}
-	}
-	
-	
-	/**
-	 * Extrakt URL arguments.
-	 */
-	private Map<String, Double> readArgs(String s) {
-		int i = s.indexOf('?');
-		if (i == -1)
-			return new HashMap<String, Double>();
-		String[] args = s.substring(i+1).split("&");
-		HashMap<String, Double> map = new HashMap<String, Double>();
-		for (String arg : args) {
-			int eq = arg.indexOf('=');
-			if (eq != -1) {
-				try {
-					map.put(arg.substring(0, eq), Double.parseDouble(arg.substring(eq + 1)));
-				} catch (NumberFormatException e) {
-				}				
-			}
-		}
-		return map;
-	}
-	
-	/**
-	 * Set the four edit fields to the given bounds coordinates.
-	 */
-	private void setEditBounds(Bounds b) {
-		GeoPoint bottomLeft = b.min;
-		GeoPoint topRight = b.max;
-		if (bottomLeft.isOutSideWorld())
-			bottomLeft = new GeoPoint(-89.999, -179.999); // do not use the Projection constants, since this looks better.
-		if (topRight.isOutSideWorld())
-			topRight = new GeoPoint(89.999, 179.999);
-		latlon[0].setText(""+bottomLeft.lat);
-		latlon[1].setText(""+bottomLeft.lon);
-		latlon[2].setText(""+topRight.lat);
-		latlon[3].setText(""+topRight.lon);
-		for (JTextField f : latlon)
-			f.setCaretPosition(0);
 	}
 }
Index: src/org/openstreetmap/josm/actions/ExitAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/ExitAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/ExitAction.java	(revision 68)
@@ -15,5 +15,5 @@
 	 */
 	public ExitAction() {
-		super("Exit", "exit", "Exit the application.", KeyEvent.VK_X, null);
+		super("Exit", "exit", "Exit the application.", KeyEvent.VK_X);
 	}
 	
Index: src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/JosmAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/JosmAction.java	(revision 68)
@@ -1,10 +1,10 @@
 package org.openstreetmap.josm.actions;
-
-import java.awt.AWTKeyStroke;
 
 import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
+import javax.swing.JComponent;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
+import javax.swing.KeyStroke;
 import javax.swing.SwingUtilities;
 
@@ -64,19 +64,23 @@
 	
 	/**
-	 * Construct the action.
+	 * Construct the action as menu action entry.
 	 * 
 	 * @param name		Name of the action (entry name in menu)
 	 * @param iconName	Name of the icon (without extension)
-	 * @param desc		Short tooltip description
-	 * @param mnemonic	If non-<code>null</code>, the Mnemonic in menu
-	 * @param shortCut	If non-<code>null</code>, the shortcut keystroke
+	 * @param tooltip	Short tooltip description
+	 * @param mnemonic	Mnemonic in the menu
 	 */
-	public JosmAction(String name, String iconName, String desc, Integer mnemonic, AWTKeyStroke shortCut) {
+	public JosmAction(String name, String iconName, String tooltip, int mnemonic) {
 		super(name, ImageProvider.get(iconName));
-		putValue(SHORT_DESCRIPTION, desc);
-		if (mnemonic != null)
-			putValue(MNEMONIC_KEY, mnemonic);
-		if (shortCut != null)
-			putValue(ACCELERATOR_KEY, shortCut);
+		putValue(SHORT_DESCRIPTION, tooltip);
+		putValue(MNEMONIC_KEY, mnemonic);
+	}
+
+
+	public JosmAction(String name, String iconName, String tooltip, String shortCutName, KeyStroke shortCut) {
+		super(name, ImageProvider.get(iconName));
+		putValue(SHORT_DESCRIPTION, "<html>"+tooltip+" <font size='-2'>"+shortCutName+"</font>&nbsp;</html>");
+		Main.main.panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(shortCut, name);
+		Main.main.panel.getActionMap().put(name, this);
 	}
 }
Index: src/org/openstreetmap/josm/actions/OpenAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/OpenAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/OpenAction.java	(revision 68)
@@ -41,5 +41,5 @@
 	 */
 	public OpenAction() {
-		super("Open", "open", "Open a file.", null, KeyStroke.getAWTKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK));
+		super("Open", "open", "Open a file.", "Ctrl-O", KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK));
 	}
 
@@ -58,6 +58,13 @@
 		if (filename == null)
 			return;
+
+		openFile(filename);
+	}
+
+	/**
+	 * Open the given file.
+	 */
+	public void openFile(File filename) {
 		String fn = filename.getName();
-
 		try {
 			Layer layer;
Index: src/org/openstreetmap/josm/actions/PreferencesAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/PreferencesAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/PreferencesAction.java	(revision 68)
@@ -3,4 +3,6 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+
+import javax.swing.KeyStroke;
 
 import org.openstreetmap.josm.gui.PreferenceDialog;
@@ -17,6 +19,5 @@
 	 */
 	public PreferencesAction() {
-		super("Preferences", "preference", "Open a preferences page for global settings.",
-				KeyEvent.VK_P, null);
+		super("Preferences", "preference", "Open a preferences page for global settings.", "F12", KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0));
 	}
 
Index: src/org/openstreetmap/josm/actions/RedoAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/RedoAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/RedoAction.java	(revision 68)
@@ -21,5 +21,5 @@
 	 */
 	public RedoAction() {
-		super("Redo", "redo", "Redo the last undone action.", null, KeyStroke.getAWTKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
+		super("Redo", "redo", "Redo the last undone action.", "Ctrl-Shift-Z", KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
 		setEnabled(false);
 	}
Index: src/org/openstreetmap/josm/actions/SaveAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/SaveAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/SaveAction.java	(revision 68)
@@ -32,5 +32,5 @@
 	 */
 	public SaveAction() {
-		super("Save", "save", "Save the current data.", null, KeyStroke.getAWTKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK));
+		super("Save", "save", "Save the current data.", "Ctrl-S", KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK));
 	}
 	
Index: src/org/openstreetmap/josm/actions/UndoAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/UndoAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/UndoAction.java	(revision 68)
@@ -21,5 +21,5 @@
 	 */
 	public UndoAction() {
-		super("Undo", "undo", "Undo the last action.", null, KeyStroke.getAWTKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK));
+		super("Undo", "undo", "Undo the last action.", "Ctrl-Z", KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK));
 		setEnabled(false);
 	}
Index: src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/UploadAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/UploadAction.java	(revision 68)
@@ -34,6 +34,6 @@
 
 	public UploadAction() {
-		super("Upload to OSM", "upload", "Upload all changes to the OSM server.", KeyEvent.VK_U, 
-				KeyStroke.getAWTKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
+		super("Upload to OSM", "upload", "Upload all changes to the OSM server.", "Ctrl-Shift-U", 
+				KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
 	}
 
Index: src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java	(revision 68)
@@ -46,5 +46,5 @@
 	 */
 	public AddLineSegmentAction(MapFrame mapFrame) {
-		super("Add Line Segment", "addlinesegment", "Add a line segment between two nodes.", KeyEvent.VK_G, mapFrame);
+		super("Add Line Segment", "addlinesegment", "Add a line segment between two nodes.", "G", KeyEvent.VK_G, mapFrame);
 	}
 
Index: src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java	(revision 68)
@@ -28,5 +28,5 @@
 	 */
 	public AddNodeAction(MapFrame mapFrame) {
-		super("Add nodes", "addnode", "Add nodes to the map.", KeyEvent.VK_N, mapFrame);
+		super("Add nodes", "addnode", "Add nodes to the map.", "N", KeyEvent.VK_N, mapFrame);
 	}
 
Index: src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java	(revision 68)
@@ -43,5 +43,5 @@
 	 */
 	public AddWayAction(MapFrame mapFrame, MapMode followMode) {
-		super("Add Way", "addway", "Combine selected segments to a new way.", KeyEvent.VK_W, mapFrame);
+		super("Add Way", "addway", "Combine selected segments to a new way.", "W", KeyEvent.VK_W, mapFrame);
 		this.followMode = followMode;
 	}
Index: src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 68)
@@ -43,5 +43,5 @@
 	 */
 	public DeleteAction(MapFrame mapFrame) {
-		super("Delete", "delete", "Delete nodes, streets or segments.", KeyEvent.VK_D, mapFrame);
+		super("Delete", "delete", "Delete nodes, streets or segments.", "Delete", KeyEvent.VK_DELETE, mapFrame);
 	}
 
Index: src/org/openstreetmap/josm/actions/mapmode/MapMode.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/MapMode.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/mapmode/MapMode.java	(revision 68)
@@ -5,4 +5,6 @@
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
+
+import javax.swing.KeyStroke;
 
 import org.openstreetmap.josm.actions.JosmAction;
@@ -31,10 +33,7 @@
 	/**
 	 * Construct a mapMode with the given icon and the given MapFrame
-	 *
-	 * @param iconName The filename of the icon.
-	 * @param mapFrame The parent MapFrame, this MapMode belongs to.
 	 */
-	public MapMode(String name, String iconName, String tooltip, int mnemonic, MapFrame mapFrame) {
-		super(name, "mapmode/"+iconName, tooltip, mnemonic, null);
+	public MapMode(String name, String iconName, String tooltip, String keyname, int keystroke, MapFrame mapFrame) {
+		super(name, "mapmode/"+iconName, tooltip, keyname, KeyStroke.getKeyStroke(keystroke, 0));
 		this.mapFrame = mapFrame;
 		mv = mapFrame.mapView;
Index: src/org/openstreetmap/josm/actions/mapmode/MoveAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/MoveAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/mapmode/MoveAction.java	(revision 68)
@@ -47,5 +47,5 @@
 	 */
 	public MoveAction(MapFrame mapFrame) {
-		super("Move", "move", "Move selected objects around", KeyEvent.VK_M, mapFrame);
+		super("Move", "move", "Move selected objects around.", "M", KeyEvent.VK_M, mapFrame);
 	}
 
Index: src/org/openstreetmap/josm/actions/mapmode/SelectionAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/SelectionAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/mapmode/SelectionAction.java	(revision 68)
@@ -63,5 +63,5 @@
 	 */
 	public SelectionAction(MapFrame mapFrame) {
-		super("Selection", "selection", "Select objects by dragging or clicking", KeyEvent.VK_S, mapFrame);
+		super("Selection", "selection", "Select objects by dragging or clicking.", "S", KeyEvent.VK_S, mapFrame);
 		this.selectionManager = new SelectionManager(this, false, mv);
 	}
Index: src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java	(revision 67)
+++ src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java	(revision 68)
@@ -41,5 +41,5 @@
 	 */
 	public ZoomAction(MapFrame mapFrame) {
-		super("Zoom", "zoom", "Zoom in by dragging", KeyEvent.VK_Z, mapFrame);
+		super("Zoom", "zoom", "Zoom in by dragging.", "Z", KeyEvent.VK_Z, mapFrame);
 		mv = mapFrame.mapView;
 		selectionManager = new SelectionManager(this, true, mv);
Index: src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 67)
+++ src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 68)
@@ -127,5 +127,5 @@
 	@Override
 	public boolean equals(Object obj) {
-		if (getClass() != obj.getClass() || id == 0 || obj == null || ((OsmPrimitive)obj).id == 0)
+		if (obj == null || getClass() != obj.getClass() || id == 0 || ((OsmPrimitive)obj).id == 0)
 			return super.equals(obj);
 		return id == ((OsmPrimitive)obj).id;
Index: src/org/openstreetmap/josm/data/osm/visitor/SearchVisitor.java
===================================================================
--- src/org/openstreetmap/josm/data/osm/visitor/SearchVisitor.java	(revision 68)
+++ src/org/openstreetmap/josm/data/osm/visitor/SearchVisitor.java	(revision 68)
@@ -0,0 +1,108 @@
+package org.openstreetmap.josm.data.osm.visitor;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.openstreetmap.josm.data.osm.LineSegment;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Way;
+
+/**
+ * Searches in the primitives for specific search strings.
+ * @author Imi
+ */
+public class SearchVisitor implements Visitor {
+
+	/**
+	 * One search criteria. Criterias are seperated by space.
+	 */
+	static class Criteria {
+		/**
+		 * If <code>true</code>, the criteria must match. <code>false</code> for the
+		 * criteria to NOT match.
+		 */
+		boolean match = true;
+		/**
+		 * Any Key must match this.
+		 */
+		String key;
+		/**
+		 * The value to the key must match the value. 
+		 */
+		String value;
+		/**
+		 * Any key or value must match this.
+		 */
+		String any;
+
+		enum Type {node, segment, way}
+		/**
+		 * Must be of the given type. (<code>null</code> for any type)
+		 */
+		Type type;
+	}
+	
+	private Collection<Criteria> criterias = new LinkedList<Criteria>();
+	private String search;
+
+	public SearchVisitor(String searchStr) {
+		search = searchStr;
+		for (String token = nextToken(); !token.equals(""); token = nextToken()) {
+			Criteria crit = new Criteria();
+			if (token.charAt(0) == '-' && token.length() > 1) {
+				crit.match = false;
+				token = token.substring(1);
+			}
+			if (token.charAt(0) == '"')
+				crit.any = token.substring(1);
+			else {
+				int colon = token.indexOf(':');
+				if (colon != -1) {
+					crit.key = token.substring(0, colon);
+					crit.value = token.substring(colon+1);
+				} else
+					crit.any = token;
+			}
+		}
+	}
+	
+	public void visit(Node n) {
+		// TODO Auto-generated method stub
+
+	}
+
+	public void visit(LineSegment ls) {
+		// TODO Auto-generated method stub
+
+	}
+
+	public void visit(Way w) {
+		// TODO Auto-generated method stub
+
+	}
+
+	
+	/**
+	 * Return the next token in the search string. Update the string as well.
+	 */
+	private String nextToken() {
+		if ("".equals(search))
+			return "";
+		if (search.charAt(0) == '"' || search.startsWith("-\"")) {
+			int start = search.charAt(0) == '"' ? 1 : 2;
+			int i = search.indexOf('"', start);
+			if (i == -1) {
+				String token = search;
+				search = "";
+				return token;
+			}
+			String token = start == 1 ? search.substring(0, i) : "-"+search.substring(1, i);
+			search = search.substring(i+1);
+			return token;
+		}
+		int i = search.indexOf(' ');
+		String token = search.substring(0, i);
+		search = search.substring(i+1);
+		return token;
+	}
+}
Index: src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- src/org/openstreetmap/josm/gui/MapFrame.java	(revision 67)
+++ src/org/openstreetmap/josm/gui/MapFrame.java	(revision 68)
@@ -26,4 +26,5 @@
 import org.openstreetmap.josm.gui.dialogs.PropertiesDialog;
 import org.openstreetmap.josm.gui.dialogs.SelectionListDialog;
+import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
 import org.openstreetmap.josm.gui.layer.Layer;
 
@@ -52,17 +53,4 @@
 	 */
 	public MapStatus statusLine;
-	/**
-	 * The action to open the layer list
-	 */
-	private LayerList layerList;
-	/**
-	 * Action to open the properties panel for the selected objects
-	 */
-	private PropertiesDialog propertiesDialog;
-	/**
-	 * Action to open a list of all selected objects
-	 */
-	private SelectionListDialog selectionListDialog;
-
 	/**
 	 * Construct a map with a given DataSet. The set cannot be replaced after 
@@ -113,14 +101,16 @@
 
 		toggleDialogs.setLayout(new BoxLayout(toggleDialogs, BoxLayout.Y_AXIS));
-		toolBarActions.add(new IconToggleButton(this, layerList = new LayerList(this)));
-		toggleDialogs.add(layerList);
-		toolBarActions.add(new IconToggleButton(this, propertiesDialog = new PropertiesDialog(this)));
-		toggleDialogs.add(propertiesDialog);
-		toolBarActions.add(new IconToggleButton(this, selectionListDialog = new SelectionListDialog(this)));
-		toggleDialogs.add(selectionListDialog);
-		
+		addIconToggle(toggleDialogs, new LayerList(this));
+		addIconToggle(toggleDialogs, new PropertiesDialog(this));
+		addIconToggle(toggleDialogs, new SelectionListDialog(this));
 
 		// status line below the map
 		statusLine = new MapStatus(this);
+	}
+
+
+	private void addIconToggle(JPanel toggleDialogs, ToggleDialog dlg) {
+		toolBarActions.add(new IconToggleButton(this, dlg.action));
+		toggleDialogs.add(dlg);
 	}
 
Index: src/org/openstreetmap/josm/gui/dialogs/LayerList.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/LayerList.java	(revision 67)
+++ src/org/openstreetmap/josm/gui/dialogs/LayerList.java	(revision 68)
@@ -74,5 +74,5 @@
 	 */
 	public LayerList(MapFrame mapFrame) {
-		super("Layers", "List of all layers", "layerlist", KeyEvent.VK_L, "Open a list of all loaded layers.");
+		super("Layers", "List of all layers", "layerlist", "Open a list of all loaded layers.", "L", KeyEvent.VK_L);
 		setPreferredSize(new Dimension(320,100));
 		add(new JScrollPane(layers), BorderLayout.CENTER);
Index: src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 67)
+++ src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 68)
@@ -213,5 +213,5 @@
 	 */
 	public PropertiesDialog(MapFrame mapFrame) {
-		super("Properties", "Properties Dialog", "properties", KeyEvent.VK_P, "Property for selected objects.");
+		super("Properties", "Properties Dialog", "properties", "Property for selected objects.", "P", KeyEvent.VK_P);
 		mv = mapFrame.mapView;
 
Index: src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 67)
+++ src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 68)
@@ -51,5 +51,5 @@
 	 */
 	public SelectionListDialog(MapFrame mapFrame) {
-		super("Current Selection", "Selection List", "selectionlist", KeyEvent.VK_E, "Open a selection list window.");
+		super("Current Selection", "Selection List", "selectionlist", "Open a selection list window.", "E", KeyEvent.VK_E);
 		setPreferredSize(new Dimension(320,150));
 		displaylist.setCellRenderer(new OsmPrimitivRenderer());
@@ -107,5 +107,9 @@
 				if (colon == -1)
 					return key.indexOf(search) != -1 || value.indexOf(search) != -1;
-				return key.equals(search.substring(0, colon)) && value.indexOf(search.substring(colon+1)) != -1;
+				String searchKey = search.substring(0, colon);
+				String searchValue = search.substring(colon+1);
+				if (searchKey.equals("type") && (searchValue.equals("segment")||searchValue.equals("way")||searchValue.equals("node")))
+					return true;
+				return key.equals(searchKey) && value.indexOf(searchValue) != -1;
 			}
 		});
Index: src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 67)
+++ src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 68)
@@ -3,14 +3,13 @@
 import java.awt.BorderLayout;
 import java.awt.event.ActionEvent;
-import java.util.HashMap;
-import java.util.Map;
+import java.awt.event.KeyEvent;
 
 import javax.swing.AbstractButton;
-import javax.swing.Action;
 import javax.swing.BorderFactory;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.KeyStroke;
 
-import org.openstreetmap.josm.gui.ImageProvider;
+import org.openstreetmap.josm.actions.JosmAction;
 
 /**
@@ -20,15 +19,24 @@
  * @author imi
  */
-public class ToggleDialog extends JPanel implements Action {
+public class ToggleDialog extends JPanel {
 
+	/**
+	 * The action to toggle this dialog.
+	 */
+	public JosmAction action;
+	
 	/**
 	 * Create a new ToggleDialog.
 	 * @param title The title of the dialog.
 	 */
-	public ToggleDialog(String title, String name, String iconName, int mnemonic, String tooltip) {
-		putValue(SMALL_ICON, ImageProvider.get("dialogs", iconName));
-		putValue(NAME, name);
-		putValue(MNEMONIC_KEY, mnemonic);
-		putValue(SHORT_DESCRIPTION, tooltip);
+	public ToggleDialog(String title, String name, String iconName, String tooltip, String shortCutName, int shortCut) {
+		action = new JosmAction(name, "dialogs/"+iconName, tooltip, "Alt-"+shortCutName, KeyStroke.getKeyStroke(shortCut, KeyEvent.ALT_MASK)){
+			public void actionPerformed(ActionEvent e) {
+				boolean show = !isVisible();
+				if (e.getSource() instanceof AbstractButton)
+					show = ((AbstractButton)e.getSource()).isSelected();
+				setVisible(show);
+			}
+		};
 		
 		setLayout(new BorderLayout());
@@ -37,23 +45,3 @@
 		setBorder(BorderFactory.createEtchedBorder());
 	}
-
-	/**
-	 * Show this if not shown. Else request the focus.
-	 */
-	public void actionPerformed(ActionEvent e) {
-		boolean show = !isVisible();
-		if (e.getSource() instanceof AbstractButton)
-			show = ((AbstractButton)e.getSource()).isSelected();
-		setVisible(show);
-	}
-
-	// to satisfy Action interface
-
-	private Map<String, Object> properties = new HashMap<String, Object>();
-	public Object getValue(String key) {
-		return properties.get(key);
-	}
-	public void putValue(String key, Object value) {
-		properties.put(key, value);
-	}
 }
