public void collectExpressionInfo(ExpressionInfo info) {
   // Although the default variable is passed to the children of this
   // expression as an instance of the adapted type it is OK to only
   // mark a default variable access.
   info.markDefaultVariableAccessed();
   super.collectExpressionInfo(info);
 }
 public static boolean isVisible(MCoreExpression exp, ExpressionContext eContext) {
   Expression ref = null;
   if (exp.getCoreExpression() instanceof Expression) {
     ref = (Expression) exp.getCoreExpression();
   } else {
     ref = new ReferenceExpression(exp.getCoreExpressionId());
     exp.setCoreExpression(ref);
   }
   try {
     // Creates dependency on a predefined value that can be "poked" by the evaluation
     // service
     ExpressionInfo info = ref.computeExpressionInfo();
     String[] names = info.getAccessedPropertyNames();
     for (String name : names) {
       eContext.getVariable(name + ".evaluationServiceLink"); // $NON-NLS-1$
     }
     return ref.evaluate(eContext) != EvaluationResult.FALSE;
   } catch (CoreException e) {
     trace("isVisible exception", e); // $NON-NLS-1$
   }
   return false;
 }
 @Override
 public void collectExpressionInfo(ExpressionInfo info) {
   info.markSystemPropertyAccessed();
 }
 @Override
 public final void collectExpressionInfo(final ExpressionInfo info) {
   super.collectExpressionInfo(info);
   info.markDefaultVariableAccessed();
 }
Пример #5
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.core.expressions.Expression#collectExpressionInfo(org
  * .eclipse.core.expressions.ExpressionInfo)
  */
 public void collectExpressionInfo(ExpressionInfo info) {
   info.addVariableNameAccess(ISources.ACTIVE_PART_ID_NAME);
   info.addVariableNameAccess(ISources.ACTIVE_CURRENT_SELECTION_NAME);
 }
Пример #6
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo)
  */
 public void collectExpressionInfo(ExpressionInfo info) {
   info.addVariableNameAccess("username");
 }