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 for editors, meaning that views are hidden, but editors are not. I´m spellchecking for ages now, but i can´t find any differences in the way i define the activities and bind views and editors to them.
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 views and the editor 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\.views\.MainAdmin"/>
<activityPatternBinding
activityId="de.gebitms.geplan.core.activity.user"
pattern="de\.gebitms\.geplan\.ui/de\.gebitms\.geplan\.ui\.views\.MainAdmin"/>
<activityPatternBinding
activityId="de.gebitms.geplan.core.activity.admin"
pattern="de\.gebitms\.geplan\.ui/de\.gebitms\.geplan\.ui\.editors\.BasislookuptabellenEditor"/>
</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().setEnabledActivityIds(actSet);
// Reset the Perspective
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();
As i said, this has no effect for the editor, when i switch to the user-activity, the editor 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