[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-ui-dev] Activity and Role changes
|
Can we make the expression to test whether an id is enabled or not more
concise? The only variable is the id string. The fact that it is
matching against a set of enabled activity ids should be encapsulated as
an implementation detail. This would allow for more possibilities for
optimization in the future, in addition to simplifying the calls to the
activity manager.
Also, talking to the activity manager must be done using public API only,
and cannot require casting to internal classes (e.g. Workbench). It's not
just the Workbench that will be doing filtering. E.g. Debug will need to
filter launch configuration types. I realize that this is work in
progress, but in that case we should make the appropriate methods be
public API, but with a comment in their spec stating that they are work in
progress and may change.
I'm thinking of something like:
PlatformUI.getWorkbench().getActivityManager().isEnabledId(string).
(IWorkbench should not have any other API for activity management other
than getActivityManager()).
Thanks,
Nick
Kim Horne/Ottawa/IBM@IBMCA
Sent by: platform-ui-dev-admin@xxxxxxxxxxx
10/16/2003 03:56 PM
Please respond to platform-ui-dev
To: platform-ui-dev@xxxxxxxxxxx
cc:
Subject: [platform-ui-dev] Activity and Role changes
Chris McLaren and I have integrated our separate roles/activities work
this afternoon. As a consequence, the classes some of you are relying on
may have been changed, moved or deleted.
In particular, org.eclipse.ui.internal.roles.RoleManager (and
IDERoleManager) is gone. This was used internally for various role based
work but it also exposed .isEnabledId(String) for determining whether or
not a given ID was active based on matching patterns with the various
activities. Some of you were using this to filter various contributions
and I apologize for the breakage (but it was necessary, I swear). To
accomplish this pattern matching, you used to do the following:
RoleManager.getInstance().isEnabledId(string);
Now you would do the this:
IActivityManager activityManager =
((Workbench)PlatformUI.getWorkbench()).getActivityManager();
activityManager.match(string,
activityManager.getEnabledActivityIds());
.getActivityManager() may eventually be moved into the IWorkbench API at
some point or somewhere else that is equally accessible.
There were of course other changes, particularly in regards to how
activities are activated and deactivated (or enabled and disabled) and how
you go about performing this state change based on pattern matching (as
above). There will be updated proposals and documents shortly but if you
have any questions in the meantime please feel free to ask.