public final class WorkbenchActivityHelper extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
allowUseOf(ITriggerPoint triggerPoint,
Object object)
Answers whether a given contribution is allowed to be used based on
activity enablement.
|
static boolean |
allowUseOf(Object object)
Deprecated.
|
static String |
createUnifiedId(IPluginContribution contribution)
Utility method to create a
String containing the plugin
and extension ids of a contribution. |
static Set |
expandActivityDependencies(Set baseActivities)
Return the expanded activities for the given activity set.
|
static boolean |
filterItem(Object object)
Answers whether the provided object should be filtered from the UI based
on activity state.
|
static Set |
getActivityIdsForCategory(ICategory category)
Return the activities directly required by a given category.
|
static Set |
getContainedCategories(IActivityManager activityManager,
String categoryId)
Return a list of category ids that are implicitly contained within the
given category.
|
static Set |
getDisabledCategories(IActivityManager activityManager,
String categoryId)
Return a list of category ids that will become implicity disabled if the
given category becomes disabled Note that the set returned by this set
represents the delta of categories that would be enabled - if the
category is already enabled then it is omitted.
|
static Set |
getEnabledCategories(IActivityManager activityManager)
Return the set of enabled categories.
|
static Set |
getEnabledCategories(IActivityManager activityManager,
String categoryId)
Return a list of category ids that will become implicity enabled if the
given category becomes enabled Note that the set returned by this set
represents the delta of categories that would be enabled - if the
category is already enabled then it is omitted.
|
static Set |
getEnabledCategoriesForActivity(IActivityManager activityManager,
String activityId)
Return the number of enabled categories that this activity belongs to.
|
static IIdentifier |
getIdentifier(IPluginContribution contribution)
Return the identifier that maps to the given contribution.
|
static Set |
getPartiallyEnabledCategories(IActivityManager activityManager)
Return the set of partially enabled categories.
|
static Set |
getRequiredActivityIds(String activityId)
Return the activities required for this activity.
|
static boolean |
isEnabled(IActivityManager activityManager,
String categoryId)
Returns whether the given category is enabled.
|
static boolean |
isFiltering()
Returns whether the UI is set up to filter contributions.
|
static boolean |
isPartiallyEnabled(IActivityManager activityManager,
String categoryId)
Returns whether the given category is partially enabled.
|
static ICategory[] |
resolveCategories(IMutableActivityManager activityManager,
Set categoryIds)
Resolve the collection of category ids to an array of
ICategory objects. |
public static IIdentifier getIdentifier(IPluginContribution contribution)
contribution
- the contributionpublic static boolean allowUseOf(Object object)
true
is returned.object
- the contribution to test.allowUseOf(ITriggerPoint, Object)
public static boolean allowUseOf(ITriggerPoint triggerPoint, Object object)
true
is returned.triggerPoint
- the trigger point being hitobject
- the contribution to test.public static final String createUnifiedId(IPluginContribution contribution)
String
containing the plugin
and extension ids of a contribution. This will have the form
pluginId / extensionId. If the IPluginContribution does not define a plugin id then the extension id alone is returned.
contribution
- the contribution to usepublic static final boolean filterItem(Object object)
false
except when the object is
an instance of IPluginContribution
whos unified id matches
an IIdentifier
that is currently disabled.object
- the object to testcreateUnifiedId(IPluginContribution)
public static final boolean isFiltering()
public static Set getEnabledCategories(IActivityManager activityManager, String categoryId)
activityManager
- the activity manager to test againstcategoryId
- the category to be enabledpublic static Set expandActivityDependencies(Set baseActivities)
baseActivities
- the set of activities to expandpublic static Set getRequiredActivityIds(String activityId)
activityId
- the activity idpublic static Set getActivityIdsForCategory(ICategory category)
category
- the categorypublic static Set getDisabledCategories(IActivityManager activityManager, String categoryId)
activityManager
- the activity manager to test againstcategoryId
- the category to be enabledpublic static final Set getContainedCategories(IActivityManager activityManager, String categoryId)
activityManager
- the activity manager to test agaisntcategoryId
- the category to be enabledpublic static Set getEnabledCategories(IActivityManager activityManager)
activityManager
- the activity manager to test againstpublic static Set getPartiallyEnabledCategories(IActivityManager activityManager)
activityManager
- the activity manager to test againstpublic static boolean isPartiallyEnabled(IActivityManager activityManager, String categoryId)
activityManager
- the activity manager to test againstcategoryId
- the category idpublic static Set getEnabledCategoriesForActivity(IActivityManager activityManager, String activityId)
activityManager
- the activity manager to test against *activityId
- the activity id to query onpublic static boolean isEnabled(IActivityManager activityManager, String categoryId)
activityManager
- the activity manager to test againstcategoryId
- the category idpublic static ICategory[] resolveCategories(IMutableActivityManager activityManager, Set categoryIds)
ICategory
objects.activityManager
- the activity manager to test againstcategoryIds
- the category idsICategory
objectsGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.