Ignore:
Timestamp:
2009-10-07T21:25:15+02:00 (16 years ago)
Author:
Gubaer
Message:

New utility class for help context aware option dialogs
Improved context sensitive help in the context of conflict resolution, see also Conflict List Dialog

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r2252 r2255  
    118118     */
    119119    public ConflictDialog() {
    120         super(tr("Conflict"), "conflict", tr("Merging conflicts."),
     120        super(tr("Conflict"), "conflict", tr("Resolve conflicts."),
    121121                Shortcut.registerShortcut("subwindow:conflict", tr("Toggle: {0}", tr("Conflict")), KeyEvent.VK_C, Shortcut.GROUP_LAYER), 100);
    122122
     
    144144            return;
    145145        int row = selectedRows[0];
    146         Conflict c = conflicts.get(row);
     146        Conflict<?> c = conflicts.get(row);
    147147        OsmPrimitive my = c.getMy();
    148148        OsmPrimitive their = c.getTheir();
     
    262262    }
    263263
     264    @Override
     265    public String helpTopic() {
     266        return "Dialogs/ConflictListDialog";
     267    }
     268
    264269    /**
    265270     * The {@see ListModel} for conflicts
     
    328333            putValue(SHORT_DESCRIPTION,  tr("Open a merge dialog of all selected items in the list above."));
    329334            putValue(SMALL_ICON, ImageProvider.get("dialogs", "conflict"));
     335            putValue("help", "Dialogs/ConflictListDialog#ResolveAction");
    330336        }
    331337
     
    347353            putValue(SHORT_DESCRIPTION,  tr("Set the selected elements on the map to the selected items in the list above."));
    348354            putValue(SMALL_ICON, ImageProvider.get("dialogs", "select"));
     355            putValue("help", "Dialogs/ConflictListDialog#SelectAction");
    349356        }
    350357
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r2252 r2255  
    1212import java.awt.event.ActionEvent;
    1313import java.awt.event.ActionListener;
    14 import java.awt.event.ComponentAdapter;
    15 import java.awt.event.ComponentEvent;
    1614import java.awt.event.MouseAdapter;
    1715import java.awt.event.MouseEvent;
    1816import java.awt.event.WindowAdapter;
    1917import java.awt.event.WindowEvent;
    20 import java.util.logging.Logger;
    2118
    2219import javax.swing.AbstractAction;
    2320import javax.swing.BorderFactory;
    24 import javax.swing.Box;
    2521import javax.swing.ImageIcon;
    2622import javax.swing.JButton;
     
    3430import org.openstreetmap.josm.actions.JosmAction;
    3531import org.openstreetmap.josm.gui.dialogs.DialogsPanel.Action;
     32import org.openstreetmap.josm.gui.help.HelpBuilder;
    3633import org.openstreetmap.josm.gui.help.Helpful;
    3734import org.openstreetmap.josm.tools.GBC;
     
    348345     *
    349346     */
    350     private class DetachedDialog extends JDialog {
     347    private class DetachedDialog extends JDialog{
    351348        public DetachedDialog() {
    352349            super(JOptionPane.getFrameForComponent(Main.parent));
     
    362359                }
    363360            });
     361            addMouseListener(
     362                    new MouseAdapter() {
     363                        @Override
     364                        public void mouseEntered(MouseEvent e) {
     365                            super.mouseEntered(e);
     366                            System.out.println("requesting focus ...");
     367                            requestFocusInWindow();
     368                        }
     369                    }
     370            );
     371
    364372            String bounds = Main.pref.get(preferencePrefix+".bounds",null);
    365373            if (bounds != null) {
     
    373381            }
    374382            setTitle(titleBar.getTitle());
     383            HelpBuilder.setHelpContext(getRootPane(), helpTopic());
    375384        }
    376385
Note: See TracChangeset for help on using the changeset viewer.