private Map<String, Expression> expressions = new HashMap<String, Expression>();
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
String delegateShortcutID = (String) args[0];
Expression expr = expressions.get(delegateShortcutID);
if (expr == null) {
expr = createEnablementExpression(delegateShortcutID);
expressions.put(delegateShortcutID, expr);
}
try {
return expr.evaluate(createContext(receiver)) != EvaluationResult.FALSE;
} catch (CoreException ce) {
EclEmmaUIPlugin.log(ce);
return false;
}
}