Activities have no effect [message #467301] |
Wed, 02 May 2007 11:40  |
Eclipse User |
|
|
|
Hello,
i have defined two activities in my rcp-application. I use these to show
respectively hide certain views and editors from the user depending on the
type of user logged in. But when i switch the activity by code it has no
effect, meaning that views, matched to activity A are shown when i switch
to activity B.
Here is how i have declared the activities in my core-plugin:
<extension point="org.eclipse.ui.activities">
<category
description="%geplan.category.activity.description"
id="de.gebitms.geplan.core.category.activity"
name="%geplan.category.activity.name"/>
<activity
description="%geplan.category.activity.admin.description"
id="de.gebitms.geplan.core.activity.admin"
name="%geplan.category.activity.admin.name"/>
<activity
description="%geplan.category.activity.user.description"
id="de.gebitms.geplan.core.activity.user"
name="%geplan.category.activity.user.name"/>
<categoryActivityBinding
activityId="de.gebitms.geplan.core.activity.admin"
categoryId="de.gebitms.geplan.core.category.activity"/>
<categoryActivityBinding
activityId="de.gebitms.geplan.core.activity.user"
categoryId="de.gebitms.geplan.core.category.activity"/>
</extension>
Here is how i match the view to the activities (within another plugin):
<extension point="org.eclipse.ui.activities">
<activityPatternBinding
activityId="de.gebitms.geplan.core.activity.admin"
pattern=" de\.gebitms\.geplan\.ui/de\.gebitms\.geplan\.ui\.editors\.Ba sislookuptabellenEditor "/>
</extension>
And here is how i switch between activities:
HashSet actSet = new HashSet();
// Puts the activity-id in the set, depending on the type of the user
being logged in.
if (UIPlugin.getUser().getArt()==1){
actSet.add("de.gebitms.geplan.core.activity.admin");
}else{
actSet.add("de.gebitms.geplan.core.activity.user");
}
PlatformUI.getWorkbench().getActivitySupport().setEnabledAct ivityIds(actSet);
// Reset the Perspective
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().resetPerspective();
As i said, this has no effect, when i switch to the user-activity, the
view is shown, although i have explicitly matched it only to the
admin-activity.
What am i doing wrong?
Thanks in advance for your time.
Christoph
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03571 seconds