Package org.eclipse.core.expressions

Examples of org.eclipse.core.expressions.EvaluationContext


   */
  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    System.out.println("=> Running PPDevDebug...(");

    EvaluationContext ctx = (EvaluationContext) event.getApplicationContext();
    String pluginid = PPActivator.getInstance().getBundle().getSymbolicName();
    Object editor = ctx.getVariable("activeEditor");
    if(editor == null || !(editor instanceof XtextEditor)) {
      return new Status(IStatus.ERROR, pluginid, "Handler invoked on wrong type of editor: XtextEditor");
    }
    XtextEditor xtextEditor = (XtextEditor) editor;
    IXtextDocument xtextDocument = XtextDocumentUtil.get(xtextEditor);
View Full Code Here


  }

  public Object execute(ExecutionEvent event) throws ExecutionException {
    try {
      EvaluationContext context = (EvaluationContext) event.getApplicationContext();
      IFile xmlFile = getFile(context);
      if (BeansCoreUtils.isBeansConfig(xmlFile)) {
        EditorPart editor = (EditorPart) (context.getParent().getVariable("activePart"));
        NamespaceConfigWizard namespaceWizard = new NamespaceConfigWizard(xmlFile, editor);
        WizardDialog wizardDialog = new WizardDialog(Display.getDefault().getActiveShell(), namespaceWizard);
        wizardDialog.setBlockOnOpen(true);
        wizardDialog.create();
        wizardDialog.open();
View Full Code Here

    }
  }

  private IFile getFile(Object evaluationContext) {
    if (evaluationContext instanceof EvaluationContext) {
      EvaluationContext context = (EvaluationContext) evaluationContext;
      Object activePart = context.getParent().getVariable("activePart");
      if (activePart instanceof EditorPart) {
        EditorPart editor = (EditorPart) activePart;
        IEditorInput editorInput = editor.getEditorInput();
        if (editorInput instanceof FileEditorInput) {
          return ((FileEditorInput) editor.getEditorInput()).getFile();
View Full Code Here

TOP

Related Classes of org.eclipse.core.expressions.EvaluationContext

Copyright © 2018 www.massapicom. 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.