private void openSchemaFile(final IFile file) {
    final IWorkbenchWindow ww = PDEPlugin.getActiveWorkbenchWindow();

    Display d = ww.getShell().getDisplay();
    d.asyncExec(
        new Runnable() {
          @Override
          public void run() {
            try {
              String editorId = IPDEUIConstants.SCHEMA_EDITOR_ID;
              ww.getActivePage().openEditor(new FileEditorInput(file), editorId);
            } catch (PartInitException e) {
              PDEPlugin.logException(e);
            }
          }
        });
  }
Beispiel #2
0
  protected void runSootAsProcess(String cmd) {

    SootProcessRunner op;
    try {
      newProcessStarting();
      op = new SootProcessRunner(Display.getCurrent(), cmd, sootClasspath);

      if (window == null) {
        window = SootPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
      }
      new ProgressMonitorDialog(window.getShell()).run(true, true, op);

    } catch (InvocationTargetException e1) {
      // handle exception
    } catch (InterruptedException e2) {
      // handle cancelation
      System.out.println(e2.getMessage());
    }
  }