Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Editor is not hidden when disabling activity
Editor is not hidden when disabling activity [message #467327] Thu, 03 May 2007 08:33 Go to next message
Christoph is currently offline ChristophFriend
Messages: 55
Registered: July 2009
Member
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
Re: Editor is not hidden when disabling activity [message #467434 is a reply to message #467327] Thu, 03 May 2007 20:37 Go to previous message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
See reply to earlier post "Activities have no effect"

Paul
Previous Topic:IPackageFragmentRoot
Next Topic:Save Perspective As....Asking To "Paul Keyser"
Goto Forum:
  


Current Time: Tue Apr 16 13:44:56 GMT 2024

Powered by FUDForum. Page generated in 0.14522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top