Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/ConfigKeys.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/ConfigKeys.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/ConfigKeys.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -29,10 +29,10 @@
 
 public class ConfigKeys {
-	public static final String OSB_API_DISABLED = "osb.api.disabled";
-	public static final String OSB_API_URI_CLOSE = "osb.uri.close";
-	public static final String OSB_API_URI_EDIT = "osb.uri.edit";
-	public static final String OSB_API_URI_DOWNLOAD = "osb.uri.download";
-	public static final String OSB_API_URI_NEW = "osb.uri.new";
-	public static final String OSB_NICKNAME = "osb.nickname";
-	public static final String OSB_AUTO_DOWNLOAD = "osb.auto_download";
+    public static final String OSB_API_DISABLED = "osb.api.disabled";
+    public static final String OSB_API_URI_CLOSE = "osb.uri.close";
+    public static final String OSB_API_URI_EDIT = "osb.uri.edit";
+    public static final String OSB_API_URI_DOWNLOAD = "osb.uri.download";
+    public static final String OSB_API_URI_NEW = "osb.uri.new";
+    public static final String OSB_NICKNAME = "osb.nickname";
+    public static final String OSB_AUTO_DOWNLOAD = "osb.auto_download";
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbDownloadLoop.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbDownloadLoop.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbDownloadLoop.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -36,73 +36,73 @@
 
 public class OsbDownloadLoop extends Thread {
-	
-	private static OsbDownloadLoop instance;
-	
-	private long countdown = TimeUnit.SECONDS.toMillis(1);
-	
-	private boolean downloadDone = false;
-	
-	private final int INTERVAL = 100;
-	
-	private OsbPlugin plugin;
-	
-	private Point2D lastCenter;
-	
-	public OsbDownloadLoop() {
-	    setName(tr("OpenStreetBugs download loop"));
-		start();
-	}
-	
-	public static synchronized OsbDownloadLoop getInstance() {
-		if(instance == null) {
-			instance = new OsbDownloadLoop();
-		}
-		return instance;
-	}
-	
-	@Override
-	public void run() {
-		try {
-			while(true) {
-				countdown -= INTERVAL;
-				
-				// if the center of the map has changed, the user has dragged or
-				// zoomed the map
-				if(Main.map != null && Main.map.mapView != null) {
-					Point2D currentCenter = Main.map.mapView.getCenter();
-					if(currentCenter != null && !currentCenter.equals(lastCenter)) {
-						resetCountdown();
-						lastCenter = currentCenter;
-					}
-				}
-				
-				// auto download if configured
-				if( Main.pref.getBoolean(ConfigKeys.OSB_AUTO_DOWNLOAD) && OsbPlugin.active ) {
-					if(countdown < 0) {
-						if(!downloadDone) {
-							if(plugin != null) {
-								plugin.updateData();
-								downloadDone = true;
-							}
-						} else {
-							countdown = -1;
-						}
-					}
-				}
-				
-				Thread.sleep(INTERVAL);
-			}
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-	}
-	
-	public void resetCountdown() {
-		downloadDone = false;
-		countdown = TimeUnit.SECONDS.toMillis(1);
-	}
 
-	public void setPlugin(OsbPlugin plugin) {
-		this.plugin = plugin;
-	}
+    private static OsbDownloadLoop instance;
+
+    private long countdown = TimeUnit.SECONDS.toMillis(1);
+
+    private boolean downloadDone = false;
+
+    private final int INTERVAL = 100;
+
+    private OsbPlugin plugin;
+
+    private Point2D lastCenter;
+
+    public OsbDownloadLoop() {
+        setName(tr("OpenStreetBugs download loop"));
+        start();
+    }
+
+    public static synchronized OsbDownloadLoop getInstance() {
+        if(instance == null) {
+            instance = new OsbDownloadLoop();
+        }
+        return instance;
+    }
+
+    @Override
+    public void run() {
+        try {
+            while(true) {
+                countdown -= INTERVAL;
+
+                // if the center of the map has changed, the user has dragged or
+                // zoomed the map
+                if(Main.map != null && Main.map.mapView != null) {
+                    Point2D currentCenter = Main.map.mapView.getCenter();
+                    if(currentCenter != null && !currentCenter.equals(lastCenter)) {
+                        resetCountdown();
+                        lastCenter = currentCenter;
+                    }
+                }
+
+                // auto download if configured
+                if( Main.pref.getBoolean(ConfigKeys.OSB_AUTO_DOWNLOAD) && OsbPlugin.active ) {
+                    if(countdown < 0) {
+                        if(!downloadDone) {
+                            if(plugin != null) {
+                                plugin.updateData();
+                                downloadDone = true;
+                            }
+                        } else {
+                            countdown = -1;
+                        }
+                    }
+                }
+
+                Thread.sleep(INTERVAL);
+            }
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void resetCountdown() {
+        downloadDone = false;
+        countdown = TimeUnit.SECONDS.toMillis(1);
+    }
+
+    public void setPlugin(OsbPlugin plugin) {
+        this.plugin = plugin;
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -62,31 +62,31 @@
 
 public class OsbLayer extends Layer implements MouseListener {
-	
-	private DataSet data;
-	
-	private Collection<? extends OsmPrimitive> selection;
-	
-	private JToolTip tooltip = new JToolTip();
-	
-	public OsbLayer(DataSet dataSet, String name) {
-		super(name);
-		this.data = dataSet;
-		DataSet.selListeners.add(new SelectionChangedListener() {
-			public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-				selection = newSelection;
-			}
-		});
-		
-		Main.map.mapView.addMouseListener(this);
-	}
-	
-	@Override
-	public Object getInfoComponent() {
-		return getToolTipText();
-	}
-
-	@Override
-	public Component[] getMenuEntries() {
-		return new Component[]{
+
+    private DataSet data;
+
+    private Collection<? extends OsmPrimitive> selection;
+
+    private JToolTip tooltip = new JToolTip();
+
+    public OsbLayer(DataSet dataSet, String name) {
+        super(name);
+        this.data = dataSet;
+        DataSet.selListeners.add(new SelectionChangedListener() {
+            public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
+                selection = newSelection;
+            }
+        });
+
+        Main.map.mapView.addMouseListener(this);
+    }
+
+    @Override
+    public Object getInfoComponent() {
+        return getToolTipText();
+    }
+
+    @Override
+    public Component[] getMenuEntries() {
+        return new Component[]{
                 new JMenuItem(new LayerListDialog.ShowHideLayerAction(this)),
                 new JMenuItem(new LayerListDialog.DeleteLayerAction(this)),
@@ -95,132 +95,132 @@
                 new JSeparator(),
                 new JMenuItem(new LayerListPopup.InfoAction(this))};
-	}
-
-	@Override
-	public String getToolTipText() {
-		return tr("Displays OpenStreetBugs issues");
-	}
-
-	@Override
-	public boolean isMergable(Layer other) {
-		return false;
-	}
-
-	@Override
-	public void mergeFrom(Layer from) {}
-
-	@Override
-	public void paint(Graphics g, MapView mv) {
-	    Object[] nodes = data.nodes.toArray();
-		for (int i = 0; i < nodes.length; i++) {
-		    Node node = (Node) nodes[i];
-		    
-			// don't paint deleted nodes
-			if(node.deleted) {
-				continue;
-			}
-			
-			Point p = mv.getPoint(node.eastNorth);
-			
-			ImageIcon icon = OsbPlugin.loadIcon("icon_error16.png");
-			if("1".equals(node.get("state"))) {
-	        	icon = OsbPlugin.loadIcon("icon_valid16.png");
-	        }
-			int width = icon.getIconWidth();
-			int height = icon.getIconHeight();
-			
-			g.drawImage(icon.getImage(), p.x - (width / 2), p.y - (height / 2), new ImageObserver() {
-				public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
-					return false;
-				}
-			});
-			
-
-			if(selection != null && selection.contains(node)) {
-				// draw description
-				String desc = node.get("note");
-				if(desc != null) {
-					// format with html
-					StringBuilder sb = new StringBuilder("<html>");
-					//sb.append(desc.replaceAll("\\|", "<br>"));
-					sb.append(desc.replaceAll("<hr />", "<hr>"));
-					sb.append("</html>");
-					desc = sb.toString();
-					
-					// determine tooltip dimensions
-					int tooltipWidth = 0;
-					Rectangle2D fontBounds = null;
-					String[] lines = desc.split("<hr>");
-					for (int j = 0; j < lines.length; j++) {
-						String line = lines[j];
-						fontBounds = g.getFontMetrics().getStringBounds(line, g);
-						tooltipWidth = Math.max(tooltipWidth, (int)fontBounds.getWidth());
-					}
-
-					// FIXME hiehgt calculations doesn't work with all LAFs
-					int lineCount = lines.length;
-					int HR_SIZE = 10;
-					int tooltipHeight = lineCount * (int)fontBounds.getHeight() + HR_SIZE * (lineCount - 1); 
-					
-					// draw description as a tooltip
-					tooltip.setTipText(desc);
-					tooltip.setSize(tooltipWidth+10, tooltipHeight + 6);
-					
-					int tx = p.x + (width / 2) + 5;
-					int ty = (int)(p.y - height / 2);
-					g.translate(tx, ty);
-					tooltip.paint(g);
-					g.translate(-tx, -ty);
-				}
-
-				// draw selection border
-				g.setColor(ColorHelper.html2color(Main.pref.get("color.selected")));
-				g.drawRect(p.x - (width / 2), p.y - (height / 2), 16, 16);
-			}
-		}
-	}
-	
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor v) {}
-
-	@Override
-	public Icon getIcon() {
-		return OsbPlugin.loadIcon("icon_error16.png");
-	}
-	
-	private Node getNearestNode(Point p) {
-		double snapDistance = 10;
-		double minDistanceSq = Double.MAX_VALUE;
-		Node minPrimitive = null;
-		for (Node n : data.nodes) {
-			if (n.deleted || n.incomplete)
-				continue;
-			Point sp = Main.map.mapView.getPoint(n.eastNorth);
-			double dist = p.distanceSq(sp);
-			if (minDistanceSq > dist && p.distance(sp) < snapDistance) {
-				minDistanceSq = p.distanceSq(sp);
-				minPrimitive = n;
-			}
-			// prefer already selected node when multiple nodes on one point
-			else if(minDistanceSq == dist && n.selected && !minPrimitive.selected)
-			{
-				minPrimitive = n;
-			}
-		}
-		return minPrimitive;
-	}
-
-	public void mouseClicked(MouseEvent e) {
-		if(e.getButton() == MouseEvent.BUTTON1) {
-			if(Main.map.mapView.getActiveLayer() == this) {
-				Node n = (Node) getNearestNode(e.getPoint());
-				if(data.nodes.contains(n)) {
-					data.setSelected(n);
-				}
-			}
-		}
-	}
-	
-	public void mousePressed(MouseEvent e) {
+    }
+
+    @Override
+    public String getToolTipText() {
+        return tr("Displays OpenStreetBugs issues");
+    }
+
+    @Override
+    public boolean isMergable(Layer other) {
+        return false;
+    }
+
+    @Override
+    public void mergeFrom(Layer from) {}
+
+    @Override
+    public void paint(Graphics g, MapView mv) {
+        Object[] nodes = data.nodes.toArray();
+        for (int i = 0; i < nodes.length; i++) {
+            Node node = (Node) nodes[i];
+
+            // don't paint deleted nodes
+            if(node.deleted) {
+                continue;
+            }
+
+            Point p = mv.getPoint(node.eastNorth);
+
+            ImageIcon icon = OsbPlugin.loadIcon("icon_error16.png");
+            if("1".equals(node.get("state"))) {
+                icon = OsbPlugin.loadIcon("icon_valid16.png");
+            }
+            int width = icon.getIconWidth();
+            int height = icon.getIconHeight();
+
+            g.drawImage(icon.getImage(), p.x - (width / 2), p.y - (height / 2), new ImageObserver() {
+                public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
+                    return false;
+                }
+            });
+
+
+            if(selection != null && selection.contains(node)) {
+                // draw description
+                String desc = node.get("note");
+                if(desc != null) {
+                    // format with html
+                    StringBuilder sb = new StringBuilder("<html>");
+                    //sb.append(desc.replaceAll("\\|", "<br>"));
+                    sb.append(desc.replaceAll("<hr />", "<hr>"));
+                    sb.append("</html>");
+                    desc = sb.toString();
+
+                    // determine tooltip dimensions
+                    int tooltipWidth = 0;
+                    Rectangle2D fontBounds = null;
+                    String[] lines = desc.split("<hr>");
+                    for (int j = 0; j < lines.length; j++) {
+                        String line = lines[j];
+                        fontBounds = g.getFontMetrics().getStringBounds(line, g);
+                        tooltipWidth = Math.max(tooltipWidth, (int)fontBounds.getWidth());
+                    }
+
+                    // FIXME hiehgt calculations doesn't work with all LAFs
+                    int lineCount = lines.length;
+                    int HR_SIZE = 10;
+                    int tooltipHeight = lineCount * (int)fontBounds.getHeight() + HR_SIZE * (lineCount - 1);
+
+                    // draw description as a tooltip
+                    tooltip.setTipText(desc);
+                    tooltip.setSize(tooltipWidth+10, tooltipHeight + 6);
+
+                    int tx = p.x + (width / 2) + 5;
+                    int ty = (int)(p.y - height / 2);
+                    g.translate(tx, ty);
+                    tooltip.paint(g);
+                    g.translate(-tx, -ty);
+                }
+
+                // draw selection border
+                g.setColor(ColorHelper.html2color(Main.pref.get("color.selected")));
+                g.drawRect(p.x - (width / 2), p.y - (height / 2), 16, 16);
+            }
+        }
+    }
+
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor v) {}
+
+    @Override
+    public Icon getIcon() {
+        return OsbPlugin.loadIcon("icon_error16.png");
+    }
+
+    private Node getNearestNode(Point p) {
+        double snapDistance = 10;
+        double minDistanceSq = Double.MAX_VALUE;
+        Node minPrimitive = null;
+        for (Node n : data.nodes) {
+            if (n.deleted || n.incomplete)
+                continue;
+            Point sp = Main.map.mapView.getPoint(n.eastNorth);
+            double dist = p.distanceSq(sp);
+            if (minDistanceSq > dist && p.distance(sp) < snapDistance) {
+                minDistanceSq = p.distanceSq(sp);
+                minPrimitive = n;
+            }
+            // prefer already selected node when multiple nodes on one point
+            else if(minDistanceSq == dist && n.selected && !minPrimitive.selected)
+            {
+                minPrimitive = n;
+            }
+        }
+        return minPrimitive;
+    }
+
+    public void mouseClicked(MouseEvent e) {
+        if(e.getButton() == MouseEvent.BUTTON1) {
+            if(Main.map.mapView.getActiveLayer() == this) {
+                Node n = (Node) getNearestNode(e.getPoint());
+                if(data.nodes.contains(n)) {
+                    data.setSelected(n);
+                }
+            }
+        }
+    }
+
+    public void mousePressed(MouseEvent e) {
         mayTriggerPopup(e);
     }
@@ -229,19 +229,19 @@
         mayTriggerPopup(e);
     }
-    
+
     private void mayTriggerPopup(MouseEvent e) {
         if(e.isPopupTrigger()) {
-        	if(Main.map.mapView.getActiveLayer() == this) {
-				Node n = (Node) getNearestNode(e.getPoint());
-				OsbAction.setSelectedNode(n);
-				if(data.nodes.contains(n)) {
-					PopupFactory.createPopup(n).show(e.getComponent(), e.getX(), e.getY());
-				}
-			}
-        }
-    }
-	
-	public void mouseEntered(MouseEvent e) {}
-
-	public void mouseExited(MouseEvent e) {}
+            if(Main.map.mapView.getActiveLayer() == this) {
+                Node n = (Node) getNearestNode(e.getPoint());
+                OsbAction.setSelectedNode(n);
+                if(data.nodes.contains(n)) {
+                    PopupFactory.createPopup(n).show(e.getComponent(), e.getX(), e.getY());
+                }
+            }
+        }
+    }
+
+    public void mouseEntered(MouseEvent e) {}
+
+    public void mouseExited(MouseEvent e) {}
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbObserver.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbObserver.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbObserver.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -31,4 +31,4 @@
 
 public interface OsbObserver {
-	public void update(DataSet dataset);
+    public void update(DataSet dataset);
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java	(revision 12778)
@@ -60,187 +60,187 @@
 public class OsbPlugin extends Plugin implements LayerChangeListener {
 
-	private DataSet dataSet;
-	
-	private UploadHook uploadHook;
-	
-	private OsbDialog dialog;
-	
-	private OsbLayer layer;
-	
-	public static boolean active = false;
-	
-	private DownloadAction download = new DownloadAction();
-	
-	public OsbPlugin() {
-	    super();
-		initConfig();
-		dataSet = new DataSet();
-		uploadHook = new OsbUploadHook();
-		dialog = new OsbDialog(this);
+    private DataSet dataSet;
+    
+    private UploadHook uploadHook;
+    
+    private OsbDialog dialog;
+    
+    private OsbLayer layer;
+    
+    public static boolean active = false;
+    
+    private DownloadAction download = new DownloadAction();
+    
+    public OsbPlugin() {
+        super();
+        initConfig();
+        dataSet = new DataSet();
+        uploadHook = new OsbUploadHook();
+        dialog = new OsbDialog(this);
         OsbLayer.listeners.add(dialog);
         OsbLayer.listeners.add(this);
-	}
-	
-	private void initConfig() {
-		String debug = Main.pref.get(ConfigKeys.OSB_API_DISABLED);
-		if(debug == null || debug.length() == 0) {
-			debug = "false";
-			Main.pref.put(ConfigKeys.OSB_API_DISABLED, debug);
-		}
-		
-		String uri = Main.pref.get(ConfigKeys.OSB_API_URI_EDIT);
-		if(uri == null || uri.length() == 0) {
-			uri = "http://openstreetbugs.appspot.com/editPOIexec";
-			Main.pref.put(ConfigKeys.OSB_API_URI_EDIT, uri);
-		}
-		
-		uri = Main.pref.get(ConfigKeys.OSB_API_URI_CLOSE);
-		if(uri == null || uri.length() == 0) {
-			uri = "http://openstreetbugs.appspot.com/closePOIexec";
-			Main.pref.put(ConfigKeys.OSB_API_URI_CLOSE, uri);
-		}
-		
-		uri = Main.pref.get(ConfigKeys.OSB_API_URI_DOWNLOAD);
-		if(uri == null || uri.length() == 0) {
-			uri = "http://openstreetbugs.appspot.com/getBugs";
-			Main.pref.put(ConfigKeys.OSB_API_URI_DOWNLOAD, uri);
-		}
-		
-		uri = Main.pref.get(ConfigKeys.OSB_API_URI_NEW);
-		if(uri == null || uri.length() == 0) {
-			uri = "http://openstreetbugs.appspot.com/addPOIexec";
-			Main.pref.put(ConfigKeys.OSB_API_URI_NEW, uri);
-		}
-		
-		String auto_download = Main.pref.get(ConfigKeys.OSB_AUTO_DOWNLOAD);
-		if(auto_download == null || auto_download.length() == 0) {
-			auto_download = "true";
-			Main.pref.put(ConfigKeys.OSB_AUTO_DOWNLOAD, auto_download);
-		}
-	}
-
-	/**
-	 * Determines the bounds of the current selected layer
-	 * @return
-	 */
-	protected Bounds bounds(){
-		MapView mv = Main.map.mapView;
-		return new Bounds(
-			mv.getLatLon(0, mv.getHeight()),
-			mv.getLatLon(mv.getWidth(), 0));
-	}
-	
-	public void updateData() {
-		// determine the bounds of the currently visible area
-		Bounds bounds = null;
-		try {
-			bounds = bounds();
-		} catch (Exception e) {
-			// something went wrong, probably the mapview isn't fully initialized
-			System.err.println("OpenStreetBugs: Couldn't determine bounds of currently visible rect. Cancel auto update");
-			return;
-		}
-		
-		try {
-			// download the data
-			download.execute(dataSet, bounds);
-
-			// display the parsed data
-			if(!dataSet.nodes.isEmpty()) {
-				updateGui();
-			}
-		} catch (Exception e) {
-			JOptionPane.showMessageDialog(Main.parent, e.getMessage());
-			e.printStackTrace();
-		}
-	}
-	
-	public void updateGui() {
-		// update dialog
-		dialog.update(dataSet);
-		
-		// create a new layer if necessary
-		updateLayer(dataSet);
-		
-		// repaint view, so that changes get visible
-		Main.map.mapView.repaint();
-	}
-	
-	private void updateLayer(DataSet osbData) {
-		if(layer == null) {
-			layer = new OsbLayer(osbData, "OpenStreetBugs");
-			Main.main.addLayer(layer);
-		}
-	}
-
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (oldFrame==null && newFrame!=null) { // map frame added
-			// add the dialog
-			newFrame.addToggleDialog(dialog);
-			
-			// add the upload hook
-			LinkedList<UploadHook> hooks = ((UploadAction) Main.main.menu.upload).uploadHooks;
-			hooks.add(0, uploadHook);
-			
-			// add a listener to the plugin toggle button
-			final JToggleButton toggle = (JToggleButton) dialog.action.button;
-			active = toggle.isSelected();
-			toggle.addActionListener(new ActionListener() {
-				private boolean download = true;
-				
-				public void actionPerformed(ActionEvent e) {
-					active = toggle.isSelected();
-					if (toggle.isSelected() && download) {
-						Main.worker.execute(new Runnable() {
-							public void run() {
-								updateData();
-							}
-						});
-						download = false;
-					}
-				}
-			});
-		} else if (oldFrame!=null && newFrame==null ) { // map frame removed
-			
-		}
-	}
-	
-	public static ImageIcon loadIcon(String name) {
-		URL url = OsbPlugin.class.getResource("/images/".concat(name));
-		return new ImageIcon(url);
-	}
-
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) {}
-
-	public void layerAdded(Layer newLayer) {
-		if(newLayer instanceof OsmDataLayer) {
-			active = ((JToggleButton)dialog.action.button).isSelected();
-			
-			// start the auto download loop
-			OsbDownloadLoop.getInstance().setPlugin(this);
-		}
-	}
-
-	public void layerRemoved(Layer oldLayer) {
-		if(oldLayer == layer) {
-			layer = null;
-		}
-	}
-
-	public OsbLayer getLayer() {
-		return layer;
-	}
-
-	public void setLayer(OsbLayer layer) {
-		this.layer = layer;
-	}
-
-	public DataSet getDataSet() {
-		return dataSet;
-	}
-
-	public void setDataSet(DataSet dataSet) {
-		this.dataSet = dataSet;
-	}
+    }
+    
+    private void initConfig() {
+        String debug = Main.pref.get(ConfigKeys.OSB_API_DISABLED);
+        if(debug == null || debug.length() == 0) {
+            debug = "false";
+            Main.pref.put(ConfigKeys.OSB_API_DISABLED, debug);
+        }
+        
+        String uri = Main.pref.get(ConfigKeys.OSB_API_URI_EDIT);
+        if(uri == null || uri.length() == 0) {
+            uri = "http://openstreetbugs.appspot.com/editPOIexec";
+            Main.pref.put(ConfigKeys.OSB_API_URI_EDIT, uri);
+        }
+        
+        uri = Main.pref.get(ConfigKeys.OSB_API_URI_CLOSE);
+        if(uri == null || uri.length() == 0) {
+            uri = "http://openstreetbugs.appspot.com/closePOIexec";
+            Main.pref.put(ConfigKeys.OSB_API_URI_CLOSE, uri);
+        }
+        
+        uri = Main.pref.get(ConfigKeys.OSB_API_URI_DOWNLOAD);
+        if(uri == null || uri.length() == 0) {
+            uri = "http://openstreetbugs.appspot.com/getBugs";
+            Main.pref.put(ConfigKeys.OSB_API_URI_DOWNLOAD, uri);
+        }
+        
+        uri = Main.pref.get(ConfigKeys.OSB_API_URI_NEW);
+        if(uri == null || uri.length() == 0) {
+            uri = "http://openstreetbugs.appspot.com/addPOIexec";
+            Main.pref.put(ConfigKeys.OSB_API_URI_NEW, uri);
+        }
+        
+        String auto_download = Main.pref.get(ConfigKeys.OSB_AUTO_DOWNLOAD);
+        if(auto_download == null || auto_download.length() == 0) {
+            auto_download = "true";
+            Main.pref.put(ConfigKeys.OSB_AUTO_DOWNLOAD, auto_download);
+        }
+    }
+
+    /**
+     * Determines the bounds of the current selected layer
+     * @return
+     */
+    protected Bounds bounds(){
+        MapView mv = Main.map.mapView;
+        return new Bounds(
+            mv.getLatLon(0, mv.getHeight()),
+            mv.getLatLon(mv.getWidth(), 0));
+    }
+    
+    public void updateData() {
+        // determine the bounds of the currently visible area
+        Bounds bounds = null;
+        try {
+            bounds = bounds();
+        } catch (Exception e) {
+            // something went wrong, probably the mapview isn't fully initialized
+            System.err.println("OpenStreetBugs: Couldn't determine bounds of currently visible rect. Cancel auto update");
+            return;
+        }
+        
+        try {
+            // download the data
+            download.execute(dataSet, bounds);
+
+            // display the parsed data
+            if(!dataSet.nodes.isEmpty()) {
+                updateGui();
+            }
+        } catch (Exception e) {
+            JOptionPane.showMessageDialog(Main.parent, e.getMessage());
+            e.printStackTrace();
+        }
+    }
+    
+    public void updateGui() {
+        // update dialog
+        dialog.update(dataSet);
+        
+        // create a new layer if necessary
+        updateLayer(dataSet);
+        
+        // repaint view, so that changes get visible
+        Main.map.mapView.repaint();
+    }
+    
+    private void updateLayer(DataSet osbData) {
+        if(layer == null) {
+            layer = new OsbLayer(osbData, "OpenStreetBugs");
+            Main.main.addLayer(layer);
+        }
+    }
+
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (oldFrame==null && newFrame!=null) { // map frame added
+            // add the dialog
+            newFrame.addToggleDialog(dialog);
+            
+            // add the upload hook
+            LinkedList<UploadHook> hooks = ((UploadAction) Main.main.menu.upload).uploadHooks;
+            hooks.add(0, uploadHook);
+            
+            // add a listener to the plugin toggle button
+            final JToggleButton toggle = (JToggleButton) dialog.action.button;
+            active = toggle.isSelected();
+            toggle.addActionListener(new ActionListener() {
+                private boolean download = true;
+                
+                public void actionPerformed(ActionEvent e) {
+                    active = toggle.isSelected();
+                    if (toggle.isSelected() && download) {
+                        Main.worker.execute(new Runnable() {
+                            public void run() {
+                                updateData();
+                            }
+                        });
+                        download = false;
+                    }
+                }
+            });
+        } else if (oldFrame!=null && newFrame==null ) { // map frame removed
+            
+        }
+    }
+    
+    public static ImageIcon loadIcon(String name) {
+        URL url = OsbPlugin.class.getResource("/images/".concat(name));
+        return new ImageIcon(url);
+    }
+
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {}
+
+    public void layerAdded(Layer newLayer) {
+        if(newLayer instanceof OsmDataLayer) {
+            active = ((JToggleButton)dialog.action.button).isSelected();
+            
+            // start the auto download loop
+            OsbDownloadLoop.getInstance().setPlugin(this);
+        }
+    }
+
+    public void layerRemoved(Layer oldLayer) {
+        if(oldLayer == layer) {
+            layer = null;
+        }
+    }
+
+    public OsbLayer getLayer() {
+        return layer;
+    }
+
+    public void setLayer(OsbLayer layer) {
+        this.layer = layer;
+    }
+
+    public DataSet getDataSet() {
+        return dataSet;
+    }
+
+    public void setDataSet(DataSet dataSet) {
+        this.dataSet = dataSet;
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbUploadHook.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbUploadHook.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbUploadHook.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -41,29 +41,29 @@
 public class OsbUploadHook implements UploadHook {
 
-	public boolean checkUpload(Collection<OsmPrimitive> add, Collection<OsmPrimitive> update,
-			Collection<OsmPrimitive> delete) 
-	{
-		boolean containsOsbData = checkOpenStreetBugs(add);
-		containsOsbData |= checkOpenStreetBugs(update);
-		containsOsbData |= checkOpenStreetBugs(delete);
-		if(containsOsbData) {
-			JOptionPane.showMessageDialog(Main.parent, 
-				tr("<html>The selected data contains data from OpenStreetBugs.<br>" +
-				"You cannot upload these data. Maybe you have selected the wrong layer?"), 
-				tr("Warning"), JOptionPane.WARNING_MESSAGE);
-			return false;
-		} else {
-			return true;
-		}
-	}
+    public boolean checkUpload(Collection<OsmPrimitive> add, Collection<OsmPrimitive> update,
+            Collection<OsmPrimitive> delete)
+    {
+        boolean containsOsbData = checkOpenStreetBugs(add);
+        containsOsbData |= checkOpenStreetBugs(update);
+        containsOsbData |= checkOpenStreetBugs(delete);
+        if(containsOsbData) {
+            JOptionPane.showMessageDialog(Main.parent,
+                tr("<html>The selected data contains data from OpenStreetBugs.<br>" +
+                "You cannot upload these data. Maybe you have selected the wrong layer?"),
+                tr("Warning"), JOptionPane.WARNING_MESSAGE);
+            return false;
+        } else {
+            return true;
+        }
+    }
 
-	private boolean checkOpenStreetBugs(Collection<OsmPrimitive> osmPrimitives) {
-		for (Iterator<OsmPrimitive> iterator = osmPrimitives.iterator(); iterator.hasNext();) {
-			OsmPrimitive osmPrimitive = iterator.next();
-			if(osmPrimitive.get("openstreetbug") != null) {
-				return true;
-			}
-		}
-		return false;
-	}
+    private boolean checkOpenStreetBugs(Collection<OsmPrimitive> osmPrimitives) {
+        for (Iterator<OsmPrimitive> iterator = osmPrimitives.iterator(); iterator.hasNext();) {
+            OsmPrimitive osmPrimitive = iterator.next();
+            if(osmPrimitive.get("openstreetbug") != null) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/CloseAction.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/CloseAction.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/CloseAction.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -40,30 +40,30 @@
 
 public class CloseAction {
-	
-	private final String CHARSET = "UTF-8";
-	
-	public void execute(Node n) throws IOException {
-		// create the URI for the data download
-		String uri = Main.pref.get(ConfigKeys.OSB_API_URI_CLOSE);
-		String post = new StringBuilder("id=")
-			.append(n.get("id"))
-			.toString();
-		
-		String result = null;
-		if(Main.pref.getBoolean(ConfigKeys.OSB_API_DISABLED)) {
-			result = "ok";
-		} else {
-			result = HttpUtils.post(uri, null, post, CHARSET);
-		}
-		
-		if("ok".equalsIgnoreCase(result)) {
-			n.put("state", "1");
-			Main.map.mapView.repaint();
-		} else {
-			JOptionPane.showMessageDialog(Main.parent,
-					tr("An error occurred: {0}", new Object[] {result}),
-					tr("Error"),
-					JOptionPane.ERROR_MESSAGE);
-		}
-	}
+
+    private final String CHARSET = "UTF-8";
+
+    public void execute(Node n) throws IOException {
+        // create the URI for the data download
+        String uri = Main.pref.get(ConfigKeys.OSB_API_URI_CLOSE);
+        String post = new StringBuilder("id=")
+            .append(n.get("id"))
+            .toString();
+
+        String result = null;
+        if(Main.pref.getBoolean(ConfigKeys.OSB_API_DISABLED)) {
+            result = "ok";
+        } else {
+            result = HttpUtils.post(uri, null, post, CHARSET);
+        }
+
+        if("ok".equalsIgnoreCase(result)) {
+            n.put("state", "1");
+            Main.map.mapView.repaint();
+        } else {
+            JOptionPane.showMessageDialog(Main.parent,
+                    tr("An error occurred: {0}", new Object[] {result}),
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE);
+        }
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -41,54 +41,54 @@
 
 public class DownloadAction {
-	
-	private final String CHARSET = "UTF-8";
-	
-	public void execute(DataSet dataset, Bounds bounds) throws IOException {
-		// create the URI for the data download
-		String uri = Main.pref.get(ConfigKeys.OSB_API_URI_DOWNLOAD);
 
-		// check zoom level
-		if(Main.map.mapView.zoom() > 15 || Main.map.mapView.zoom() < 9) {
-			return;
-		} 
-		
-		// add query params to the uri
-		StringBuilder sb = new StringBuilder(uri)
-			.append("?b=").append(bounds.min.lat())
-			.append("&t=").append(bounds.max.lat())
-			.append("&l=").append(bounds.min.lon())
-			.append("&r=").append(bounds.max.lon());
-		uri = sb.toString();
+    private final String CHARSET = "UTF-8";
 
-		// download the data
-		String content = HttpUtils.get(uri, null, CHARSET);
-		
-		// clear dataset
-		dataset.nodes.clear();
-		dataset.relations.clear();
-		dataset.ways.clear();
-		
-		// parse the data
-		parseData(dataset, content);
-	}
+    public void execute(DataSet dataset, Bounds bounds) throws IOException {
+        // create the URI for the data download
+        String uri = Main.pref.get(ConfigKeys.OSB_API_URI_DOWNLOAD);
 
-	private void parseData(DataSet dataSet, String content) {
-		String idPattern = "\\d+";
-		String floatPattern = "-?\\d+\\.\\d+";
-		String pattern = "putAJAXMarker\\(("+idPattern+"),("+floatPattern+"),("+floatPattern+"),\"(.*)\",([01])\\)";
-		Pattern p = Pattern.compile(pattern);
-		Matcher m = p.matcher(content);
-		while(m.find()) {
-			double lat = Double.parseDouble(m.group(3));
-			double lon = Double.parseDouble(m.group(2));
-			LatLon latlon = new LatLon(lat, lon); 
-			Node osmNode = new Node(latlon);
-			osmNode.id = Long.parseLong(m.group(1));
-			osmNode.put("id", m.group(1));
-			osmNode.put("note", m.group(4));
-			osmNode.put("openstreetbug", "FIXME");
-			osmNode.put("state", m.group(5));
-			dataSet.addPrimitive(osmNode);
-		} 
-	}
+        // check zoom level
+        if(Main.map.mapView.zoom() > 15 || Main.map.mapView.zoom() < 9) {
+            return;
+        }
+
+        // add query params to the uri
+        StringBuilder sb = new StringBuilder(uri)
+            .append("?b=").append(bounds.min.lat())
+            .append("&t=").append(bounds.max.lat())
+            .append("&l=").append(bounds.min.lon())
+            .append("&r=").append(bounds.max.lon());
+        uri = sb.toString();
+
+        // download the data
+        String content = HttpUtils.get(uri, null, CHARSET);
+
+        // clear dataset
+        dataset.nodes.clear();
+        dataset.relations.clear();
+        dataset.ways.clear();
+
+        // parse the data
+        parseData(dataset, content);
+    }
+
+    private void parseData(DataSet dataSet, String content) {
+        String idPattern = "\\d+";
+        String floatPattern = "-?\\d+\\.\\d+";
+        String pattern = "putAJAXMarker\\(("+idPattern+"),("+floatPattern+"),("+floatPattern+"),\"(.*)\",([01])\\)";
+        Pattern p = Pattern.compile(pattern);
+        Matcher m = p.matcher(content);
+        while(m.find()) {
+            double lat = Double.parseDouble(m.group(3));
+            double lon = Double.parseDouble(m.group(2));
+            LatLon latlon = new LatLon(lat, lon);
+            Node osmNode = new Node(latlon);
+            osmNode.id = Long.parseLong(m.group(1));
+            osmNode.put("id", m.group(1));
+            osmNode.put("note", m.group(4));
+            osmNode.put("openstreetbug", "FIXME");
+            osmNode.put("state", m.group(5));
+            dataSet.addPrimitive(osmNode);
+        }
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/EditAction.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/EditAction.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/EditAction.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -41,34 +41,34 @@
 
 public class EditAction {
-	
-	private final String CHARSET = "UTF-8";
-	
-	public void execute(Node n, String comment) throws IOException {
-		// create the URI for the data download
-		String uri = Main.pref.get(ConfigKeys.OSB_API_URI_EDIT);
-		String post = new StringBuilder("id=")
-			.append(n.get("id"))
-			.append("&text=")
-			.append(URLEncoder.encode(comment, CHARSET))
-			.toString();
-		
-		String result = null;
-		if(Main.pref.getBoolean(ConfigKeys.OSB_API_DISABLED)) {
-			result = "ok";
-		} else {
-			result = HttpUtils.post(uri, null, post, CHARSET);
-		}
 
-		if("ok".equalsIgnoreCase(result)) {
-			String desc = n.get("note");
-			desc = desc.concat("<hr />").concat(comment);
-			n.put("note", desc);
-			Main.map.mapView.repaint();
-		} else {
-			JOptionPane.showMessageDialog(Main.parent,
-					tr("An error occurred: {0}", new Object[] {result}),
-					tr("Error"),
-					JOptionPane.ERROR_MESSAGE);
-		}
-	}
+    private final String CHARSET = "UTF-8";
+
+    public void execute(Node n, String comment) throws IOException {
+        // create the URI for the data download
+        String uri = Main.pref.get(ConfigKeys.OSB_API_URI_EDIT);
+        String post = new StringBuilder("id=")
+            .append(n.get("id"))
+            .append("&text=")
+            .append(URLEncoder.encode(comment, CHARSET))
+            .toString();
+
+        String result = null;
+        if(Main.pref.getBoolean(ConfigKeys.OSB_API_DISABLED)) {
+            result = "ok";
+        } else {
+            result = HttpUtils.post(uri, null, post, CHARSET);
+        }
+
+        if("ok".equalsIgnoreCase(result)) {
+            String desc = n.get("note");
+            desc = desc.concat("<hr />").concat(comment);
+            n.put("note", desc);
+            Main.map.mapView.repaint();
+        } else {
+            JOptionPane.showMessageDialog(Main.parent,
+                    tr("An error occurred: {0}", new Object[] {result}),
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE);
+        }
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/NewAction.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/NewAction.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/NewAction.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -43,44 +43,44 @@
 
 public class NewAction {
-	
-	private final String CHARSET = "UTF-8";
-	
-	public Node execute(Point p, String text) throws IOException {
-		// where has the issue been added
-		LatLon latlon = Main.map.mapView.getLatLon(p.x, p.y);
-		
-		// create the URI for the data download
-		String uri = Main.pref.get(ConfigKeys.OSB_API_URI_NEW);
-		
-		String post = new StringBuilder("lon=")
-			.append(latlon.lon())
-			.append("&lat=")
-			.append(latlon.lat())
-			.append("&text=")
-			.append(URLEncoder.encode(text, CHARSET))
-			.toString();
-		
-		String result = null;
-		if(Main.pref.getBoolean(ConfigKeys.OSB_API_DISABLED)) {
-			result = "ok 12345";
-		} else {
-			result = HttpUtils.post(uri, null, post, CHARSET);
-		}
-		
-		Pattern resultPattern = Pattern.compile("ok\\s+(\\d+)");
-		Matcher m = resultPattern.matcher(result);
-		String id = "-1";
-		if(m.matches()) {
-			id = m.group(1);
-		} else {
-			throw new RuntimeException(tr("Couldn't create new bug. Result: {0}" + result));
-		}
-		
-		Node osmNode = new Node(latlon);
-		osmNode.put("id", id);
-		osmNode.put("note", text);
-		osmNode.put("openstreetbug", "FIXME");
-		osmNode.put("state", "0");
-		return osmNode;
-	}
+
+    private final String CHARSET = "UTF-8";
+
+    public Node execute(Point p, String text) throws IOException {
+        // where has the issue been added
+        LatLon latlon = Main.map.mapView.getLatLon(p.x, p.y);
+
+        // create the URI for the data download
+        String uri = Main.pref.get(ConfigKeys.OSB_API_URI_NEW);
+
+        String post = new StringBuilder("lon=")
+            .append(latlon.lon())
+            .append("&lat=")
+            .append(latlon.lat())
+            .append("&text=")
+            .append(URLEncoder.encode(text, CHARSET))
+            .toString();
+
+        String result = null;
+        if(Main.pref.getBoolean(ConfigKeys.OSB_API_DISABLED)) {
+            result = "ok 12345";
+        } else {
+            result = HttpUtils.post(uri, null, post, CHARSET);
+        }
+
+        Pattern resultPattern = Pattern.compile("ok\\s+(\\d+)");
+        Matcher m = resultPattern.matcher(result);
+        String id = "-1";
+        if(m.matches()) {
+            id = m.group(1);
+        } else {
+            throw new RuntimeException(tr("Couldn't create new bug. Result: {0}" + result));
+        }
+
+        Node osmNode = new Node(latlon);
+        osmNode.put("id", id);
+        osmNode.put("note", text);
+        osmNode.put("openstreetbug", "FIXME");
+        osmNode.put("state", "0");
+        return osmNode;
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpResponse.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpResponse.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpResponse.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpUtils.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpUtils.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpUtils.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -51,5 +51,5 @@
             }
         }
-        
+
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         int length = -1;
@@ -59,8 +59,8 @@
             bos.write(b, 0, length);
         }
-        
+
         return new String(bos.toByteArray(), charset);
     }
-    
+
     public static HttpResponse getResponse(String url, Map<String, String> headers, String charset) throws IOException {
         URL page = new URL(url);
@@ -72,5 +72,5 @@
             }
         }
-        
+
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         int length = -1;
@@ -80,11 +80,11 @@
             bos.write(b, 0, length);
         }
-        
+
         HttpResponse response = new HttpResponse(new String(bos.toByteArray(), charset), con.getHeaderFields());
         return response;
     }
-    
+
     /**
-     * 
+     *
      * @param url
      * @param headers
@@ -105,10 +105,10 @@
             }
         }
-        
+
         //send the post
         OutputStream os = con.getOutputStream();
         os.write(content.getBytes("UTF-8"));
         os.flush();
-        
+
         // read the response
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -119,8 +119,8 @@
             bos.write(b, 0, length);
         }
-        
+
         return new String(bos.toByteArray(), responseCharset);
     }
-    
+
     /**
      * Adds a parameter to a given URI
@@ -137,9 +137,9 @@
             sb.append('?');
         }
-        
+
         sb.append(param);
         sb.append('=');
         sb.append(value);
-        
+
         return sb.toString();
     }
@@ -154,13 +154,13 @@
             }
         }
-        
+
         return con.getHeaderFields();
     }
-    
+
     public static String getHeaderField(Map<String, List<String>> headers, String headerField) {
         if(!headers.containsKey(headerField)) {
             return null;
         }
-        
+
         List<String> value = headers.get(headerField);
         if(value.size() == 1) {
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -77,187 +77,187 @@
 
 public class OsbDialog extends ToggleDialog implements OsbObserver, ListSelectionListener, LayerChangeListener,
-		DataChangeListener, MouseListener, OsbActionObserver {
-
-	private static final long serialVersionUID = 1L;
-	private DefaultListModel model;
-	private JList list;
-	private OsbPlugin osbPlugin;
-	private boolean fireSelectionChanged = true;
-	private JButton refresh;
-	private JButton addComment = new JButton(new AddCommentAction());
-	private JButton closeIssue = new JButton(new CloseIssueAction());
-	private JToggleButton newIssue = new JToggleButton();
-	
-	public OsbDialog(final OsbPlugin plugin) {
-		super(tr("Open OpenStreetBugs"), "icon_error22",
-				tr("Opens the OpenStreetBugs window and activates the automatic download"),
-				Shortcut.registerShortcut(
-						"view:openstreetbugs",
-						tr("Toggle: {0}", tr("Open OpenStreetBugs")),
-						KeyEvent.VK_O, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT), 
-				150);
-		
-		osbPlugin = plugin;
-		
-		model = new DefaultListModel();
-		list = new JList(model);
-		list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		list.addListSelectionListener(this);
-		list.addMouseListener(this);
-		list.setCellRenderer(new OsbListCellRenderer());
-		add(new JScrollPane(list), BorderLayout.CENTER);
-
-		// create dialog buttons
-		JPanel buttonPanel = new JPanel(new GridLayout(2, 2));
-		add(buttonPanel, BorderLayout.SOUTH);
-		refresh = new JButton(tr("Refresh"));
-		refresh.setToolTipText(tr("Refresh"));
-		refresh.setIcon(OsbPlugin.loadIcon("view-refresh22.png"));
-		refresh.setHorizontalAlignment(SwingConstants.LEFT);
-		refresh.addActionListener(new ActionListener() {
-
-			public void actionPerformed(ActionEvent e) {
-				// check zoom level
-				if(Main.map.mapView.zoom() > 15 || Main.map.mapView.zoom() < 9) {
-					JOptionPane.showMessageDialog(Main.parent, 
-							tr("The visible area is either too small or too big to download data from OpenStreetBugs"),
-							tr("Warning"),
-							JOptionPane.INFORMATION_MESSAGE);
-					return;
-				}
-				
-				plugin.updateData();
-			}
-		});
-		
-		addComment.setEnabled(false);
-		addComment.setToolTipText((String) addComment.getAction().getValue(Action.NAME));
-		addComment.setIcon(OsbPlugin.loadIcon("add_comment22.png"));
-		addComment.setHorizontalAlignment(SwingConstants.LEFT);
-		closeIssue.setEnabled(false);
-		closeIssue.setToolTipText((String) closeIssue.getAction().getValue(Action.NAME));
-		closeIssue.setIcon(OsbPlugin.loadIcon("icon_valid22.png"));
-		closeIssue.setHorizontalAlignment(SwingConstants.LEFT);
-		NewIssueAction nia = new NewIssueAction(newIssue, osbPlugin);
-		newIssue.setAction(nia);
-		newIssue.setToolTipText((String) newIssue.getAction().getValue(Action.NAME));
-		newIssue.setIcon(OsbPlugin.loadIcon("icon_error_add22.png"));
-		newIssue.setHorizontalAlignment(SwingConstants.LEFT);
-
-		buttonPanel.add(refresh);
-		buttonPanel.add(newIssue);
-		buttonPanel.add(addComment);
-		buttonPanel.add(closeIssue);
-		
-		// add a selection listener to the data
-		DataSet.selListeners.add(new SelectionChangedListener() {
-			public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-				fireSelectionChanged = false;
-				list.clearSelection();
-				for (OsmPrimitive osmPrimitive : newSelection) {
-					for (int i = 0; i < model.getSize(); i++) {
-						OsbListItem item = (OsbListItem) model.get(i);
-						if(item.getNode() == osmPrimitive) {
-							list.addSelectionInterval(i, i);
-						}
-					}
-				}
-				fireSelectionChanged = true;
-			}
-		});
-		
-		AddCommentAction.addActionObserver(this);
-		CloseIssueAction.addActionObserver(this);
-	}
-
-	public synchronized void update(final DataSet dataset) {
-		Node lastNode = OsbAction.getSelectedNode();
-		model = new DefaultListModel();
-		List<Node> sortedList = new ArrayList<Node>(dataset.nodes);
-		Collections.sort(sortedList, new BugComparator());
-		
-		for (Node node : sortedList) {
-			if (!node.deleted) {
-				model.addElement(new OsbListItem(node));
-			}
-		}
-		list.setModel(model);
-		list.setSelectedValue(new OsbListItem(lastNode), true);
-	}
-
-	public void valueChanged(ListSelectionEvent e) {
-		if(list.getSelectedValues().length == 0) {
-			addComment.setEnabled(false);
-			closeIssue.setEnabled(false);
-			OsbAction.setSelectedNode(null);
-			return;
-		}
-		
-		List<OsmPrimitive> selected = new ArrayList<OsmPrimitive>();
-		for (Object listItem : list.getSelectedValues()) {
-			Node node = ((OsbListItem) listItem).getNode();
-			selected.add(node);
-
-			if ("1".equals(node.get("state"))) {
-				addComment.setEnabled(false);
-				closeIssue.setEnabled(false);
-			} else {
-				addComment.setEnabled(true);
-				closeIssue.setEnabled(true);
-			}
-			
-			OsbAction.setSelectedNode(node);
-
-			scrollToSelected(node);
-			
-			if (fireSelectionChanged) {
-				Main.ds.setSelected(selected);
-			}
-		}
-	}
-
-	private void scrollToSelected(Node node) {
-		for (int i = 0; i < model.getSize();i++) {
-			Node current = ((OsbListItem)model.get(i)).getNode();
-			if(current.id == node.id) {
-				list.scrollRectToVisible(list.getCellBounds(i, i));
-				list.setSelectedIndex(i);
-				return;
-			}
-		}
-	}
-
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) {}
-
-	public void layerAdded(Layer newLayer) {
-		if(newLayer == osbPlugin.getLayer()) {
-			update(osbPlugin.getDataSet());
-			Main.map.mapView.moveLayer(newLayer, 0);
-		}
-	}
-
-	public void layerRemoved(Layer oldLayer) {
-		if(oldLayer == osbPlugin.getLayer()) {
-			model.removeAllElements();
-		}
-	}
-
-	public void dataChanged(OsmDataLayer l) {
-		update(l.data);
-	}
-	
-	public void zoomToNode(Node node) {
-		double scale = Main.map.mapView.getScale();
-		Main.map.mapView.zoomTo(node.eastNorth, scale);
-    }
-
-	public void mouseClicked(MouseEvent e) {
-		if(e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
-			OsbListItem item = (OsbListItem)list.getSelectedValue();
-			zoomToNode(item.getNode());
-		}
-	}
-	
-	public void mousePressed(MouseEvent e) {
+        DataChangeListener, MouseListener, OsbActionObserver {
+
+    private static final long serialVersionUID = 1L;
+    private DefaultListModel model;
+    private JList list;
+    private OsbPlugin osbPlugin;
+    private boolean fireSelectionChanged = true;
+    private JButton refresh;
+    private JButton addComment = new JButton(new AddCommentAction());
+    private JButton closeIssue = new JButton(new CloseIssueAction());
+    private JToggleButton newIssue = new JToggleButton();
+
+    public OsbDialog(final OsbPlugin plugin) {
+        super(tr("Open OpenStreetBugs"), "icon_error22",
+                tr("Opens the OpenStreetBugs window and activates the automatic download"),
+                Shortcut.registerShortcut(
+                        "view:openstreetbugs",
+                        tr("Toggle: {0}", tr("Open OpenStreetBugs")),
+                        KeyEvent.VK_O, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT),
+                150);
+
+        osbPlugin = plugin;
+
+        model = new DefaultListModel();
+        list = new JList(model);
+        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        list.addListSelectionListener(this);
+        list.addMouseListener(this);
+        list.setCellRenderer(new OsbListCellRenderer());
+        add(new JScrollPane(list), BorderLayout.CENTER);
+
+        // create dialog buttons
+        JPanel buttonPanel = new JPanel(new GridLayout(2, 2));
+        add(buttonPanel, BorderLayout.SOUTH);
+        refresh = new JButton(tr("Refresh"));
+        refresh.setToolTipText(tr("Refresh"));
+        refresh.setIcon(OsbPlugin.loadIcon("view-refresh22.png"));
+        refresh.setHorizontalAlignment(SwingConstants.LEFT);
+        refresh.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                // check zoom level
+                if(Main.map.mapView.zoom() > 15 || Main.map.mapView.zoom() < 9) {
+                    JOptionPane.showMessageDialog(Main.parent,
+                            tr("The visible area is either too small or too big to download data from OpenStreetBugs"),
+                            tr("Warning"),
+                            JOptionPane.INFORMATION_MESSAGE);
+                    return;
+                }
+
+                plugin.updateData();
+            }
+        });
+
+        addComment.setEnabled(false);
+        addComment.setToolTipText((String) addComment.getAction().getValue(Action.NAME));
+        addComment.setIcon(OsbPlugin.loadIcon("add_comment22.png"));
+        addComment.setHorizontalAlignment(SwingConstants.LEFT);
+        closeIssue.setEnabled(false);
+        closeIssue.setToolTipText((String) closeIssue.getAction().getValue(Action.NAME));
+        closeIssue.setIcon(OsbPlugin.loadIcon("icon_valid22.png"));
+        closeIssue.setHorizontalAlignment(SwingConstants.LEFT);
+        NewIssueAction nia = new NewIssueAction(newIssue, osbPlugin);
+        newIssue.setAction(nia);
+        newIssue.setToolTipText((String) newIssue.getAction().getValue(Action.NAME));
+        newIssue.setIcon(OsbPlugin.loadIcon("icon_error_add22.png"));
+        newIssue.setHorizontalAlignment(SwingConstants.LEFT);
+
+        buttonPanel.add(refresh);
+        buttonPanel.add(newIssue);
+        buttonPanel.add(addComment);
+        buttonPanel.add(closeIssue);
+
+        // add a selection listener to the data
+        DataSet.selListeners.add(new SelectionChangedListener() {
+            public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
+                fireSelectionChanged = false;
+                list.clearSelection();
+                for (OsmPrimitive osmPrimitive : newSelection) {
+                    for (int i = 0; i < model.getSize(); i++) {
+                        OsbListItem item = (OsbListItem) model.get(i);
+                        if(item.getNode() == osmPrimitive) {
+                            list.addSelectionInterval(i, i);
+                        }
+                    }
+                }
+                fireSelectionChanged = true;
+            }
+        });
+
+        AddCommentAction.addActionObserver(this);
+        CloseIssueAction.addActionObserver(this);
+    }
+
+    public synchronized void update(final DataSet dataset) {
+        Node lastNode = OsbAction.getSelectedNode();
+        model = new DefaultListModel();
+        List<Node> sortedList = new ArrayList<Node>(dataset.nodes);
+        Collections.sort(sortedList, new BugComparator());
+
+        for (Node node : sortedList) {
+            if (!node.deleted) {
+                model.addElement(new OsbListItem(node));
+            }
+        }
+        list.setModel(model);
+        list.setSelectedValue(new OsbListItem(lastNode), true);
+    }
+
+    public void valueChanged(ListSelectionEvent e) {
+        if(list.getSelectedValues().length == 0) {
+            addComment.setEnabled(false);
+            closeIssue.setEnabled(false);
+            OsbAction.setSelectedNode(null);
+            return;
+        }
+
+        List<OsmPrimitive> selected = new ArrayList<OsmPrimitive>();
+        for (Object listItem : list.getSelectedValues()) {
+            Node node = ((OsbListItem) listItem).getNode();
+            selected.add(node);
+
+            if ("1".equals(node.get("state"))) {
+                addComment.setEnabled(false);
+                closeIssue.setEnabled(false);
+            } else {
+                addComment.setEnabled(true);
+                closeIssue.setEnabled(true);
+            }
+
+            OsbAction.setSelectedNode(node);
+
+            scrollToSelected(node);
+
+            if (fireSelectionChanged) {
+                Main.ds.setSelected(selected);
+            }
+        }
+    }
+
+    private void scrollToSelected(Node node) {
+        for (int i = 0; i < model.getSize();i++) {
+            Node current = ((OsbListItem)model.get(i)).getNode();
+            if(current.id == node.id) {
+                list.scrollRectToVisible(list.getCellBounds(i, i));
+                list.setSelectedIndex(i);
+                return;
+            }
+        }
+    }
+
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {}
+
+    public void layerAdded(Layer newLayer) {
+        if(newLayer == osbPlugin.getLayer()) {
+            update(osbPlugin.getDataSet());
+            Main.map.mapView.moveLayer(newLayer, 0);
+        }
+    }
+
+    public void layerRemoved(Layer oldLayer) {
+        if(oldLayer == osbPlugin.getLayer()) {
+            model.removeAllElements();
+        }
+    }
+
+    public void dataChanged(OsmDataLayer l) {
+        update(l.data);
+    }
+
+    public void zoomToNode(Node node) {
+        double scale = Main.map.mapView.getScale();
+        Main.map.mapView.zoomTo(node.eastNorth, scale);
+    }
+
+    public void mouseClicked(MouseEvent e) {
+        if(e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
+            OsbListItem item = (OsbListItem)list.getSelectedValue();
+            zoomToNode(item.getNode());
+        }
+    }
+
+    public void mousePressed(MouseEvent e) {
         mayTriggerPopup(e);
     }
@@ -266,36 +266,36 @@
         mayTriggerPopup(e);
     }
-    
+
     private void mayTriggerPopup(MouseEvent e) {
         if(e.isPopupTrigger()) {
-        	int selectedRow = list.locationToIndex(e.getPoint());
-        	list.setSelectedIndex(selectedRow);
-			Node n = ((OsbListItem)list.getSelectedValue()).getNode();
-			OsbAction.setSelectedNode(n);
-			PopupFactory.createPopup(n).show(e.getComponent(), e.getX(), e.getY());
-        }
-    }
-	
-	public void mouseEntered(MouseEvent e) {}
-
-	public void mouseExited(MouseEvent e) {}
-
-	public void actionPerformed(OsbAction action) {
-		if(action instanceof AddCommentAction || action instanceof CloseIssueAction) {
-			update(osbPlugin.getDataSet());
-		}
-	}
-	
-	private class BugComparator implements Comparator<Node> {
-
-		public int compare(Node o1, Node o2) {
-			String state1 = o1.get("state");
-			String state2 = o2.get("state");
-			if(state1.equals(state2)) {
-				return o1.get("note").compareTo(o2.get("note"));
-			}
-			return state1.compareTo(state2);
-		}
-		
-	}
+            int selectedRow = list.locationToIndex(e.getPoint());
+            list.setSelectedIndex(selectedRow);
+            Node n = ((OsbListItem)list.getSelectedValue()).getNode();
+            OsbAction.setSelectedNode(n);
+            PopupFactory.createPopup(n).show(e.getComponent(), e.getX(), e.getY());
+        }
+    }
+
+    public void mouseEntered(MouseEvent e) {}
+
+    public void mouseExited(MouseEvent e) {}
+
+    public void actionPerformed(OsbAction action) {
+        if(action instanceof AddCommentAction || action instanceof CloseIssueAction) {
+            update(osbPlugin.getDataSet());
+        }
+    }
+
+    private class BugComparator implements Comparator<Node> {
+
+        public int compare(Node o1, Node o2) {
+            String state1 = o1.get("state");
+            String state2 = o2.get("state");
+            if(state1.equals(state2)) {
+                return o1.get("note").compareTo(o2.get("note"));
+            }
+            return state1.compareTo(state2);
+        }
+
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbListCellRenderer.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbListCellRenderer.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbListCellRenderer.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -45,38 +45,38 @@
     private Color background = Color.WHITE;
     private Color altBackground = new Color(250, 250, 220);
-    
-	public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
-			boolean cellHasFocus) {
-		
-		JLabel label = new JLabel();
-		label.setOpaque(true);
-		
+
+    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+            boolean cellHasFocus) {
+
+        JLabel label = new JLabel();
+        label.setOpaque(true);
+
         if(isSelected) {
-        	label.setBackground(UIManager.getColor("List.selectionBackground"));
+            label.setBackground(UIManager.getColor("List.selectionBackground"));
         } else {
-        	label.setBackground(index % 2 == 0 ? background : altBackground);
+            label.setBackground(index % 2 == 0 ? background : altBackground);
         }
-        
+
         OsbListItem item = (OsbListItem) value;
         Node n = item.getNode();
         Icon icon = null;
         if("0".equals(n.get("state"))) {
-        	icon = OsbPlugin.loadIcon("icon_error16.png");
+            icon = OsbPlugin.loadIcon("icon_error16.png");
         } else if("1".equals(n.get("state"))) {
-        	icon = OsbPlugin.loadIcon("icon_valid16.png");
+            icon = OsbPlugin.loadIcon("icon_valid16.png");
         }
         label.setIcon(icon);
         String text = n.get("note");
         if(text.indexOf("<hr />") > 0) {
-        	text = text.substring(0, text.indexOf("<hr />"));
+            text = text.substring(0, text.indexOf("<hr />"));
         }
         label.setText(text);
-		
-		Dimension d = label.getPreferredSize();
-		d.height += 10;
-		label.setPreferredSize(d);
-		
-		return label;
-	}
+
+        Dimension d = label.getPreferredSize();
+        d.height += 10;
+        label.setPreferredSize(d);
+
+        return label;
+    }
 
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbListItem.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbListItem.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbListItem.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -31,41 +31,41 @@
 
 public class OsbListItem {
-	private Node node;
-	
-	public OsbListItem(Node node) {
-		super();
-		this.node = node;
-	}
+    private Node node;
 
-	public Node getNode() {
-		return node;
-	}
+    public OsbListItem(Node node) {
+        super();
+        this.node = node;
+    }
 
-	public void setNode(Node node) {
-		this.node = node;
-	}
-	
-	@Override
-	public String toString() {
-		if(node.get("note") != null) {
-			StringBuilder sb = new StringBuilder("<html>");
-			sb.append(node.get("note").replaceAll("\\|", "<br>"));
-			sb.append("</html>");
-			return sb.toString();
-		} else {
-			return "N/A";
-		}
-	}
-	
-	@Override
-	public boolean equals(Object obj) {
-		if(obj instanceof OsbListItem) {
-			OsbListItem other = (OsbListItem)obj; 
-			if(getNode() != null && other.getNode() != null) {
-				return getNode().id == other.getNode().id;
-			}
-		}
-		
-		return false;
-	}
+    public Node getNode() {
+        return node;
+    }
+
+    public void setNode(Node node) {
+        this.node = node;
+    }
+
+    @Override
+    public String toString() {
+        if(node.get("note") != null) {
+            StringBuilder sb = new StringBuilder("<html>");
+            sb.append(node.get("note").replaceAll("\\|", "<br>"));
+            sb.append("</html>");
+            return sb.toString();
+        } else {
+            return "N/A";
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if(obj instanceof OsbListItem) {
+            OsbListItem other = (OsbListItem)obj;
+            if(getNode() != null && other.getNode() != null) {
+                return getNode().id == other.getNode().id;
+            }
+        }
+
+        return false;
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/AddCommentAction.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/AddCommentAction.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/AddCommentAction.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -40,30 +40,30 @@
 public class AddCommentAction extends OsbAction {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private EditAction editAction = new EditAction();
-	
-	public AddCommentAction() {
-		super(tr("Add a comment"));
-	}
-	
-	@Override
-	protected void doActionPerformed(ActionEvent e) throws Exception {
-		// get the user nickname
-		String nickname = Main.pref.get(ConfigKeys.OSB_NICKNAME);
-		if(nickname == null || nickname.length() == 0) {
-			nickname = JOptionPane.showInputDialog(Main.parent, tr("Please enter a user name"));
-			if(nickname == null) {
-				nickname = tr("NoName");
-			} else {
-				Main.pref.put(ConfigKeys.OSB_NICKNAME, nickname);
-			}
-		}
-		
-		String comment = JOptionPane.showInputDialog(Main.parent, tr("Enter your comment"));
-		if(comment != null) {
-			comment = comment.concat(" [").concat(nickname).concat("]");
-			editAction.execute(getSelectedNode(), comment);
-		}
-	}
+    private EditAction editAction = new EditAction();
+
+    public AddCommentAction() {
+        super(tr("Add a comment"));
+    }
+
+    @Override
+    protected void doActionPerformed(ActionEvent e) throws Exception {
+        // get the user nickname
+        String nickname = Main.pref.get(ConfigKeys.OSB_NICKNAME);
+        if(nickname == null || nickname.length() == 0) {
+            nickname = JOptionPane.showInputDialog(Main.parent, tr("Please enter a user name"));
+            if(nickname == null) {
+                nickname = tr("NoName");
+            } else {
+                Main.pref.put(ConfigKeys.OSB_NICKNAME, nickname);
+            }
+        }
+
+        String comment = JOptionPane.showInputDialog(Main.parent, tr("Enter your comment"));
+        if(comment != null) {
+            comment = comment.concat(" [").concat(nickname).concat("]");
+            editAction.execute(getSelectedNode(), comment);
+        }
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/CloseIssueAction.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/CloseIssueAction.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/CloseIssueAction.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -40,22 +40,22 @@
 public class CloseIssueAction extends OsbAction {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private CloseAction closeAction = new CloseAction();
-	
-	public CloseIssueAction() {
-		super(tr("Mark as done"));
-	}
-	
-	@Override
-	protected void doActionPerformed(ActionEvent e) throws IOException {
-		int result = JOptionPane.showConfirmDialog(Main.parent,
-				tr("Really mark this issue as ''done''?"),
-				tr("Really close?"),
-				JOptionPane.YES_NO_OPTION);
-		
-		if(result == JOptionPane.YES_OPTION) {
-			closeAction.execute(getSelectedNode());
-		} 
-	}
+    private CloseAction closeAction = new CloseAction();
+
+    public CloseIssueAction() {
+        super(tr("Mark as done"));
+    }
+
+    @Override
+    protected void doActionPerformed(ActionEvent e) throws IOException {
+        int result = JOptionPane.showConfirmDialog(Main.parent,
+                tr("Really mark this issue as ''done''?"),
+                tr("Really close?"),
+                JOptionPane.YES_NO_OPTION);
+
+        if(result == JOptionPane.YES_OPTION) {
+            closeAction.execute(getSelectedNode());
+        }
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/NewIssueAction.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/NewIssueAction.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/NewIssueAction.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -47,86 +47,86 @@
 public class NewIssueAction extends OsbAction implements MouseListener {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private NewAction newAction = new NewAction();
-	
-	private JToggleButton button;
-	
-	private OsbPlugin plugin;
-	
-	public NewIssueAction(JToggleButton button, OsbPlugin plugin) {
-		super(tr("New issue"));
-		this.button = button;
-		this.plugin = plugin;
-	}
-	
-	@Override
-	protected void doActionPerformed(ActionEvent e) throws IOException {
-		if(button.isSelected()) {
-			Main.map.mapView.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
-			Main.map.mapView.addMouseListener(this);
-		} else {
-			reset();
-		}
-	}
+    private NewAction newAction = new NewAction();
 
-	private void reset() {
-		Main.map.mapView.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-		Main.map.mapView.removeMouseListener(this);
-		button.setSelected(false);
-	}
+    private JToggleButton button;
 
-	public void mouseClicked(MouseEvent e) {
-		addNewIssue(e);
-	}
+    private OsbPlugin plugin;
 
-	public void mouseEntered(MouseEvent e) {}
+    public NewIssueAction(JToggleButton button, OsbPlugin plugin) {
+        super(tr("New issue"));
+        this.button = button;
+        this.plugin = plugin;
+    }
 
-	public void mouseExited(MouseEvent e) {}
+    @Override
+    protected void doActionPerformed(ActionEvent e) throws IOException {
+        if(button.isSelected()) {
+            Main.map.mapView.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
+            Main.map.mapView.addMouseListener(this);
+        } else {
+            reset();
+        }
+    }
 
-	public void mousePressed(MouseEvent e) {
-		addNewIssue(e);
-	}
+    private void reset() {
+        Main.map.mapView.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+        Main.map.mapView.removeMouseListener(this);
+        button.setSelected(false);
+    }
 
-	private void addNewIssue(MouseEvent e) {
-		// get the user nickname
-		String nickname = Main.pref.get(ConfigKeys.OSB_NICKNAME);
-		if(nickname == null || nickname.length() == 0) {
-			nickname = JOptionPane.showInputDialog(Main.parent, tr("Please enter a user name"));
-			if(nickname == null) {
-				nickname = "NoName";
-			} else {
-				Main.pref.put(ConfigKeys.OSB_NICKNAME, nickname);
-			}
-		}
-		
-		// get the comment
-		String result = JOptionPane.showInputDialog(Main.parent,
-				tr("Describe the problem precisely"),
-				tr("Create issue"),
-				JOptionPane.QUESTION_MESSAGE);
-		
-		if(result != null && result.length() > 0) {
-			try {
-				result = result.concat(" [").concat(nickname).concat("]");
-				Node n = newAction.execute(e.getPoint(), result);
-				plugin.getDataSet().addPrimitive(n);
-				if(Main.pref.getBoolean(ConfigKeys.OSB_API_DISABLED)) {
-					plugin.updateGui();
-				} else {
-					plugin.updateData();
-				}
-			} catch (Exception e1) {
-				e1.printStackTrace();
-				JOptionPane.showMessageDialog(Main.parent,
-						tr("An error occurred: {0}", new Object[] {result}),
-						tr("Error"),
-						JOptionPane.ERROR_MESSAGE);
-			}
-		}
-		
-		reset();
-	}
+    public void mouseClicked(MouseEvent e) {
+        addNewIssue(e);
+    }
 
-	public void mouseReleased(MouseEvent e) {}
+    public void mouseEntered(MouseEvent e) {}
+
+    public void mouseExited(MouseEvent e) {}
+
+    public void mousePressed(MouseEvent e) {
+        addNewIssue(e);
+    }
+
+    private void addNewIssue(MouseEvent e) {
+        // get the user nickname
+        String nickname = Main.pref.get(ConfigKeys.OSB_NICKNAME);
+        if(nickname == null || nickname.length() == 0) {
+            nickname = JOptionPane.showInputDialog(Main.parent, tr("Please enter a user name"));
+            if(nickname == null) {
+                nickname = "NoName";
+            } else {
+                Main.pref.put(ConfigKeys.OSB_NICKNAME, nickname);
+            }
+        }
+
+        // get the comment
+        String result = JOptionPane.showInputDialog(Main.parent,
+                tr("Describe the problem precisely"),
+                tr("Create issue"),
+                JOptionPane.QUESTION_MESSAGE);
+
+        if(result != null && result.length() > 0) {
+            try {
+                result = result.concat(" [").concat(nickname).concat("]");
+                Node n = newAction.execute(e.getPoint(), result);
+                plugin.getDataSet().addPrimitive(n);
+                if(Main.pref.getBoolean(ConfigKeys.OSB_API_DISABLED)) {
+                    plugin.updateGui();
+                } else {
+                    plugin.updateData();
+                }
+            } catch (Exception e1) {
+                e1.printStackTrace();
+                JOptionPane.showMessageDialog(Main.parent,
+                        tr("An error occurred: {0}", new Object[] {result}),
+                        tr("Error"),
+                        JOptionPane.ERROR_MESSAGE);
+            }
+        }
+
+        reset();
+    }
+
+    public void mouseReleased(MouseEvent e) {}
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/OsbAction.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/OsbAction.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/OsbAction.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -38,42 +38,42 @@
 public abstract class OsbAction extends AbstractAction {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private static List<OsbActionObserver> observers = new ArrayList<OsbActionObserver>(); 
-	
-	private static Node selectedNode;
-	
-	public OsbAction(String name) {
-		super(name);
-	}
+    private static List<OsbActionObserver> observers = new ArrayList<OsbActionObserver>();
 
-	public static Node getSelectedNode() {
-		return selectedNode;
-	}
+    private static Node selectedNode;
 
-	public static void setSelectedNode(Node selectedNode) {
-		OsbAction.selectedNode = selectedNode;
-	}
-	
-	public void actionPerformed(ActionEvent e) {
-		try {
-			doActionPerformed(e);
-			for (OsbActionObserver obs : observers) {
-				obs.actionPerformed(this);
-			}
-		} catch (Exception e1) {
-			System.err.println("Couldn't execute action " + getClass().getSimpleName());
-			e1.printStackTrace();
-		}
-	}
-	
-	protected abstract void doActionPerformed(ActionEvent e) throws Exception;
-	
-	public static void addActionObserver(OsbActionObserver obs) {
-		observers.add(obs);
-	}
-	
-	public static void removeActionObserver(OsbActionObserver obs) {
-		observers.remove(obs);
-	}
+    public OsbAction(String name) {
+        super(name);
+    }
+
+    public static Node getSelectedNode() {
+        return selectedNode;
+    }
+
+    public static void setSelectedNode(Node selectedNode) {
+        OsbAction.selectedNode = selectedNode;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        try {
+            doActionPerformed(e);
+            for (OsbActionObserver obs : observers) {
+                obs.actionPerformed(this);
+            }
+        } catch (Exception e1) {
+            System.err.println("Couldn't execute action " + getClass().getSimpleName());
+            e1.printStackTrace();
+        }
+    }
+
+    protected abstract void doActionPerformed(ActionEvent e) throws Exception;
+
+    public static void addActionObserver(OsbActionObserver obs) {
+        observers.add(obs);
+    }
+
+    public static void removeActionObserver(OsbActionObserver obs) {
+        observers.remove(obs);
+    }
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/OsbActionObserver.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/OsbActionObserver.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/OsbActionObserver.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -29,4 +29,4 @@
 
 public interface OsbActionObserver {
-	public void actionPerformed(OsbAction action);
+    public void actionPerformed(OsbAction action);
 }
Index: applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/PopupFactory.java
===================================================================
--- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/PopupFactory.java	(revision 12670)
+++ applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/PopupFactory.java	(revision 12778)
@@ -1,17 +1,17 @@
 /* Copyright (c) 2008, Henrik Niehaus
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, 
- *    this list of conditions and the following disclaimer in the documentation 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its 
- *    contributors may be used to endorse or promote products derived from this 
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -37,50 +37,50 @@
 
 public class PopupFactory {
-	
-	private static JPopupMenu issuePopup;
-	private static JPopupMenu fixedPopup;
-	
-	public static synchronized JPopupMenu createPopup(Node node) {
-		if("0".equals(node.get("state"))) {
-			return getIssuePopup();
-		} else if("1".equals(node.get("state"))) {
-			return getFixedPopup();
-		} else {
-			throw new RuntimeException(tr("Unknown issue state"));
-		}
-	}
 
-	private static JPopupMenu getIssuePopup() {
-		if(issuePopup == null) {
-			issuePopup = new JPopupMenu();
-			JMenuItem add = new JMenuItem();
-			add.setAction(new AddCommentAction());
-			add.setIcon(OsbPlugin.loadIcon("add_comment16.png"));
-			issuePopup.add(add);
-			JMenuItem close = new JMenuItem();
-			close.setAction(new CloseIssueAction());
-			close.setIcon(OsbPlugin.loadIcon("icon_valid16.png"));
-			issuePopup.add(close);
-		}
-		return issuePopup;
-	}
-	
-	private static JPopupMenu getFixedPopup() {
-		if(fixedPopup == null) {
-			fixedPopup = new JPopupMenu();
-			JMenuItem add = new JMenuItem();
-			AddCommentAction aca = new AddCommentAction();
-			aca.setEnabled(false);
-			add.setAction(aca);
-			add.setIcon(OsbPlugin.loadIcon("add_comment16.png"));
-			JMenuItem close = new JMenuItem();
-			CloseIssueAction cia = new CloseIssueAction();
-			cia.setEnabled(false);
-			close.setAction(cia);
-			close.setIcon(OsbPlugin.loadIcon("icon_valid16.png"));
-			fixedPopup.add(add);
-			fixedPopup.add(close);
-		}
-		return fixedPopup;
-	}
+    private static JPopupMenu issuePopup;
+    private static JPopupMenu fixedPopup;
+
+    public static synchronized JPopupMenu createPopup(Node node) {
+        if("0".equals(node.get("state"))) {
+            return getIssuePopup();
+        } else if("1".equals(node.get("state"))) {
+            return getFixedPopup();
+        } else {
+            throw new RuntimeException(tr("Unknown issue state"));
+        }
+    }
+
+    private static JPopupMenu getIssuePopup() {
+        if(issuePopup == null) {
+            issuePopup = new JPopupMenu();
+            JMenuItem add = new JMenuItem();
+            add.setAction(new AddCommentAction());
+            add.setIcon(OsbPlugin.loadIcon("add_comment16.png"));
+            issuePopup.add(add);
+            JMenuItem close = new JMenuItem();
+            close.setAction(new CloseIssueAction());
+            close.setIcon(OsbPlugin.loadIcon("icon_valid16.png"));
+            issuePopup.add(close);
+        }
+        return issuePopup;
+    }
+
+    private static JPopupMenu getFixedPopup() {
+        if(fixedPopup == null) {
+            fixedPopup = new JPopupMenu();
+            JMenuItem add = new JMenuItem();
+            AddCommentAction aca = new AddCommentAction();
+            aca.setEnabled(false);
+            add.setAction(aca);
+            add.setIcon(OsbPlugin.loadIcon("add_comment16.png"));
+            JMenuItem close = new JMenuItem();
+            CloseIssueAction cia = new CloseIssueAction();
+            cia.setEnabled(false);
+            close.setAction(cia);
+            close.setIcon(OsbPlugin.loadIcon("icon_valid16.png"));
+            fixedPopup.add(add);
+            fixedPopup.add(close);
+        }
+        return fixedPopup;
+    }
 }
