Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 5909)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 5965)
@@ -6,5 +6,4 @@
 
 import java.awt.AWTEvent;
-import java.awt.Color;
 import java.awt.Component;
 import java.awt.Cursor;
@@ -17,4 +16,5 @@
 import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
+import java.awt.event.ActionEvent;
 import java.awt.event.InputEvent;
 import java.awt.event.KeyAdapter;
@@ -29,7 +29,12 @@
 import java.util.List;
 
+import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JLabel;
+import javax.swing.JMenuItem;
 import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
 import javax.swing.JProgressBar;
 import javax.swing.JScrollPane;
@@ -37,4 +42,6 @@
 import javax.swing.PopupFactory;
 import javax.swing.UIManager;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
 
 import org.openstreetmap.josm.Main;
@@ -47,7 +54,8 @@
 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor.ProgressMonitorDialog;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.gui.widgets.ImageLabel;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -72,34 +80,4 @@
     final Collector collector;
 
-    /**
-     * A small user interface component that consists of an image label and
-     * a fixed text content to the right of the image.
-     */
-    static class ImageLabel extends JPanel {
-        static Color backColor = Color.decode("#b8cfe5");
-        static Color backColorActive = Color.decode("#aaff5e");
-            
-        private JLabel tf;
-        private int chars;
-        public ImageLabel(String img, String tooltip, int chars) {
-            super();
-            setLayout(new GridBagLayout());
-            setBackground(backColor);
-            add(new JLabel(ImageProvider.get("statusline/"+img+".png")), GBC.std().anchor(GBC.WEST).insets(0,1,1,0));
-            add(tf = new JLabel(), GBC.std().fill(GBC.BOTH).anchor(GBC.WEST).insets(2,1,1,0));
-            setToolTipText(tooltip);
-            this.chars = chars;
-        }
-        public void setText(String t) {
-            tf.setText(t);
-        }
-        @Override public Dimension getPreferredSize() {
-            return new Dimension(25 + chars*tf.getFontMetrics(tf.getFont()).charWidth('0'), super.getPreferredSize().height);
-        }
-        @Override public Dimension getMinimumSize() {
-            return new Dimension(25 + chars*tf.getFontMetrics(tf.getFont()).charWidth('0'), super.getMinimumSize().height);
-        }
-    }
-
     public class BackgroundProgressMonitor implements ProgressMonitorDialog {
 
@@ -115,8 +93,10 @@
         }
 
+        @Override
         public void setVisible(boolean visible) {
             progressBar.setVisible(visible);
         }
 
+        @Override
         public void updateProgress(int progress) {
             progressBar.setValue(progress);
@@ -125,4 +105,5 @@
         }
 
+        @Override
         public void setCustomText(String text) {
             this.customText = text;
@@ -130,4 +111,5 @@
         }
 
+        @Override
         public void setCurrentAction(String text) {
             this.title = text;
@@ -135,4 +117,5 @@
         }
 
+        @Override
         public void setIndeterminate(boolean newValue) {
             UIManager.put("ProgressBar.cycleTime", UIManager.getInt("ProgressBar.repaintInterval") * 100);
@@ -218,4 +201,5 @@
          * Execution function for the Collector.
          */
+        @Override
         public void run() {
             registerListeners();
@@ -281,5 +265,7 @@
                                     // Set the text label in the bottom status bar
                                     // "if mouse moved only" was added to stop heap growing
-                                    if (!mouseNotMoved) statusBarElementUpdate(ms);
+                                    if (!mouseNotMoved) {
+                                        statusBarElementUpdate(ms);
+                                    }
 
 
@@ -363,5 +349,5 @@
          * @return popup
          */
-        private final Popup popupCreatePopup(Component content, MouseState ms) {
+        private Popup popupCreatePopup(Component content, MouseState ms) {
             Point p = mv.getLocationOnScreen();
             Dimension scrn = Toolkit.getDefaultToolkit().getScreenSize();
@@ -399,5 +385,5 @@
          * @param ms
          */
-        private final void statusBarElementUpdate(MouseState ms) {
+        private void statusBarElementUpdate(MouseState ms) {
             final OsmPrimitive osmNearest = mv.getNearestNodeOrWay(ms.mousePos, OsmPrimitive.isUsablePredicate, false);
             if (osmNearest != null) {
@@ -414,5 +400,5 @@
          * @param mods modifiers (i.e. control keys)
          */
-        private final void popupCycleSelection(Collection<OsmPrimitive> osms, int mods) {
+        private void popupCycleSelection(Collection<OsmPrimitive> osms, int mods) {
             DataSet ds = Main.main.getCurrentDataSet();
             // Find some items that are required for cycling through
@@ -453,5 +439,5 @@
          * Tries to hide the given popup
          */
-        private final void popupHidePopup() {
+        private void popupHidePopup() {
             popupLabels = null;
             if(popup == null)
@@ -460,5 +446,7 @@
             popup = null;
             EventQueue.invokeLater(new Runnable(){
-                public void run() { staticPopup.hide(); }});
+               public void run() {
+                    staticPopup.hide(); 
+                }});
         }
 
@@ -469,5 +457,5 @@
          * @param lbls lables to show (see {@link #popupLabels})
          */
-        private final void popupShowPopup(Popup newPopup, List<JLabel> lbls) {
+        private void popupShowPopup(Popup newPopup, List<JLabel> lbls) {
             final Popup staticPopup = newPopup;
             if(this.popup != null) {
@@ -476,5 +464,5 @@
                 final Popup staticOldPopup = this.popup;
                 EventQueue.invokeLater(new Runnable(){
-                    public void run() {
+                    @Override public void run() {
                         staticPopup.show();
                         staticOldPopup.hide();
@@ -484,5 +472,5 @@
                 // There is no old popup
                 EventQueue.invokeLater(new Runnable(){
-                    public void run() { staticPopup.show(); }});
+                     @Override public void run() { staticPopup.show(); }});
             }
             this.popupLabels = lbls;
@@ -495,5 +483,5 @@
          * user clicks on the map instead of the popup.
          */
-        private final void popupUpdateLabels() {
+        private void popupUpdateLabels() {
             if(this.popup == null || this.popupLabels == null)
                 return;
@@ -510,5 +498,5 @@
          * @param osm The primitive to derive the colors from
          */
-        private final void popupSetLabelColors(JLabel lbl, OsmPrimitive osm) {
+        private void popupSetLabelColors(JLabel lbl, OsmPrimitive osm) {
             DataSet ds = Main.main.getCurrentDataSet();
             if(ds.isSelected(osm)) {
@@ -527,5 +515,5 @@
          * @return labels for info popup
          */
-        private final JLabel popupBuildPrimitiveLabels(final OsmPrimitive osm) {
+        private JLabel popupBuildPrimitiveLabels(final OsmPrimitive osm) {
             final StringBuilder text = new StringBuilder();
             String name = osm.getDisplayName(DefaultNameFormatter.getInstance());
@@ -587,9 +575,9 @@
             // can correct this defect.
             l.addMouseMotionListener(new MouseMotionListener() {
-                public void mouseMoved(MouseEvent e) {
+                 @Override public void mouseMoved(MouseEvent e) {
                     l.setBackground(SystemColor.info);
                     l.setForeground(SystemColor.infoText);
                 }
-                public void mouseDragged(MouseEvent e) {
+                 @Override public void mouseDragged(MouseEvent e) {
                     l.setBackground(SystemColor.info);
                     l.setForeground(SystemColor.infoText);
@@ -614,5 +602,6 @@
 
     private AWTEventListener awtListener = new AWTEventListener() {
-        public void eventDispatched(AWTEvent event) {
+         @Override 
+         public void eventDispatched(AWTEvent event) {
             if (event instanceof InputEvent &&
                     ((InputEvent)event).getComponent() == mv) {
@@ -629,4 +618,5 @@
 
     private MouseMotionListener mouseMotionListener = new MouseMotionListener() {
+        @Override
         public void mouseMoved(MouseEvent e) {
             synchronized (collector) {
@@ -637,4 +627,5 @@
         }
 
+        @Override
         public void mouseDragged(MouseEvent e) {
             mouseMoved(e);
@@ -686,12 +677,36 @@
         this.collector = new Collector(mapFrame);
 
-        lonText.addMouseListener(Main.main.menu.jumpToAct);
-        latText.addMouseListener(Main.main.menu.jumpToAct);
-        
+        // Context menu of status bar
+        setComponentPopupMenu(new JPopupMenu() {
+            JCheckBoxMenuItem doNotHide = new JCheckBoxMenuItem(new AbstractAction(tr("Do not hide status bar")) {
+                @Override public void actionPerformed(ActionEvent e) {
+                    boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
+                    Main.pref.put("statusbar.always-visible", sel);
+                }
+            });
+            JMenuItem jumpButton;
+            {
+                jumpButton = add(Main.main.menu.jumpToAct);
+                addPopupMenuListener(new PopupMenuListener() {
+                    @Override
+                    public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
+                        Component invoker = ((JPopupMenu)e.getSource()).getInvoker(); 
+                        jumpButton.setVisible(invoker == latText || invoker == lonText);
+                        doNotHide.setSelected(Main.pref.getBoolean("statusbar.always-visible", true));
+                    }
+                    @Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}
+                    @Override public void popupMenuCanceled(PopupMenuEvent e) {}
+                });
+                add(doNotHide);
+            }
+        });
+
         // Listen for mouse movements and set the position text field
         mv.addMouseMotionListener(new MouseMotionListener(){
+            @Override
             public void mouseDragged(MouseEvent e) {
                 mouseMoved(e);
             }
+            @Override
             public void mouseMoved(MouseEvent e) {
                 if (mv.center == null)
@@ -709,4 +724,13 @@
         setLayout(new GridBagLayout());
         setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+
+        latText.setInheritsPopupMenu(true);
+        lonText.setInheritsPopupMenu(true);
+        headingText.setInheritsPopupMenu(true);
+        //angleText.setInheritsPopupMenu(true);
+        distText.setInheritsPopupMenu(true);
+        nameText.setInheritsPopupMenu(true);
+        //helpText.setInheritsPopupMenu(true);
+        //progressBar.setInheritsPopupMenu(true);
 
         add(latText, GBC.std());
@@ -745,4 +769,5 @@
     }
 
+    @Override
     public String helpTopic() {
         return ht("/Statusline");
