|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.activities.WorkbenchActivityHelper
public final class WorkbenchActivityHelper
A utility class that contains helpful methods for interacting with the activities API.
Field Summary | |
---|---|
static java.lang.String |
TRIGGER_PRE_UI_POINT
The ID of the trigger point that only returns activities with core expressions. |
Method Summary | |
---|---|
static boolean |
allowUseOf(ITriggerPoint triggerPoint,
java.lang.Object object)
Answers whether a given contribution is allowed to be used based on activity enablement. |
static boolean |
allowUseOf(java.lang.Object object)
Deprecated. |
static java.lang.String |
createUnifiedId(IPluginContribution contribution)
Utility method to create a String containing the plugin
and extension ids of a contribution. |
static java.util.Set |
expandActivityDependencies(java.util.Set baseActivities)
Return the expanded activities for the given activity set. |
static java.lang.Object[] |
filterArray(java.lang.Object[] array)
Returns an array with those objects of the argument array that pass the filterItem(Object) test. |
static java.util.Collection |
filterCollection(java.util.Collection toBeFiltered,
java.util.Collection result)
Fills and returns the second argument with those objects of the first argument that pass the filterItem(Object) test. |
static boolean |
filterItem(java.lang.Object object)
Answers whether the provided object should be filtered from the UI based on activity state. |
static java.util.Set |
getActivityIdsForCategory(ICategory category)
Return the activities directly required by a given category. |
static java.util.Set |
getContainedCategories(IActivityManager activityManager,
java.lang.String categoryId)
Return a list of category ids that are implicitly contained within the given category. |
static java.util.Set |
getDisabledCategories(IActivityManager activityManager,
java.lang.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 java.util.Set |
getEnabledCategories(IActivityManager activityManager)
Return the set of enabled categories. |
static java.util.Set |
getEnabledCategories(IActivityManager activityManager,
java.lang.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 java.util.Set |
getEnabledCategoriesForActivity(IActivityManager activityManager,
java.lang.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 java.util.Set |
getPartiallyEnabledCategories(IActivityManager activityManager)
Return the set of partially enabled categories. |
static java.util.Set |
getRequiredActivityIds(java.lang.String activityId)
Return the activities required for this activity. |
static boolean |
isEnabled(IActivityManager activityManager,
java.lang.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,
java.lang.String categoryId)
Returns whether the given category is partially enabled. |
static ICategory[] |
resolveCategories(IMutableActivityManager activityManager,
java.util.Set categoryIds)
Resolve the collection of category ids to an array of ICategory objects. |
static java.lang.Object[] |
restrictArray(java.lang.Object[] array)
Returns an array with those objects of the argument array that pass the restrictUseOf(Object) test. |
static java.util.Collection |
restrictCollection(java.util.Collection toBeFiltered,
java.util.Collection result)
Fills and returns the second argument with those objects of the first argument that pass the restrictUseOf(Object) test. |
static boolean |
restrictUseOf(java.lang.Object object)
Restrict the use of the object only if it is matched by an activity with a core expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TRIGGER_PRE_UI_POINT
Method Detail |
---|
public static IIdentifier getIdentifier(IPluginContribution contribution)
contribution
- the contribution
public static boolean allowUseOf(java.lang.Object object)
true
is returned.
object
- the contribution to test.
allowUseOf(ITriggerPoint, Object)
public static boolean allowUseOf(ITriggerPoint triggerPoint, java.lang.Object object)
true
is returned.
triggerPoint
- the trigger point being hitobject
- the contribution to test.
public static boolean restrictUseOf(java.lang.Object object)
object
- the object to restrict
true
if this object is matched by a disabled
activity with an expression.public static final java.lang.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 use
public static final boolean filterItem(java.lang.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 test
createUnifiedId(IPluginContribution)
public static final boolean isFiltering()
public static java.util.Set getEnabledCategories(IActivityManager activityManager, java.lang.String categoryId)
activityManager
- the activity manager to test againstcategoryId
- the category to be enabled
public static java.util.Set expandActivityDependencies(java.util.Set baseActivities)
baseActivities
- the set of activities to expand
public static java.util.Set getRequiredActivityIds(java.lang.String activityId)
activityId
- the activity id
public static java.util.Set getActivityIdsForCategory(ICategory category)
category
- the category
public static java.util.Set getDisabledCategories(IActivityManager activityManager, java.lang.String categoryId)
activityManager
- the activity manager to test againstcategoryId
- the category to be enabled
public static final java.util.Set getContainedCategories(IActivityManager activityManager, java.lang.String categoryId)
activityManager
- the activity manager to test agaisntcategoryId
- the category to be enabled
public static java.util.Set getEnabledCategories(IActivityManager activityManager)
activityManager
- the activity manager to test against
public static java.util.Set getPartiallyEnabledCategories(IActivityManager activityManager)
activityManager
- the activity manager to test against
public static boolean isPartiallyEnabled(IActivityManager activityManager, java.lang.String categoryId)
activityManager
- the activity manager to test againstcategoryId
- the category id
public static java.util.Set getEnabledCategoriesForActivity(IActivityManager activityManager, java.lang.String activityId)
activityManager
- the activity manager to test against *activityId
- the activity id to query on
public static boolean isEnabled(IActivityManager activityManager, java.lang.String categoryId)
activityManager
- the activity manager to test againstcategoryId
- the category id
public static ICategory[] resolveCategories(IMutableActivityManager activityManager, java.util.Set categoryIds)
ICategory
objects.
activityManager
- the activity manager to test againstcategoryIds
- the category ids
ICategory
objectspublic static java.util.Collection restrictCollection(java.util.Collection toBeFiltered, java.util.Collection result)
restrictUseOf(Object)
test.
toBeFiltered
- the input collectionresult
- the collection to which objects passing the test should be added
result
collection for conveniencepublic static java.lang.Object[] restrictArray(java.lang.Object[] array)
restrictUseOf(Object)
test.
array
- the input array
public static java.util.Collection filterCollection(java.util.Collection toBeFiltered, java.util.Collection result)
filterItem(Object)
test.
toBeFiltered
- the input collectionresult
- the collection to which objects passing the test should be added
result
collection for conveniencepublic static java.lang.Object[] filterArray(java.lang.Object[] array)
filterItem(Object)
test.
array
- the input array
|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.