Changeset 2347 in josm
- Timestamp:
- 2009-10-29T07:30:49+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r2323 r2347 35 35 c = SwingUtilities.getDeepestComponentAt(c, mouse.x, mouse.y); 36 36 topic = HelpUtil.getContextSpecificHelpTopic(c); 37 System.out.println("topic is:" + topic);38 37 } else { 39 38 topic = null; … … 42 41 Point mouse = Main.parent.getMousePosition(); 43 42 topic = HelpUtil.getContextSpecificHelpTopic(SwingUtilities.getDeepestComponentAt(Main.parent, mouse.x, mouse.y)); 44 System.out.println("topic is:" + topic);45 43 } 46 44 if (topic == null) { -
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r2346 r2347 135 135 JPanel pnl = new JPanel(); 136 136 pnl.setLayout(new FlowLayout()); 137 137 138 // -- download button 138 139 pnl.add(btnDownload = new SideButton(actDownload = new DownloadAction())); 139 140 btnDownload.setFocusable(true); 140 141 btnDownload.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), "download"); 141 142 btnDownload.getActionMap().put("download",actDownload); 142 pnl.add(new SideButton(new CancelAction())); 143 pnl.add(new SideButton(new ContextSensitiveHelpAction(ht("/Dialog/DownloadDialog")))); 143 144 // -- cancel button 145 SideButton btnCancel; 146 CancelAction actCancel = new CancelAction(); 147 pnl.add(btnCancel = new SideButton(actCancel)); 148 btnCancel.setFocusable(true); 149 btnCancel.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), "enter"); 150 btnCancel.getActionMap().put("enter",actCancel); 151 152 // -- cancel on ESC 153 getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0), "cancel"); 154 getRootPane().getActionMap().put("cancel", actCancel); 155 156 // -- help button 157 SideButton btnHelp; 158 pnl.add(btnHelp = new SideButton(new ContextSensitiveHelpAction(ht("/Dialog/DownloadDialog")))); 159 btnHelp.setFocusable(true); 160 btnHelp.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), "enter"); 161 btnHelp.getActionMap().put("enter",btnHelp.getAction()); 162 144 163 return pnl; 145 164 } -
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r2308 r2347 3 3 4 4 import java.awt.Component; 5 import java.awt.event.KeyEvent;6 5 import java.util.Locale; 7 6 … … 211 210 * code. Example: /Dialog/RelationEditor is a relative help topic, /De:Help/Dialog/RelationEditor 212 211 * is not. 213 * 214 * 212 * 215 213 * @param component the component the component 216 214 * @param topic the help topic. Set to the default help topic if null. … … 218 216 static public void setHelpContext(JComponent component, String relativeHelpTopic) { 219 217 if (relativeHelpTopic == null) { 220 relativeHelpTopic = ""; 221 } 222 component.getInputMap().put(KeyStroke.getKeyStroke( KeyEvent.VK_F1,0), "help");218 relativeHelpTopic = "/"; 219 } 220 component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F1"), "help"); 223 221 component.getActionMap().put("help", Main.main.menu.help); 224 222 component.putClientProperty("help", relativeHelpTopic);
Note:
See TracChangeset
for help on using the changeset viewer.