|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Tracks focusGained and focusLost events for a Control registered with this service, and provides the control and its registered ID as variables to the application evaluation context for evaluation be the various services.
This service provides 2 variables, activeFocusControl (a Control) and activeFocusControlId (the ID registered with the service).
You can use this service to provide default cut/copy/paste/selectAll for specific text controls outside of the normal workbench part lifecycle, like a control contributed to the trim. For example:
<handler class="org.eclipse.ui.internal.handlers.WidgetMethodHandler:paste" commandId="org.eclipse.ui.edit.paste"> <activeWhen> <with variable="activeFocusControlId"> <equals value="org.eclipse.ui.tests.focusText"/> </with> </activeWhen> </handler>
ISources
Field Summary | |
---|---|
static String |
COPY_HANDLER
Use the value to provide default copy behaviour in a handler element class attribute. |
static String |
CUT_HANDLER
Use the value to provide default cut behaviour in a handler element class attribute. |
static String |
PASTE_HANDLER
Use the value to provide default paste behaviour in a handler element class attribute. |
static String |
SELECT_ALL_HANDLER
Use the value to provide default select all behaviour in a handler element class attribute. |
Method Summary | |
---|---|
void |
addFocusTracker(Control control,
String id)
A Control for which the service will track focus. |
void |
removeFocusTracker(Control control)
No longer track focus events for this control. |
Field Detail |
public static final String COPY_HANDLER
public static final String PASTE_HANDLER
public static final String CUT_HANDLER
public static final String SELECT_ALL_HANDLER
Method Detail |
public void addFocusTracker(Control control, String id)
A control must only be registered once, but different controls can be registered with the same ID. Expressions evaluated against the activeFocusControlId would then be true for all of the controls thus registered.
We will remove ourselves as a listener when the Control is disposed.
control
- the control. Must not be null
. If the control
is already registered with this service this call is a no-op.id
- an ID for this control. Must not be null
.public void removeFocusTracker(Control control)
control
- the control registered with the service. Must not be
null
.
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.