| Activities based on source variables [message #509219] |
Thu, 21 January 2010 12:14  |
dwain Missing name Messages: 35 Registered: October 2009 |
Member |
|
|
I am attempting to use activities to set when a perspective is enabled or disabled. The activity has an enabled when that uses a source variable to determine if it is enabled or disabled. I have several source variables that could set the perspective to be visible so I am using an 'or' statement in my enabled when to accomplish this. However, it does not seem to be working properly for me, which I am certain is something that I am doing wrong, lol. If I do any one of these alone then it works perfectly. Otherwise it seems to only check the first variable and not bother to check the rest of the variables. So if the variable EMAIL.ADMIN is set to ENABLED, then the perspective shows up. But if EMAIL.ADMIN is not set to ENABLED and EMAIL_DELETE_EMAIL_ADDRESS is set to ENABLED, the perspective is not enabled. Here is what my activity looks like:
<extension point="org.eclipse.ui.activities">
<activity id="com.myExample.plugin.email.activity.emailPerspective" name="Email Perspective">
<enabledWhen>
<or>
<with variable="EMAIL.ADMIN">
<equals value="ENABLED"> </equals>
</with>
<with variable="EMAIL_DELETE_EMAIL_ADDRESS">
<equals value="ENABLED"> </equals>
</with>
<with variable="EMAIL_DELETE_TEMPLATE">
<equals value="ENABLED"> </equals>
</with>
<with variable="EMAIL_FIND_EMAIL_AUDIT">
<equals value="ENABLED"> </equals>
</with>
<with variable="EMAIL_SAVE_TEMPLATE">
<equals value="ENABLED"> </equals>
</with>
<with variable="EMAIL_SAVE_EMAIL_ADDRESS">
<equals value="ENABLED"> </equals>
</with>
<with variable="EMAIL_FIND_TEMPLATES">
<equals value="ENABLED"> </equals>
</with>
<with variable="EMAIL_FIND_EMAIL_ADDRESS">
<equals value="ENABLED"> </equals>
</with>
<with variable="EMAIL_DELETE_AUDIT">
<equals value="ENABLED"> </equals>
</with>
</or>
</enabledWhen>
</activity>
<activityPatternBinding activityId="com.myExample.plugin.email.activity.emailPerspective" pattern="com.myExample.plugin.email/com.myExample.plugin.email.perspective">
</activityPatternBinding>
</extension>
Thanks,
Dwain
|
|
|
|
| Re: Activities based on source variables [message #509280 is a reply to message #509262] |
Thu, 21 January 2010 15:02   |
dwain Missing name Messages: 35 Registered: October 2009 |
Member |
|
|
Thanks for your reply Paul, there are no errors in my log files. I see where it is throwing the error for my undefined source variable now though. Maybe I am going about this the wrong way then. What I am really trying to do is create source variables dynamically. So if a user has a certain role, then when they log in they will get a source variable that can be used to turn certain features on or off. The reason I was looking at using source variables this way was so that I could use an enabledWhen on activities. Is there a way of dynamically declaring source variables, so that I don't have to declare all of my roles when I create the SourceProvider? Is there a way of setting a different WithExpression.class?
Or would it be possible for me to add a new "withNullSetFalse" definition that I could use with enabledWhen?
[Updated on: Thu, 21 January 2010 16:09] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01688 seconds