Index: trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 1426)
+++ trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 1427)
@@ -6,4 +6,5 @@
 import java.awt.GridBagLayout;
 import java.awt.Toolkit;
+import java.util.ArrayList;
 
 import javax.swing.AbstractAction;
@@ -25,5 +26,10 @@
 public class ExtendedDialog extends JDialog {
     private int result = 0;
+    private Component parent;
     private final String[] bTexts;
+    
+    // For easy access when inherited
+    protected Object contentConstraints = GBC.eol().anchor(GBC.CENTER).insets(5,10,5,0);
+    protected ArrayList<JButton> buttons = new ArrayList<JButton>();
     
     /**
@@ -36,7 +42,9 @@
      */ 
     public ExtendedDialog(Component parent, String title, Component content, String[] buttonTexts, String[] buttonIcons) {
-        super(JOptionPane.getFrameForComponent(parent), title, true);     
+        super(JOptionPane.getFrameForComponent(parent), title, true);  
+        this.parent = parent;
         bTexts = buttonTexts;        
-        setupDialog(parent, title, content, buttonTexts, buttonIcons);
+        setupDialog(content, buttonIcons);
+        setVisible(true);
     }
     
@@ -45,5 +53,7 @@
     }
     
-    // just display a breakable message
+    /**
+     * Sets up the dialog and displays the given message in a breakable label
+     */
     public ExtendedDialog(Component parent, String title, String message, String[] buttonTexts, String[] buttonIcons) {
         super(JOptionPane.getFrameForComponent(parent), title, true);
@@ -55,5 +65,6 @@
         
         bTexts = buttonTexts;        
-        setupDialog(parent, title, lbl, buttonTexts, buttonIcons);
+        setupDialog(lbl, buttonIcons);
+        setVisible(true);
     }
     
@@ -62,5 +73,13 @@
     }
     
-    private void setupDialog(Component parent, String title, Component content, String[] buttonTexts, String[] buttonIcons) {
+    /**
+     * Constructor that doesn't make the dialog visible immediately. Intended for when inheriting.
+     */
+    public ExtendedDialog(Component parent, String title, String[] buttonTexts, boolean modal) {
+        super(JOptionPane.getFrameForComponent(parent), title, modal);     
+        bTexts = buttonTexts;   
+    }
+    
+    protected void setupDialog(Component content, String[] buttonIcons) {
         setupEscListener();
         
@@ -88,8 +107,9 @@
             if(i == 0) rootPane.setDefaultButton(button);           
             buttonsPanel.add(button, GBC.std().insets(2,2,2,2));
+            buttons.add(button);
         }
         
         JPanel cp = new JPanel(new GridBagLayout());        
-        cp.add(content, GBC.eol().anchor(GBC.CENTER).insets(5,10,5,0));
+        cp.add(content, contentConstraints);
         cp.add(buttonsPanel, GBC.eol().anchor(GBC.CENTER).insets(5,5,5,5));
         
@@ -102,11 +122,5 @@
         // Try to make it not larger than the parent window or at least not larger than 2/3 of the screen
         Dimension d = getSize();
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        Dimension x = new Dimension(Math.round(screenSize.width*2/3), Math.round(screenSize.height*2/3));
-        
-        try {
-            if(parent != null)
-                x = JOptionPane.getFrameForComponent(parent).getSize();
-        } catch(NullPointerException e) { }
+        Dimension x = findMaxDialogSize();
         
         boolean limitedInWidth = d.width > x.width;
@@ -122,5 +136,4 @@
         setSize(d);
         setLocationRelativeTo(parent);
-        setVisible(true);
     }
     
@@ -131,4 +144,19 @@
     public int getValue() {
         return result;
+    }
+    
+    /**
+     * Tries to find a good value of how large the dialog should be
+     * @return Dimension Size of the parent Component or 2/3 of screen size if not available
+     */
+    protected Dimension findMaxDialogSize() {
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        Dimension x = new Dimension(Math.round(screenSize.width*2/3),
+                                    Math.round(screenSize.height*2/3));
+        try {
+            if(parent != null)
+                x = JOptionPane.getFrameForComponent(parent).getSize();
+        } catch(NullPointerException e) { }
+        return x;
     }
     
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 1426)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 1427)
@@ -6,10 +6,11 @@
 import static org.openstreetmap.josm.tools.I18n.trn;
 
+import java.awt.Component;
 import java.awt.GridBagLayout;
 import java.awt.Image;
 import java.awt.event.ActionEvent;
 import java.io.BufferedReader;
+import java.io.IOException;
 import java.io.InputStreamReader;
-import java.io.IOException;
 import java.io.Reader;
 import java.io.UnsupportedEncodingException;
@@ -37,13 +38,12 @@
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.SequenceCommand;
+import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
-import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.QuadStateCheckBox;
 import org.openstreetmap.josm.io.MirroredInputStream;
-import org.openstreetmap.josm.gui.QuadStateCheckBox;
-import org.openstreetmap.josm.gui.tagging.TaggingPresetMenu;
-import org.openstreetmap.josm.gui.tagging.TaggingPresetSeparator;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -590,27 +590,32 @@
         if (p == null)
             return;
-        int answer = JOptionPane.OK_OPTION;
+              
+        int answer = 1;
         if (p.getComponentCount() != 0) {
-            final JOptionPane optionPane = new JOptionPane(p, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
-                @Override public void selectInitialValue() {
-                    for (Item i : data) {
-                        if (i.focus) {
-                            i.requestFocusInWindow();
-                            return;
-                        }
-                    }
-                }
-            };
             String title = trn("Change {0} object", "Change {0} objects", sel.size(), sel.size());
-            if(sel.size() == 0)
-                title = tr("Nothing selected!");
-
-            optionPane.createDialog(Main.parent, title).setVisible(true);
-            Object answerObj = optionPane.getValue();
-            if (answerObj == null || answerObj == JOptionPane.UNINITIALIZED_VALUE ||
-                    (answerObj instanceof Integer && (Integer)answerObj != JOptionPane.OK_OPTION))
-                answer = JOptionPane.CANCEL_OPTION;
-        }
-        if (sel.size() != 0 && answer == JOptionPane.OK_OPTION) {
+            if(sel.size() == 0) {
+                if(originalSelectionEmpty)
+                    title = tr("Nothing selected!");
+                else
+                    title = tr("Selection unsuitable!");
+            }
+            
+            class PresetDialog extends ExtendedDialog {
+                public PresetDialog(Component content, String title, boolean disableApply) {
+                    super(Main.parent,
+                            title,
+                            new String[] { tr("Apply Preset"), tr("Cancel") },
+                            true);
+                    contentConstraints = GBC.eol().fill().insets(5,10,5,0);
+                    setupDialog(content, new String[] {"ok.png", "cancel.png" });
+                    buttons.get(0).setEnabled(!disableApply);
+                    buttons.get(0).setToolTipText(title);
+                    setVisible(true);
+                }
+            }
+            
+            answer = new PresetDialog(p, title, (sel.size() == 0)).getValue();
+        }
+        if (sel.size() != 0 && answer == 1) {
             Command cmd = createCommand(sel);
             if (cmd != null)
@@ -619,6 +624,17 @@
         Main.ds.setSelected(Main.ds.getSelected()); // force update
     }
-
+    
+    /**
+     * True whenever the original selection given into createSelection was empty
+     */
+    private boolean originalSelectionEmpty = false;
+    
+    /**
+     * Removes all unsuitable OsmPrimitives from the given list
+     * @param participants List of possibile OsmPrimitives to tag
+     * @return Cleaned list with suitable OsmPrimitives only
+     */
     private Collection<OsmPrimitive> createSelection(Collection<OsmPrimitive> participants) {
+        originalSelectionEmpty = participants.size() == 0;
         Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>();
         for (OsmPrimitive osm : participants)
