blob: 42df385a27f0088386f015cd7036fa525f828a26 [file] [log] [blame]
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.5 [en] (WinNT; I) [Netscape]">
<title>Eclipse Workbench Extension Point: Action Sets</title>
</head>
<body link="#0000FF" vlink="#800080">
<center>
<h1>
Expressions</h1></center>
<b><i>Description: </i></b>Boolean expressions are used to define the visibility
and enablement for many action extensions within the workbench.&nbsp; For
instance, an <i>enablement</i> element can be defined within any action
extension.&nbsp; This element contains a boolean expression defining the
enablement criteria for the action.&nbsp; A <i>visibility</i> element can
be defined for a popup menu action extension.&nbsp; This element contains
a boolean expression defining the visibility criteria for the action.
<p>Regardless of where the boolean expression is found, the syntax of the
expression will follow the same form.&nbsp; The root element for enablement
and visibility must contain one sub element.&nbsp; In the simplest case,
this will consist of an <i>objectClass</i>, <i>objectState</i>, <i>systemProperty</i>,
or <i>pluginState</i> element.&nbsp; In the more complex case, <i>and</i>,
<i>or</i>, not elements can be combined to form a boolean expression.&nbsp;
An <i>and</i> or <i>or</i> element may contain 1 or more sub elements.&nbsp;
A <i>not</i> element must contain only 1 sub element.
<p>An <i>objectClass</i> element is used to evaluate the class of each
object in the selection.&nbsp; The name attribute of the objectClass contains
a fully qualified class name.&nbsp; If each object in the selection implements
this class, the expression is evaluated as true.
<p>An <i>objectState</i> element is used to evaluate the state of each
object in the selection.&nbsp; In most situations, the enablement or visibility
of an action can be determined by selection type.&nbsp; In other situations
this is not enough, and enablement or visibility must be determined using
the selection state.&nbsp; For instance, you may contribute an action for
all objects of type <tt>IFile</tt> which are read only. This read only
criteria can only be declared by specifying an <i>objectState</i> element.&nbsp;
It may have the following form ..
<br>&nbsp;
<blockquote><tt>&lt;objectState name="readOnly" value="true"/></tt></blockquote>
In the workbench, the evaluation of this expression is very difficult to
accomplish, because the attributes of an object are type specific, and
beyond the domain of the workbench itself.&nbsp; So the workbench will
collaborate with the objects in the selection to evaluate the expression.&nbsp;
This is done using an <tt>IActionFilter</tt>, an evaluation strategy for
<i>objectState</i> elements.&nbsp; When an objectState element is evaluated,
the workbench ask each object in the selection for an <tt>IActionFilter</tt>.&nbsp;
It does this by testing to see if it implements <tt>IActionFilter</tt>.&nbsp;
If that fails, the workbench will ask for a filter through through the
<tt>IAdaptable</tt> mechanism.&nbsp; If a filter is found, the workbench
will pass the <i>objectState</i> attributes to the filter to determine
if they match the state of the selected object.&nbsp; If so, the term is
evaluated as true.&nbsp; If there is no action filter, or there is no match,
the term is evaluated as false.
<p>View and editors are encouraged to define an <tt>IActionFilter</tt>
for each object in their selection.&nbsp; This makes it easier for other
plugin developers to extend those views or editors with new, well qualified
actions.
<p>A <i>systemProperty</i> element is used to evaluate the state of some
system property.&nbsp; Under the covers, the value of the system property
is determined by invoking System.getProperty.
<p>A <i>pluginState</i> element is used to evaluate the state of a plugin.&nbsp;
The state of the plugin may be installed or activated.
<p><b><i>Configuration Markup:</i></b>
<p><tt>&nbsp;&nbsp; &lt;!ELEMENT visibility (and | or | not | objectClass
| objectState | systemProperty</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | pluginState)></tt><tt></tt>
<p><tt>&nbsp;&nbsp; &lt;!ELEMENT enablement (and | or | not | objectClass
| objectState | systemProperty</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | pluginState)></tt><tt></tt>
<p><tt>&nbsp;&nbsp; &lt;!ELEMENT and (and | or | not | objectClass | objectState
| systemProperty | pluginState)*></tt><tt></tt>
<p><tt>&nbsp;&nbsp; &lt;!ELEMENT or (and | or | not | objectClass | objectState
| systemProperty | pluginState)*></tt><tt></tt>
<p><tt>&nbsp;&nbsp; &lt;!ELEMENT not (and | or | not | objectClass | objectState
| systemProperty | pluginState)></tt><tt></tt>
<p><tt>&nbsp;&nbsp; &lt;!ELEMENT objectClass EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST objectClass</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>name</b> - a fully qualified name of a class.&nbsp; The expression is
evaluated as true only if the selection implement this class.</li>
</ul>
<tt>&nbsp;&nbsp; &lt;!ELEMENT objectState EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST objectState</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>name </b>- the name of an object attribute.&nbsp; Acceptable values
for this string reflect the object type, and should be publicly declared
by the plugin where the object type is declared.</li>
<li>
<b>value</b> - the required value of the object attribute.&nbsp; The acceptable
values for the object attribute should be publicly declared.</li>
</ul>
<tt>&nbsp;&nbsp; &lt;!ELEMENT systemProperty EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST systemProperty</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>name </b>- the name of the system property.</li>
<li>
<b>value</b> - the required value of the system property.</li>
</ul>
<tt>&nbsp;&nbsp; &lt;!ELEMENT pluginState EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST pluginState</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(installed | activated)</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<blockquote>
<li>
<b>id </b>- an id of a plugin which may or may not be registered in the
plug-in registry.</li>
<li>
<b>value</b> - the required state of the plugin.&nbsp; Currently two states
are supported: installed and activated.</li>
</blockquote>
<b><i>Examples:</i></b>
<p>The following is an example of an action set which uses the enablement
element.&nbsp; The action set declares a menu with the label List Element,
and then populates it with actions which are enabled by a selection of
<tt>ListElements</tt> with various state.&nbsp; A <tt>ListElement</tt>
has two attributes: <i>name</i> (a string) and <i>flag</i> (a boolean).&nbsp;
In this example, the All action (<img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_a.jpg" height=13 width=24 align=ABSCENTER>)
is enabled whenever a ListElement is selected.&nbsp; The Red action (<img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_b.jpg" height=13 width=24 align=ABSCENTER>)
is enabled when a ListElement with name = red is selected.&nbsp; And the
Not Red action (<img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_c.jpg" height=13 width=24 align=ABSCENTER>)
is enabled when a ListElement with name != red is selected.
<blockquote><tt>&lt;extension point = "org.eclipse.ui.actionSets"></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;actionSet id="org.eclipse.ui.tests.internal.ListElementActions"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label="List Element"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;menu id="org.eclipse.ui.tests.internal.ListElementMenu"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="List Element"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
path="additions"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;separator name="group1"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/menu></tt>
<br><img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_a.jpg" height=13 width=24 align=ABSCENTER><tt>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;action id="org.eclipse.ui.tests.internal.ac1"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="All"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.eclipse.ui.tests.api.MockActionDelegate"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
enablesFor="1"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;objectClass name="org.eclipse.ui.tests.api.ListElement"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/action></tt>
<br><img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_b.jpg" height=13 width=24 align=ABSCENTER><tt>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;action id="org.eclipse.ui.tests.internal.ac2"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="Red"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.eclipse.ui.tests.api.MockActionDelegate"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
enablesFor="1"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;and></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;objectClass name="org.eclipse.ui.tests.api.ListElement"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;objectState name="name" value="red"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/and></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/action></tt>
<br><img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_c.jpg" height=13 width=24 align=ABSCENTER><tt>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;action id="org.eclipse.ui.tests.internal.ac3"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="Not Red"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.eclipse.ui.tests.api.MockActionDelegate"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
enablesFor="1"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;and></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;objectClass name="org.eclipse.ui.tests.api.ListElement"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;not></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;objectState name="name" value="red"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/not></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/and></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/action></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;/actionSet></tt>
<br><tt>&lt;/extension></tt></blockquote>
In the next example the <i>pluginState</i> element is used to control the
enablement of actions in an action set.&nbsp; The Installed action (<img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_a.jpg" height=13 width=24 align=ABSCENTER>)
is enabled when the plugin with <tt>x.y.z.myPlugin</tt> is installed.&nbsp;
The Activated action (<img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_b.jpg" height=13 width=24 align=ABSCENTER>)
is enabled when the same plugin has been activated.
<blockquote><tt>&lt;extension point = "org.eclipse.ui.actionSets"></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;actionSet id="org.eclipse.ui.tests.internal.ListElementActions"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label="List Element"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;menu id="org.eclipse.ui.tests.internal.ListElementMenu"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="List Element"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
path="additions"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;separator name="group1"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/menu></tt>
<br><img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_a.jpg" height=13 width=24 align=ABSCENTER><tt>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;action id="org.eclipse.ui.tests.internal.ac8"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="Installed"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.eclipse.ui.tests.api.MockActionDelegate"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;pluginState id="x.y.z.myPlugin" value="installed"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/action></tt>
<br><img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_b.jpg" height=13 width=24 align=ABSCENTER><tt>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;action id="org.eclipse.ui.tests.internal.ac10"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="Activated"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.eclipse.ui.tests.api.MockActionDelegate"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;pluginState id="x.y.z.myPlugin" value="activated"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/action></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;/actionSet></tt>
<br><tt>&lt;/extension></tt></blockquote>
In the next example the systemProperty element is demonstrated.&nbsp; The
System Property action (<img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_a.jpg" height=13 width=24 align=ABSCENTER>)
is enabled when the ActionExpressionVar system property is equal to "bubba".
<blockquote><tt>&lt;extension point = "org.eclipse.ui.actionSets"></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;actionSet id="org.eclipse.ui.tests.internal.ListElementActions"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label="List Element"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;menu id="org.eclipse.ui.tests.internal.ListElementMenu"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="List Element"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
path="additions"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;separator name="group1"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/menu></tt>
<br><img SRC="../../org.eclipse.ui.articles.guidelines/doc/images/tag_a.jpg" height=13 width=24 align=ABSCENTER><tt>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;action id="org.eclipse.ui.tests.internal.ac11"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
label="System Property"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.eclipse.ui.tests.api.MockActionDelegate"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;systemProperty name="ActionExpressionVar" value="bubba"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/enablement></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/action></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;/actionSet></tt>
<br><tt>&lt;/extension></tt></blockquote>
Here is one final example, which demonstrates the declaration of visibility
for a popup menu action extension.&nbsp; The Red and True action is visible
whenever a <tt>ListElement</tt> is selected with <i>name = red</i> and
<i>flag = true</i>.
<blockquote><tt>&lt;extension point="org.eclipse.ui.popupMenus"></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;objectContribution id="oc6"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objectClass="org.eclipse.ui.tests.api.ListElement"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;visibility></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;and></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;objectState name="name" value="red"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;objectState name="flag" value="true"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/and></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/visibility></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action id="oc4" label="Red And
True"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="org.eclipse.ui.tests.api.MockActionDelegate"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;/objectContribution></tt>
<br><tt>&lt;/extension></tt></blockquote>
<p><br><b><i>Supplied Implementation:</i></b> For convenience, action filters
have been defined for markers, resources, and projects.&nbsp; The name-value
pairs for each are declared on <tt>IMarkerActionFilter</tt>, <tt>IResourceActionFilter</tt>,
and <tt>IProjectActionFilter</tt>.
<br>&nbsp;
<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
</body>
</html>