Index: /trunk/src/org/openstreetmap/josm/gui/Notification.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/Notification.java	(revision 10892)
+++ /trunk/src/org/openstreetmap/josm/gui/Notification.java	(revision 10893)
@@ -32,4 +32,7 @@
 public class Notification {
 
+    /**
+     * Default width of a notification
+     */
     public static final int DEFAULT_CONTENT_WIDTH = 350;
 
@@ -59,5 +62,5 @@
 
     private Component content;
-    private int duration;
+    private int duration = Notification.TIME_DEFAULT;
     private Icon icon;
     private String helpTopic;
@@ -67,5 +70,5 @@
      */
     public Notification() {
-        duration = NotificationManager.defaultNotificationTime;
+        // nothing to do.
     }
 
@@ -170,16 +173,32 @@
     }
 
+    /**
+     * Gets the content component to use.
+     * @return The content
+     */
     public Component getContent() {
         return content;
     }
 
+    /**
+     * Gets the time the notification should be displayed
+     * @return The time to display the notification
+     */
     public int getDuration() {
         return duration;
     }
 
+    /**
+     * Gets the icon that should be displayed next to the notification
+     * @return The icon to display
+     */
     public Icon getIcon() {
         return icon;
     }
 
+    /**
+     * Gets the help topic for this notification
+     * @return The help topic
+     */
     public String getHelpTopic() {
         return helpTopic;
Index: /trunk/src/org/openstreetmap/josm/gui/NotificationManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NotificationManager.java	(revision 10892)
+++ /trunk/src/org/openstreetmap/josm/gui/NotificationManager.java	(revision 10893)
@@ -37,4 +37,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.preferences.IntegerProperty;
 import org.openstreetmap.josm.gui.help.HelpBrowser;
 import org.openstreetmap.josm.gui.help.HelpUtil;
@@ -64,27 +65,19 @@
     private final Queue<Notification> queue;
 
-    private static int pauseTime = Main.pref.getInteger("notification-default-pause-time-ms", 300); // milliseconds
-    static int defaultNotificationTime = Main.pref.getInteger("notification-default-time-ms", 5000); // milliseconds
+    private static IntegerProperty pauseTime = new IntegerProperty("notification-default-pause-time-ms", 300); // milliseconds
 
     private long displayTimeStart;
     private long elapsedTime;
 
-    private static NotificationManager INSTANCE;
+    private static NotificationManager instance;
 
     private static final Color PANEL_SEMITRANSPARENT = new Color(224, 236, 249, 230);
     private static final Color PANEL_OPAQUE = new Color(224, 236, 249);
 
-    public static synchronized NotificationManager getInstance() {
-        if (INSTANCE == null) {
-            INSTANCE = new NotificationManager();
-        }
-        return INSTANCE;
-    }
-
     NotificationManager() {
         queue = new LinkedList<>();
-        hideTimer = new Timer(defaultNotificationTime, new HideEvent());
+        hideTimer = new Timer(Notification.TIME_DEFAULT, e -> this.stopHideTimer());
         hideTimer.setRepeats(false);
-        pauseTimer = new Timer(pauseTime, new PauseFinishedEvent());
+        pauseTimer = new Timer(pauseTime.get(), new PauseFinishedEvent());
         pauseTimer.setRepeats(false);
         unfreezeDelayTimer = new Timer(10, new UnfreezeEvent());
@@ -92,4 +85,9 @@
     }
 
+    /**
+     * Show the given notification
+     * @param note The note to show.
+     * @see Notification#show()
+     */
     public void showNotification(Notification note) {
         synchronized (queue) {
@@ -105,5 +103,5 @@
         if (currentNotification == null) return;
 
-        currentNotificationPanel = new NotificationPanel(currentNotification);
+        currentNotificationPanel = new NotificationPanel(currentNotification, new FreezeMouseListener(), e -> this.stopHideTimer());
         currentNotificationPanel.validate();
 
@@ -147,19 +145,15 @@
     }
 
-    private class HideEvent implements ActionListener {
-
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            hideTimer.stop();
-            if (currentNotificationPanel != null) {
-                currentNotificationPanel.setVisible(false);
-                JFrame parent = (JFrame) Main.parent;
-                if (parent != null) {
-                    parent.getLayeredPane().remove(currentNotificationPanel);
-                }
-                currentNotificationPanel = null;
-            }
-            pauseTimer.restart();
-        }
+    private void stopHideTimer() {
+        hideTimer.stop();
+        if (currentNotificationPanel != null) {
+            currentNotificationPanel.setVisible(false);
+            JFrame parent = (JFrame) Main.parent;
+            if (parent != null) {
+                parent.getLayeredPane().remove(currentNotificationPanel);
+            }
+            currentNotificationPanel = null;
+        }
+        pauseTimer.restart();
     }
 
@@ -187,11 +181,11 @@
     }
 
-    private class NotificationPanel extends JPanel {
+    private static class NotificationPanel extends JPanel {
 
         private JPanel innerPanel;
 
-        NotificationPanel(Notification note) {
+        NotificationPanel(Notification note, MouseListener freeze, ActionListener hideListener) {
             setVisible(false);
-            build(note);
+            build(note, freeze, hideListener);
         }
 
@@ -200,6 +194,8 @@
         }
 
-        private void build(final Notification note) {
-            JButton btnClose = new JButton(new HideAction());
+        private void build(final Notification note, MouseListener freeze, ActionListener hideListener) {
+            JButton btnClose = new JButton();
+            btnClose.addActionListener(hideListener);
+            btnClose.setIcon(ImageProvider.get("misc", "grey_x"));
             btnClose.setPreferredSize(new Dimension(50, 50));
             btnClose.setMargin(new Insets(0, 0, 1, 1));
@@ -295,9 +291,8 @@
              * a tiny delay before the timer really resumes.
              */
-            MouseListener freeze = new FreezeMouseListener();
             addMouseListenerToAllChildComponents(this, freeze);
         }
 
-        private void addMouseListenerToAllChildComponents(Component comp, MouseListener listener) {
+        private static void addMouseListenerToAllChildComponents(Component comp, MouseListener listener) {
             comp.addMouseListener(listener);
             if (comp instanceof Container) {
@@ -307,34 +302,22 @@
             }
         }
-
-        class HideAction extends AbstractAction {
-
-            HideAction() {
-                putValue(SMALL_ICON, ImageProvider.get("misc", "grey_x"));
-            }
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                new HideEvent().actionPerformed(null);
-            }
-        }
-
-        class FreezeMouseListener extends MouseAdapter {
-            @Override
-            public void mouseEntered(MouseEvent e) {
-                if (unfreezeDelayTimer.isRunning()) {
-                    unfreezeDelayTimer.stop();
-                } else {
-                    hideTimer.stop();
-                    elapsedTime += System.currentTimeMillis() - displayTimeStart;
-                    currentNotificationPanel.setNotificationBackground(PANEL_OPAQUE);
-                    currentNotificationPanel.repaint();
-                }
-            }
-
-            @Override
-            public void mouseExited(MouseEvent e) {
-                unfreezeDelayTimer.restart();
-            }
+    }
+
+    class FreezeMouseListener extends MouseAdapter {
+        @Override
+        public void mouseEntered(MouseEvent e) {
+            if (unfreezeDelayTimer.isRunning()) {
+                unfreezeDelayTimer.stop();
+            } else {
+                hideTimer.stop();
+                elapsedTime += System.currentTimeMillis() - displayTimeStart;
+                currentNotificationPanel.setNotificationBackground(PANEL_OPAQUE);
+                currentNotificationPanel.repaint();
+            }
+        }
+
+        @Override
+        public void mouseExited(MouseEvent e) {
+            unfreezeDelayTimer.restart();
         }
     }
@@ -371,3 +354,10 @@
         }
     }
+
+    public static synchronized NotificationManager getInstance() {
+        if (instance == null) {
+            instance = new NotificationManager();
+        }
+        return instance;
+    }
 }
