org.openide.loaders 7.16.1

org.openide.awt
Class AcceleratorBinding

java.lang.Object
  extended by org.openide.awt.AcceleratorBinding

public abstract class AcceleratorBinding
extends Object

Permits accelerators to be set on actions based on global registrations. This class is only intended for use from NetBeans infrastructure code: that which either reads shortcut definitions (i.e. the global Keymap); or which loads actions into presenters (e.g. Toolbar).

Since:
org.openide.loaders 7.13

Constructor Summary
protected AcceleratorBinding()
          Subclass constructor.
 
Method Summary
protected abstract  KeyStroke keyStrokeForAction(Action action, FileObject definingFile)
          Finds a keystroke for an action.
static void setAccelerator(Action action, FileObject definingFile)
          Associates an Action.ACCELERATOR_KEY with an action based on a declared shortcut.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcceleratorBinding

protected AcceleratorBinding()
Subclass constructor. Only certain implementations are permitted.

Method Detail

keyStrokeForAction

protected abstract KeyStroke keyStrokeForAction(Action action,
                                                FileObject definingFile)
Finds a keystroke for an action.

Parameters:
action - an action
definingFile - an instance file which defines the action
Returns:
a keystroke or null

setAccelerator

public static void setAccelerator(Action action,
                                  FileObject definingFile)
Associates an Action.ACCELERATOR_KEY with an action based on a declared shortcut. If an instance of AcceleratorBinding can be found in default lookup, it will be used to determine the binding. Otherwise nothing is done.

Parameters:
action - an action defined in layers
definingFile - instance file defining the action

org.openide.loaders 7.16.1

Built on September 7 2010.  |  Portions Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved.