Package org.eclipse.ui
Class ActiveShellExpression
java.lang.Object
org.eclipse.core.expressions.Expression
org.eclipse.ui.ActiveShellExpression
An expression that checks the active shell variable. The variable name is
ISources.ACTIVE_SHELL_NAME and falls back to
ISources.ACTIVE_WORKBENCH_WINDOW. That is, if the active shell
doesn't match, then it will be allowed to match the active workbench window.
- Since:
- 3.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe sources value to use with this expression.Fields inherited from class org.eclipse.core.expressions.Expression
ATT_VALUE, FALSE, HASH_CODE_NOT_COMPUTED, HASH_FACTOR, TRUE -
Constructor Summary
ConstructorsConstructorDescriptionActiveShellExpression(Shell activeShell) Constructs a new instance ofActiveShellExpression -
Method Summary
Modifier and TypeMethodDescriptionvoidExpression information for this expression.protected intMethod to compute the hash code for this object.booleanevaluate(IEvaluationContext context) Evaluates this expression.toString()Methods inherited from class org.eclipse.core.expressions.Expression
computeExpressionInfo, equals, equals, hashCode, hashCode, hashCode
-
Field Details
-
SOURCES
public static final int SOURCESThe sources value to use with this expression.- See Also:
-
-
Constructor Details
-
ActiveShellExpression
Constructs a new instance ofActiveShellExpression- Parameters:
activeShell- The shell to match with the active shell;nullif it will match any active shell.
-
-
Method Details
-
collectExpressionInfo
Expression information for this expression. Namely active shell and active workbench window name.- Overrides:
collectExpressionInfoin classExpression- Parameters:
info- the expression information object used to collect the information- Since:
- 3.2
-
computeHashCode
protected int computeHashCode()Description copied from class:ExpressionMethod to compute the hash code for this object. The result returned from this method in cached in thefHashCodefield. If the value returned from the method equalsExpression.HASH_CODE_NOT_COMPUTED(e.g.-1) then the value is incremented by one.This default implementation calls
super.hashCode()- Overrides:
computeHashCodein classExpression- Returns:
- a hash code for this object.
-
equals
-
evaluate
Evaluates this expression. If the active shell defined by the context matches the shell from this expression, then this evaluates toEvaluationResult.TRUE. Similarly, if the active workbench window shell defined by the context matches the shell from this expression, then this evaluates toEvaluationResult.TRUE.- Specified by:
evaluatein classExpression- Parameters:
context- The context from which the current state is determined; must not benull.- Returns:
EvaluationResult.TRUEif the shell is active;EvaluationResult.FALSEotherwise.
-
toString
-