255 |
} |
} |
256 |
|
|
257 |
/** |
/** |
258 |
* Sets accelerator for this menu item. |
* Sets the key combination which invokes the menu item's action |
259 |
* |
* listeners without navigating the menu hierarchy. Note that when the |
260 |
|
* keyboard accelerator is typed, it will work whether or not the |
261 |
|
* menu is currently displayed. |
262 |
|
* |
263 |
* @param keystroke accelerator for this menu item. |
* @param keystroke accelerator for this menu item. |
264 |
*/ |
*/ |
265 |
public void setAccelerator(KeyStroke keystroke) |
public void setAccelerator(KeyStroke keystroke) |
279 |
super.configurePropertiesFromAction(action); |
super.configurePropertiesFromAction(action); |
280 |
|
|
281 |
if (! (this instanceof JMenu) && action != null) |
if (! (this instanceof JMenu) && action != null) |
282 |
setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); |
{ |
283 |
|
setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); |
284 |
|
super.registerKeyboardAction(action, accelerator, |
285 |
|
JComponent.WHEN_IN_FOCUSED_WINDOW); |
286 |
|
} |
287 |
} |
} |
288 |
|
|
289 |
/** |
/** |