<!ELEMENT extension ((masterOperation | slaveOperation))>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT masterOperation (selectionEnablement)>
<!ATTLIST masterOperation
extendedGenericId CDATA #REQUIRED
operationClass CDATA #IMPLIED
name CDATA #REQUIRED
description CDATA #IMPLIED
populatorClass CDATA #REQUIRED
alwaysExecute (true | false)
overrideId CDATA #IMPLIED
id CDATA #IMPLIED>
A masterOperation enables an existing WTP Operation to be used in a UI action. Generic Ids aggregate a set of masterOperations for the same Abstract action (like a "CUT" operation). WTP Operations are themselves extendible, so for any masterOperation defined, there may be any number of pre|post operations. These pre|post operation can have slaveOperation elements defined which indicate the pre|post operation may be run independently.
<!ELEMENT selectionEnablement (objectClass | or)>
The selectionEnablement element allows you to filter which kinds of selection your object is applicable to using Standard Eclipse Action Expresions.
<!ELEMENT slaveOperation EMPTY>
<!ATTLIST slaveOperation
operationClass CDATA #REQUIRED
name CDATA #REQUIRED
description CDATA #IMPLIED>
The slaveOperation element defines display information for operations which extend a declared master operation. If a pre|post operation of a master does not have a corresponding slaveOperation element, then the pre|post operation will be consider required, and not be displayed to the user.
<!ELEMENT or (objectClass | and | objectState)>
<!ELEMENT objectClass EMPTY>
<!ATTLIST objectClass
name CDATA #IMPLIED
adaptable CDATA #IMPLIED>
<!ELEMENT and (objectClass | or)>
<!ELEMENT objectState EMPTY>
<!ATTLIST objectState
value CDATA #IMPLIED
name CDATA #IMPLIED>
com.acme.ui.operation.MasterOperationA
and com.acme.ui.operation.MasterOperationB
) which are attached to the Generic ID com.acme.ui.WTPOptionalOperationTest
.
The scenario has Master A which has as a pre-operation of Slave A and a post-operation of Slave C. Slave A is made optional by the slaveOperation
element, while Slave C will always be run (no slaveOperation
is given to run it seperately). Slave A further has an optional pre-operation (Slave B) that can be executed indepently of either Slave A or Master A.
For each of the slaveOperations referenced above, you must have a corresponding WTP Operation Extension declared similar to the following:<extension point=
"com.ibm.wtp.common.ui.wtpuiAction"
>
<masterOperation populatorClass=
"com.acme.ui.operation.AcmeOperationPopulator"
name=
"%master_a_name"
operationClass=
"com.acme.ui.operation.MasterOperationA"
extendedGenericId=
"com.acme.ui.WTPOptionalOperationTest"
description=
"%master_a_description"
>
</masterOperation>
<slaveOperation name=
"Slave A"
operationClass=
"com.acme.ui.operation.SlaveOperationA"
>
</slaveOperation>
<slaveOperation name=
"Slave B"
operationClass=
"com.acme.ui.operation.SlaveOperationB"
>
</slaveOperation>
<masterOperation populatorClass=
"com.acme.ui.operation.AcmeOperationPopulator"
name=
"EAR Project Action"
operationClass=
"com.acme.ui.operation.MasterOperationB"
extendedGenericId=
"com.acme.ui.WTPOptionalOperationTest"
>
<selectionEnablement>
<objectState name=
"projectNature"
value=
"org.eclipse.jst.j2ee.EARNature"
/>
</selectionEnablement>
</masterOperation>
</extension>
In general, users extending existing actions only need to declare the following:<extension id=
"wtpuiAciton.Acme.Extensions"
point=
"com.ibm.wtp.common.ExtendableOperation"
>
<extendableOperation class=
"com.acme.ui.operation.MasterOperationA"
id=
"com.acme.ui.operation.MasterOperationA"
>
</extendableOperation>
<extendableOperation class=
"com.acme.ui.operation.SlaveOperationA"
id=
"com.acme.ui.operation.SlaveOperationA"
>
</extendableOperation>
</extension>
<extension point=
"com.ibm.wtp.common.OperationExtension"
>
<!-- Made optional by the above declaration -->
<operationExtension preOperationClass=
"com.acme.ui.operation.SlaveOperationA"
id=
"com.acme.ui.operation.MasterOperationA"
>
</operationExtension>
<!-- Made optional by the above declaration -->
<operationExtension postOperationClass=
"com.acme.ui.operation.SlaveOperationB"
id=
"com.acme.ui.operation.SlaveOperationA"
>
</operationExtension>
<!-- Non-optional operation, will always run -->
<operationExtension postOperationClass=
"com.acme.ui.operation.SlaveOperationC"
id=
"com.acme.ui.operation.MasterOperationA"
>
</operationExtension>
</extension>
And if your operation is optional declare the slaveOperation:<extension point=
"com.ibm.wtp.common.OperationExtension"
>
<!-- The action referenced must be declared as extensible by the com.ibm.wtp.common.ExtendableOperation extension point -->
<operationExtension preOperationClass=
"...YOUR CLASS..."
id=
"...ID OF EXISTING OPERATION..."
>
</operationExtension>
</extension>
<extension point=
"com.ibm.wtp.common.ui.wtpuiAction"
>
<slaveOperation name=
"..NAME OF YOUR OPERATION..."
description=
"...DESCRIPTION OF YOUR ACTION..."
operationClass=
"...YOUR CLASS..."
>
</slaveOperation>
</extension>