Package org.eclipse.ui.internal
Class ActionExpression
java.lang.Object
org.eclipse.ui.internal.ActionExpression
An ActionExpression is used to evaluate the enablement / visibility criteria
 for an action.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringConstant definition for AND.static final StringConstant definition for NOT.static final StringConstant definition for objectClass.static final StringConstant definition for objectState.static final StringConstant definition for OR.static final StringConstant definition for pluginState.static final StringConstant definition for systemProperty.
- 
Constructor SummaryConstructorsConstructorDescriptionActionExpression(String expressionType, String expressionValue) Create an instance of the receiver with the given expression type and value.ActionExpression(IConfigurationElement element) Creates an action expression for the given configuration element.
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanString[]Extract the object class test from the expression.final inthashCode()Computes the hash code for this object based on the id.booleanisEnabledFor(Object object) Returns whether the expression is valid for the given object.booleanisEnabledFor(IStructuredSelection selection) Returns whether the expression is valid for all elements of the given selection.booleanisEnabledForExpression(Object object, String expressionType) Returns whether or not the receiver is potentially valid for the object via just the extension type.valuesForExpression(String expressionType) Return the values of the expression type that the receiver is enabled for.
- 
Field Details- 
EXP_TYPE_ANDConstant definition for AND.- See Also:
 
- 
EXP_TYPE_NOTConstant definition for NOT.- See Also:
 
- 
EXP_TYPE_OBJECT_CLASSConstant definition for objectClass.- See Also:
 
- 
EXP_TYPE_OBJECT_STATEConstant definition for objectState.- See Also:
 
- 
EXP_TYPE_ORConstant definition for OR.- See Also:
 
- 
EXP_TYPE_PLUG_IN_STATEConstant definition for pluginState.- See Also:
 
- 
EXP_TYPE_SYSTEM_PROPERTYConstant definition for systemProperty.- See Also:
 
 
- 
- 
Constructor Details- 
ActionExpressionCreates an action expression for the given configuration element.- Parameters:
- element- The element to build the expression from.
 
- 
ActionExpressionCreate an instance of the receiver with the given expression type and value. Currently the only supported expression type isEXP_TYPE_OBJECT_CLASS.- Parameters:
- expressionType- The expression constant we are creating an instance of.
- expressionValue- The name of the class we are creating an expression for.
 
 
- 
- 
Method Details- 
equals
- 
extractObjectClassesExtract the object class test from the expression. This allows clients (e.g. the decorator manager) to handle object class testing in a more optimized way. This method removes the objectClass test from the expression and returns the object class. The expression is not changed and anullis returned if no object class is found.- Returns:
- the object class or nullif none was found.
 
- 
hashCodepublic final int hashCode()Computes the hash code for this object based on the id.
- 
isEnabledForReturns whether the expression is valid for all elements of the given selection.- Parameters:
- selection- the structured selection to use
- Returns:
- boolean whether the expression is valid for the selection.
 
- 
isEnabledForReturns whether the expression is valid for the given object.- Parameters:
- object- the object to validate against (can be- null)
- Returns:
- boolean whether the expression is valid for the object.
 
- 
isEnabledForExpressionReturns whether or not the receiver is potentially valid for the object via just the extension type. Currently the only supported expression type isEXP_TYPE_OBJECT_CLASS.- Parameters:
- object- the object to validate against (can be- null)
- expressionType- the expression type to consider
- Returns:
- boolean whether the expression is potentially valid for the object.
 
- 
valuesForExpressionReturn the values of the expression type that the receiver is enabled for. If the receiver is not enabled for the expressionType then returnnull.- Parameters:
- expressionType- the expression type to consider
- Returns:
- Collection if there are values for this expression or
         nullif this is not possible in the receiver or any of it's children
 
 
-