Package org.eclipse.ui.internal.progress

Examples of org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog


    // save the workspace
    final MultiStatus status = new MultiStatus(
        IDEWorkbenchPlugin.IDE_WORKBENCH, 1,
        IDEWorkbenchMessages.ProblemSavingWorkbench, null);
    try {
      final ProgressMonitorJobsDialog p = new CancelableProgressMonitorJobsDialog(
          null);

      final boolean applyPolicy = ResourcesPlugin.getWorkspace()
          .getDescription().isApplyFileStatePolicy();

      IRunnableWithProgress runnable = new IRunnableWithProgress() {
        public void run(IProgressMonitor monitor) {
          try {
            if (applyPolicy)
              monitor = new CancelableProgressMonitorWrapper(
                  monitor, p);

            status.merge(((Workspace) ResourcesPlugin
                .getWorkspace()).save(true, true, monitor));
          } catch (CoreException e) {
            status.merge(e.getStatus());
          }
        }
      };

      p.run(true, false, runnable);
    } catch (InvocationTargetException e) {
      status
          .merge(new Status(IStatus.ERROR,
              IDEWorkbenchPlugin.IDE_WORKBENCH, 1,
              IDEWorkbenchMessages.InternalError, e
View Full Code Here


        }
      }
    };

    try {
      new ProgressMonitorJobsDialog(null).run(true, false, runnable);
    } catch (InvocationTargetException e) {
      // fail silently
    } catch (InterruptedException e) {
      // fail silently
    }
View Full Code Here

        new String[] { IDialogConstants.YES_LABEL,
            IDialogConstants.NO_LABEL,
            WorkbenchMessages.EditorManager_openNewEditorLabel }, 0);
    int result = dialog.open();
    if (result == 0) { // YES
      ProgressMonitorDialog pmd = new ProgressMonitorJobsDialog(dialog
          .getShell());
      pmd.open();
      dirtyEditor.getEditor(true).doSave(pmd.getProgressMonitor());
      pmd.close();
    } else if ((result == 2) || (result == -1)) {
      return null;
    }
    return dirtyEditor;
  }
View Full Code Here

     */
    private void saveItems(TableItem items[], IProgressMonitor monitor) {
        if (items.length == 0) {
      return;
    }
        ProgressMonitorDialog pmd = new ProgressMonitorJobsDialog(getShell());
        pmd.open();
        for (int i = 0; i < items.length; i++) {
            Adapter editor = (Adapter) items[i].getData();
            editor.save(pmd.getProgressMonitor());
            updateItem(items[i], editor);
        }
        pmd.close();
        updateItems();
    }
View Full Code Here

            WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
                public void execute(IProgressMonitor monitor) {
                    errorStatus[0] = WorkspaceAction.this.execute(getActionResources(), monitor);
                }
            };
            new ProgressMonitorJobsDialog(shell).run(true, true, op);
        } catch (InterruptedException e) {
            return;
        } catch (InvocationTargetException e) {
            // we catch CoreException in execute(), but unexpected runtime exceptions or errors may still occur
            String msg = NLS.bind(IDEWorkbenchMessages.WorkspaceAction_logTitle, getClass().getName(),
View Full Code Here

  private IContainer container;

  @Override
  public Object start(IApplicationContext context) throws Exception {
    this.context = context;
    IProgressMonitor pgm= (IProgressMonitor) new ProgressMonitorJobsDialog(
        Display.getDefault().getActiveShell());
    run( pgm );
    return MultiStatus.OK_STATUS;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog

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.