Package org.eclipse.core.expressions

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


  public static void openModel(EObject model)
  {
    IHandlerService handlerService  = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);

        IEvaluationContext context = handlerService.getCurrentState();
        context.addVariable(ActionHelper.ME_TO_OPEN_EVALUATIONCONTEXT_VARIABLE, model);

        try
        {
          context.addVariable(ActionHelper.MECONTEXT_EVALUATIONCONTEXT_VARIABLE, ECPWorkspaceManager.getInstance().getWorkSpace().getProject(model));
            handlerService.executeCommand(ActionHelper.MEEDITOR_OPENMODELELEMENT_COMMAND_ID, null);
View Full Code Here


        IEvaluationContext context = handlerService.getCurrentState();
        context.addVariable(ActionHelper.ME_TO_OPEN_EVALUATIONCONTEXT_VARIABLE, model);

        try
        {
          context.addVariable(ActionHelper.MECONTEXT_EVALUATIONCONTEXT_VARIABLE, ECPWorkspaceManager.getInstance().getWorkSpace().getProject(model));
            handlerService.executeCommand(ActionHelper.MEEDITOR_OPENMODELELEMENT_COMMAND_ID, null);
        }
        catch (ExecutionException e)
        {
          DialogHandler.showExceptionDialog(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) {
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

    IWorkbenchWindow activeWorkbenchWindow = workbench
        .getActiveWorkbenchWindow();
    IHandlerService hsr = CommonUtils.getService(activeWorkbenchWindow, IHandlerService.class);
    IEvaluationContext ctx = hsr.getCurrentState();
    ctx.addVariable(ACTIVE_MENU_SELECTION_NAME, getContext().getSelection());

    return new CommandContributionItem(itemParam);
  }

  @Override
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.