Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorPart.doSave()


                            if (MessageDialog.openQuestion(
                                shell,
                                "Save File",
                                "The file contents must be saved before the command can be executed. Do you wish to save now?"))
                            {
                                editorPart.doSave(monitor);
                            }
                            else
                            {
                                throw new InterruptedException();
                            }
View Full Code Here


  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IEditorPart editor = HandlerUtil.getActiveEditor(event);
    if (editor != null && editor.getEditorInput() instanceof FileEditorInput) {
      if (editor.isDirty()) {
        editor.doSave(null);
      }
      IFile editedFile = ((FileEditorInput) editor.getEditorInput()).getFile();
      scheduleJob(editedFile, true);
    }
    return null;
View Full Code Here

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IEditorPart editor = HandlerUtil.getActiveEditor(event);
    if (editor != null && editor.getEditorInput() instanceof FileEditorInput) {
      if (editor.isDirty()) {
        editor.doSave(null);
      }
      IFile editedFile = ((FileEditorInput) editor.getEditorInput()).getFile();
      scheduleJob(editedFile, true);
    }
    return null;
View Full Code Here

     * @see IEditorPart#doSave(IProgressMonitor)
     */
    public void doSave(IProgressMonitor monitor) {
        for (int i = 0; i < innerEditors.length; i++) {
            IEditorPart e = innerEditors[i];
            e.doSave(monitor);
        }
    }

    /**
     * Create the control of the inner editor.
View Full Code Here

    if (file == null) {
      return null;
    }

    if (activeEditor.isDirty()) {
      activeEditor.doSave(null);
    }
    new JSLint().validate(file);
   
    return null;
  }
View Full Code Here

      MessageDialog.openWarning(window.getShell(), "JSTools", "Resource "
          + editorInput.getName() + " is not part of the workspace!");
    }

    if (activeEditor.isDirty()) {
      activeEditor.doSave(null);
    }
    new JSBeautifier().beautify(file);
    return null;
  }
}
View Full Code Here

            if (editorRef == null) {
        return;
      }
            IEditorPart editor = (IEditorPart) editorRef.getPart(true);
            if (editor != null) {
        editor.doSave(monitor);
      }
        }

        String[] getText() {
            if (text != null) {
View Full Code Here

              MessageDialog.QUESTION,
              options,
              0);
          int answer = saveDialog.open();
          if (answer == 0) {
            ed.doSave(null);
          }
          //Continue as long as not cancel.
          ret = (2 != answer);
        }
      }
View Full Code Here

    //System.out.println("TRACE-> SecureFTP: Mode[PUT]");
    IEditorPart part = Activator.getActivePage().getActiveEditor();
    if (part != null) {
      if (part.isDirty()) {
        Activator.consolePrintln("Dirty",1);
        part.doSave(new NullProgressMonitor());
      }
    }
    super.run(action);
  }
}
View Full Code Here

    //System.out.println("TRACE-> SecureFTP: Mode[PUT]");
    IEditorPart part = SftpPlugin.getActivePage().getActiveEditor();
    if (part != null) {
      if (part.isDirty()) {
        SftpPlugin.consolePrintln("Dirty",1);
        part.doSave(new NullProgressMonitor());
      }
    }
    super.run(action);
  }
}
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.