Package org.eclipse.ui

Examples of org.eclipse.ui.ISaveablePart


        }
        /* **********************************************************************************
         * The code below was added to track the view with focus
         * in order to support save actions from a view (see bug 10234).
         */
        ISaveablePart saveView = getSaveableView();
        if (saveView != null) {
            saveView.doSaveAs();
            return;
        }
        /* **********************************************************************************/

        IEditorPart editor = getActiveEditor();
View Full Code Here


    protected void updateState() {
        /* **********************************************************************************
         * The code below was added to track the view with focus
         * in order to support save actions from a view (see bug 10234).
         */
        ISaveablePart saveView = getSaveableView();
        if (saveView != null) {
            setEnabled(saveView.isSaveAsAllowed());
            return;
        }
        /* **********************************************************************************/

        IEditorPart editor = getActiveEditor();
View Full Code Here

        }
        /* **********************************************************************************
         * The code below was added to track the view with focus
         * in order to support save actions from a view (see bug 10234).
         */
        ISaveablePart saveView = getSaveableView();
        if (saveView != null) {
            ((WorkbenchPage) getActivePart().getSite().getPage()).savePart(
                    saveView, getActivePart(), false);
            return;
        }
View Full Code Here

    protected void updateState() {
        /* **********************************************************************************
         * The code below was added to track the view with focus
         * in order to support save actions from a view (see bug 10234).
         */
        ISaveablePart saveable = getSaveableView();
        if (saveable == null) {
          saveable = getActiveEditor();
        }
        /* **********************************************************************************/
        if (saveable instanceof ISaveablesSource) {
      ISaveablesSource modelSource = (ISaveablesSource) saveable;
      setEnabled(SaveableHelper.needsSave(modelSource));
      return;
        }
        setEnabled(saveable != null && saveable.isDirty());
    }
View Full Code Here

   *
   * @see org.eclipse.ui.Saveable#doSave(org.eclipse.core.runtime.IProgressMonitor)
   */
  public void doSave(IProgressMonitor monitor) {
    if (part instanceof ISaveablePart) {
      ISaveablePart saveable = (ISaveablePart) part;
      saveable.doSave(monitor);
    }
  }
View Full Code Here

        for (int i = 0; i < allParts.length; i++) {
            IWorkbenchPartReference reference = allParts[i];
           
            IWorkbenchPart part = reference.getPart(false);
            if (part != null && part instanceof ISaveablePart) {
                ISaveablePart saveable = (ISaveablePart)part;
                if (saveable.isDirty()) {
                    result.add(saveable);
                }
            }
        }
       
View Full Code Here

                return;
            }
           
            // Confirm.
        if (view instanceof ISaveablePart) {
          ISaveablePart saveable = (ISaveablePart)view;
          if (saveable.isSaveOnCloseNeeded()) {
            IWorkbenchWindow window = view.getSite().getWorkbenchWindow();
            boolean success = EditorManager.saveAll(Collections.singletonList(view), true, true, false, window);
            if (!success) {
              // the user cancelled.
              return;
View Full Code Here

    PostCloseInfo postCloseInfo = new PostCloseInfo();
    for (Iterator it = partsToClose.iterator(); it.hasNext();) {
      IWorkbenchPart part = (IWorkbenchPart) it.next();
      postCloseInfo.partsClosing.add(part);
      if (part instanceof ISaveablePart) {
        ISaveablePart saveablePart = (ISaveablePart) part;
        if (save && !saveablePart.isSaveOnCloseNeeded()) {
          // pretend for now that this part is not closing
          continue;
        }
      }
      if (save && part instanceof ISaveablePart2) {
View Full Code Here

      // if processing a ISaveablePart2 caused other parts to be
      // saved, remove them from the list presented to the user.
      if (saveable2Processed) {
        listIterator = dirtyParts.listIterator();
        while (listIterator.hasNext()) {
          ISaveablePart part = (ISaveablePart) listIterator.next();
          if (!part.isDirty()) {
            listIterator.remove();
          }
        }
      }
View Full Code Here

            WorkbenchPage page = (WorkbenchPage) pages[j];

            ISaveablePart[] parts = page.getDirtyParts();

            for (int k = 0; k < parts.length; k++) {
              ISaveablePart part = parts[k];

              if (part.isSaveOnCloseNeeded()) {
                if (part instanceof IEditorPart) {
                  IEditorPart editor = (IEditorPart) part;
                  if (!dirtyEditorsInput.contains(editor
                      .getEditorInput())) {
                    dirtyParts.add(editor);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.ISaveablePart

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.