Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Roles and activities

Unfortunately, the launch configuration type extension point is managed in 
Debug Core, so we can't access the Workbench when we're loading the 
extensions.

This means we'll have to do the pattern matching ourselves. However, I hit 
another problem while implementing this. The activity manager is returning an 
empty set when I asked it for the active activity ids. In the "Activity 
Configuration..." dialog, I have all activities set as active.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=45766

Thanks,
- Jared

> Additionally, there is another way in which you can use this system at a
> slightly higher level.  Instead of comparing your contributions ID against
> the activities directly, you can instead populate an
> IObjectActivityManager with all of your contributions and simply ask it
> for the set of currently enabled contributions.  IObjectActivityManager
> was intended to hide away the pattern matching under the hood.  This would
> go something as follows:
>
> // when you're loading the launch types extension point
> IObjectActivityManager manager =
> workbench.getObjectActivityManager(LAUNCH_CONFIG_EXT_POINT_ID, true);
>
> for (Iterator over launchTypes) {
>         manager.addObject(launchType.ext_pluginID, launchType.ext_localID,
> launchType);
> }
> manager.applyPatternBindings();
>
> // when you need to get the active types
>
> Collection launchTypes = allTypes;
> IObjectActivityManager manager =
> workbench.getObjectActivityManager(LAUNCH_CONFIG_EXT_POINT_ID, false);
>
> if (manager != null) {
>         launchTypes = manager.getActiveObjects();
> }
> show(launchTypes);



Back to the top