| java.lang.Object org.eclipse.ui.internal.keys.WorkbenchKeyboard
WorkbenchKeyboard | final public class WorkbenchKeyboard (Code) | |
Controls the keyboard input into the workbench key binding architecture. This
allows key events to be programmatically pushed into the key binding
architecture -- potentially triggering the execution of commands. It is used
by the Workbench to listen for events on the
Display .
This class is not designed to be thread-safe. It is assumed that all access
to the press method is done through the event loop. Accessing
this method outside the event loop can cause corruption of internal state.
since: 3.0 |
Inner Class :final public class KeyDownFilter implements Listener | |
Field Summary | |
static KeySequence | outOfOrderKeys The collection of keys that are to be processed out-of-order. |
Constructor Summary | |
public | WorkbenchKeyboard(Workbench associatedWorkbench) Constructs a new instance of WorkbenchKeyboard associated
with a particular workbench. |
Method Summary | |
final boolean | executeCommand(Binding binding, Event trigger) Performs the actual execution of the command by looking up the current
handler from the command manager. | public static List | generatePossibleKeyStrokes(Event event) Generates any key strokes that are near matches to the given event. | final KeySequence | getBuffer() | public KeyDownFilter | getKeyDownFilter() An accessor for the filter that processes key down and traverse events on
the display. | final void | logException(CommandException e, ParameterizedCommand command) Logs the given exception, and opens a dialog explaining the failure. | final public void | openKeyAssistShell(Collection bindings) Opens the key assist dialog to offer the user the choice of a binding to
pick from the collection of bindings. | final public void | openMultiKeyAssistShell() Opens a KeyAssistDialog to assist the user in completing a
multi-stroke key binding. | public boolean | press(List potentialKeyStrokes, Event event) Processes a key press with respect to the key binding architecture. | void | processKeyEvent(List keyStrokes, Event event)
Actually performs the processing of the key event by interacting with the
ICommandManager . |
outOfOrderKeys | static KeySequence outOfOrderKeys(Code) | | The collection of keys that are to be processed out-of-order.
|
WorkbenchKeyboard | public WorkbenchKeyboard(Workbench associatedWorkbench)(Code) | | Constructs a new instance of WorkbenchKeyboard associated
with a particular workbench.
Parameters: associatedWorkbench - The workbench with which this keyboard interface should work;must not be null . since: 3.1 |
executeCommand | final boolean executeCommand(Binding binding, Event trigger) throws CommandException(Code) | | Performs the actual execution of the command by looking up the current
handler from the command manager. If there is a handler and it is
enabled, then it tries the actual execution. Execution failures are
logged. When this method completes, the key binding state is reset.
Parameters: binding - The binding that should be executed; should not benull . Parameters: trigger - The triggering event; may be null . true if there was a handler; false otherwise. throws: CommandException - if the handler does not complete execution for some reason.It is up to the caller of this method to decide whether tolog the message, display a dialog, or ignore this exceptionentirely. |
generatePossibleKeyStrokes | public static List generatePossibleKeyStrokes(Event event)(Code) | | Generates any key strokes that are near matches to the given event. The
first such key stroke is always the exactly matching key stroke.
Parameters: event - The event from which the key strokes should be generated; mustnot be null . The set of nearly matching key strokes. It is nevernull , but may be empty. |
getBuffer | final KeySequence getBuffer()(Code) | | |
getKeyDownFilter | public KeyDownFilter getKeyDownFilter()(Code) | | An accessor for the filter that processes key down and traverse events on
the display.
The global key down and traverse filter; never null . |
logException | final void logException(CommandException e, ParameterizedCommand command)(Code) | | Logs the given exception, and opens a dialog explaining the failure.
Parameters: e - The exception to log; must not be null . Parameters: command - The parameterized command for the binding to execute; may benull . |
openKeyAssistShell | final public void openKeyAssistShell(Collection bindings)(Code) | | Opens the key assist dialog to offer the user the choice of a binding to
pick from the collection of bindings.
Parameters: bindings - a collection of Binding objects since: 3.3 |
openMultiKeyAssistShell | final public void openMultiKeyAssistShell()(Code) | | Opens a KeyAssistDialog to assist the user in completing a
multi-stroke key binding. This method lazily creates a
keyAssistDialog and shares it between executions.
|
press | public boolean press(List potentialKeyStrokes, Event event)(Code) | | Processes a key press with respect to the key binding architecture. This
updates the mode of the command manager, and runs the current handler for
the command that matches the key sequence, if any.
Parameters: potentialKeyStrokes - The key strokes that could potentially match, in the order ofpriority; must not be null . Parameters: event - The event; may be null . true if a command is executed; false otherwise. |
processKeyEvent | void processKeyEvent(List keyStrokes, Event event)(Code) | |
Actually performs the processing of the key event by interacting with the
ICommandManager . If work is carried out, then the event
is stopped here (i.e., event.doit = false ). It does not
do any processing if there are no matching key strokes.
If the active Shell is not the same as the one to which
the state is associated, then a reset occurs.
Parameters: keyStrokes - The set of all possible matching key strokes; must not benull . Parameters: event - The event to process; must not be null . |
|
|