Examples of expressions in enabledWhen/activeWhen elements [message #305259] |
Tue, 27 June 2006 12:27  |
Eclipse User |
|
|
|
Originally posted by: jai_shirole123.rediffmail.com
I'm trying to learn/practice the org.eclipse.ui.commands concept.
I've defined a handler for my command.
I want my handler to be active only when one of the specified workbench
parts is active. i.e.if Editor A or ViewPart B or ViewPart C is active.
This means, when I extend org.eclipse.ui.handlers extension point, I have
to form an OR expression for "activeWhen" element.
The help documentation mentions following:
"The workbench provides some variables that these expressions can rely on.
The variables supported are: the active contexts, the active editor, the
"active part" and the current selection. While not supported in this
initial design, it is easy to see how it would be possible to add other
variables or even allow plug-in developers to contribute other variables."
So, how do I have to formulate the expression for my requirement?
A sample from Help doc:
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="commandId"
class="org.eclipse.Handler">
<enabledWhen>
<with variable="context">
<property
id="id"
value="debugging" />
</with>
</enabledWhen>
</handler>
</extension>
Thanks,
J@y
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06941 seconds