Package org.eclipse.core.expressions

Examples of org.eclipse.core.expressions.EvaluationContext.addVariable()


    }
  }
 
  private IEvaluationContext createContext(Object selection) {
    IEvaluationContext context = new EvaluationContext(null, selection);
    context.addVariable("selection", selection); //$NON-NLS-1$
    return context;
  }
 
 
  private Expression createEnablementExpression(String delegateShortcutID) {
View Full Code Here


            if (enablement != null) {
                try {
                    IEvaluationContext context = new EvaluationContext(null,
                            object);
                    context.setAllowPluginActivation(true);
                    context.addVariable("selection", object); //$NON-NLS-1$
                    EvaluationResult evalResult = enablement.evaluate(context);
                    if (evalResult == EvaluationResult.FALSE) {
            return false;
          }
                } catch (CoreException e) {
View Full Code Here

    }
  }

  private IEvaluationContext createContext(Object selection) {
    IEvaluationContext context = new EvaluationContext(null, selection);
    context.addVariable("selection", selection); //$NON-NLS-1$
    return context;
  }

  private Expression createEnablementExpression(String delegateShortcutID) {
    IConfigurationElement element = findEnablementConfiguration(delegateShortcutID);
View Full Code Here

    EvaluationContext c = null;
    if (selection != null) {
      c = new EvaluationContext(
          handlerService.createContextSnapshot(false),
          selection.toList());
      c.addVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME, selection);
      c.removeVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
    }
    try {
      if (c != null)
        handlerService.executeCommandInContext(
View Full Code Here

    assertTextEquals(UIText.SwitchToMenu_OtherMenuLabel, items[23]);
  }

  private void mockSelection(ISelection selection) {
    EvaluationContext context = new EvaluationContext(null, new Object());
    context.addVariable(ISources.ACTIVE_MENU_SELECTION_NAME, selection);
    when(handlerService.getCurrentState()).thenReturn(context);
  }

  private MenuItem[] fillMenu() {
    final MenuItem[][] items = new MenuItem[1][];
View Full Code Here

    }
  }

  private IEvaluationContext createContext(Object selection) {
    IEvaluationContext context = new EvaluationContext(null, selection);
    context.addVariable("selection", selection); //$NON-NLS-1$
    return context;
  }

  private Expression createEnablementExpression(String delegateShortcutID) {
    IConfigurationElement element = findEnablementConfiguration(delegateShortcutID);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.