Use multiple Eclipse Activities on the same UI element [message #1738462] |
Wed, 20 July 2016 06:39 |
Alexander Fichtinger Messages: 66 Registered: January 2013 |
Member |
|
|
Hey guys,
we have the following scenario:
We are enabling a certain wizard only when a resource is selected.
Therefore, we have implemented the following activity:
<activity id="activity.enableonresourceselected" name="enableonresourceselected">
<enabledWhen>
<with variable="selection">
<iterate ifEmpty="false">
<or>
<adapt type="org.eclipse.core.resources.IProject">
<test property="org.eclipse.core.resources.open" value="true"/>
</adapt>
<adapt type="org.eclipse.core.resources.IFile"/>
<adapt type="org.eclipse.core.resources.IFolder"/>
</or>
</iterate>
</with>
</enabledWhen>
</activity>
And of course the activityPatternBinding:
<extension point="org.eclipse.ui.activities">
<activityPatternBinding activityId="activity.enableonresourceselected" pattern=".*/ui.wizard.NewInterfaceObjectWizard"/>
</extension>
With this code, the wizard only appears, when a resource is selected, so everythings fine until now...
Now our customer wants to create his own plugin, where he wants to hide the same wizard.
So we are creating a sample plugin for him, where we want to do this.
This is our activity + activityPatternBinding:
<activity id="activity.disabledOnStart" name="disable">
<enabledWhen>
<with variable="true">
<equals value="false"/>
</with>
</enabledWhen>
</activity>
<activityPatternBinding activityId="activity.disabledOnStart" pattern=".*/ui.wizard.NewInterfaceObjectWizard" />
The problem is, that the wizard is still enabled, and it is not hided.
Apparently our activity.enableonresourceselected activity overrules the activity.disabledOnStart.
What happens if two different activities are used on the same UI element?
And what could we do, to achieve the behavior that we want.
Thanks for any help =)
Regards
|
|
|
Re: Use multiple Eclipse Activities on the same UI element [message #1739109 is a reply to message #1738462] |
Wed, 27 July 2016 14:45 |
Eclipse User |
|
|
|
Thee's no way to override expressions. I wondered about including a reference to a defined expression, but a reference to an undefined definition is treated like an undefined variable and causes the expression to be aborted. I think the only solution is to use a systemTest to test a property or define a custom property tester where you can provide some additional logic.
Brian.
|
|
|
Powered by
FUDForum. Page generated in 0.03106 seconds