public final class WorkbenchActivityHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TRIGGER_PRE_UI_POINT
The ID of the trigger point that only returns activities with core
expressions.
|
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 Object[] |
filterArray(Object[] array)
Returns an array with those objects of the argument array that pass the
filterItem(Object) test. |
static Collection |
filterCollection(Collection toBeFiltered,
Collection result)
Fills and returns the second argument with those objects of the first
argument that pass the
filterItem(Object) test. |
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. |
static Object[] |
restrictArray(Object[] array)
Returns an array with those objects of the argument array that pass the
restrictUseOf(Object) test. |
static Collection |
restrictCollection(Collection toBeFiltered,
Collection result)
Fills and returns the second argument with those objects of the first
argument that pass the
restrictUseOf(Object) test. |
static boolean |
restrictUseOf(Object object)
Restrict the use of the object only if it is matched by an activity with
a core expression.
|
public static final String TRIGGER_PRE_UI_POINT
public static IIdentifier getIdentifier(IPluginContribution contribution)
contribution
- the contribution@Deprecated public 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 boolean restrictUseOf(Object object)
object
- the object to restricttrue
if this object is matched by a disabled
activity with an expression.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
objectspublic static Collection restrictCollection(Collection toBeFiltered, Collection result)
restrictUseOf(Object)
test.toBeFiltered
- the input collectionresult
- the collection to which objects passing the test should be addedresult
collection for conveniencepublic static Object[] restrictArray(Object[] array)
restrictUseOf(Object)
test.array
- the input arraypublic static Collection filterCollection(Collection toBeFiltered, Collection result)
filterItem(Object)
test.toBeFiltered
- the input collectionresult
- the collection to which objects passing the test should be addedresult
collection for conveniencepublic static Object[] filterArray(Object[] array)
filterItem(Object)
test.array
- the input array
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.