Examples of IWorkbenchSiteProgressService


Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

    Command command = csrv
        .getCommand("org.eclipse.egit.ui.RepositoriesLinkWithSelection"); //$NON-NLS-1$
    reactOnSelection = (Boolean) command.getState(
        RegistryToggleState.STATE_ID).getValue();

    IWorkbenchSiteProgressService service = CommonUtils.getService(getSite(), IWorkbenchSiteProgressService.class);
    if (service != null) {
      service.showBusyForFamily(JobFamilies.REPO_VIEW_REFRESH);
      service.showBusyForFamily(JobFamilies.CLONE);
    }
  }
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

      }

    };
    job.setSystem(true);

    IWorkbenchSiteProgressService service = CommonUtils.getService(getSite(), IWorkbenchSiteProgressService.class);

    if (trace)
      GitTraceLocation.getTrace().trace(
          GitTraceLocation.REPOSITORIESVIEW.getLocation(),
          "Scheduling refresh job"); //$NON-NLS-1$
    service.schedule(job, delay);

    scheduledJob = job;
    return scheduledJob;
  }
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

              }
            });
      }
    });

    IWorkbenchSiteProgressService service = CommonUtils.getService(getSite(), IWorkbenchSiteProgressService.class);
    if (service != null)
      service.schedule(commitJob, 0, true);
    else
      commitJob.schedule();

    CommitMessageHistory.saveCommitHistory(commitMessage);
    clearCommitMessageToggles();
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

      formatJob.cancel();
    scheduleFormatJob();
  }

  private void scheduleFormatJob() {
    IWorkbenchSiteProgressService siteService = (IWorkbenchSiteProgressService) partSite
        .getAdapter(IWorkbenchSiteProgressService.class);
    if (siteService == null)
      return;
    FormatJob.FormatRequest formatRequest = new FormatJob.FormatRequest(
        getRepository(), commit, fill, SYS_LINKCOLOR, SYS_DARKGRAY,
        allRefs);
    formatJob = new FormatJob(formatRequest);
    addDoneListenerToFormatJob();
    siteService.schedule(formatJob, 0 /* now */, true /*
                             * use the half-busy
                             * cursor in the part
                             */);
  }
 
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

  }

  private void schedule(final Job j) {
    IWorkbenchPartSite site = getPartSite();
    if (site != null) {
      final IWorkbenchSiteProgressService p;
      p = (IWorkbenchSiteProgressService) site
          .getAdapter(IWorkbenchSiteProgressService.class);
      if (p != null) {
        p.schedule(j, 0, true /* use half-busy cursor */);
        return;
      }
    }
    j.schedule();
  }
 
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

   *            if <code>true</code>, the repository will be deleted from disk
   */
  protected void removeRepository(final ExecutionEvent event,
      final boolean delete) {
    IWorkbenchSite activeSite = HandlerUtil.getActiveSite(event);
    IWorkbenchSiteProgressService service = CommonUtils.getService(activeSite, IWorkbenchSiteProgressService.class);

    // get selected nodes
    final List<RepositoryNode> selectedNodes;
    try {
      selectedNodes = getSelectedNodes(event);
    } catch (ExecutionException e) {
      Activator.handleError(e.getMessage(), e, true);
      return;
    }
    boolean deleteWorkingDir = false;
    boolean removeProjects = false;
    final List<IProject> projectsToDelete = findProjectsToDelete(selectedNodes);
    if (delete) {
      if (selectedNodes.size() > 1) {
        return;
      } else if (selectedNodes.size() == 1) {
        Repository repository = selectedNodes.get(0).getObject();
        if (repository.isBare()) {
          // simple confirm dialog
          String title = UIText.RemoveCommand_ConfirmDeleteBareRepositoryTitle;
          String message = NLS
              .bind(
                  UIText.RemoveCommand_ConfirmDeleteBareRepositoryMessage,
                  repository.getDirectory().getPath());
          if (!MessageDialog.openConfirm(getShell(event), title,
              message))
            return;
        } else {
          // confirm dialog with check box
          // "delete also working directory"
          DeleteRepositoryConfirmDialog dlg = new DeleteRepositoryConfirmDialog(
              getShell(event), repository, projectsToDelete.size());
          if (dlg.open() != Window.OK)
            return;
          deleteWorkingDir = dlg.shouldDeleteWorkingDir();
          removeProjects = dlg.shouldRemoveProjects();
        }
      }
    }
    else {
      if (!projectsToDelete.isEmpty()) {
        final boolean[] confirmedCanceled = new boolean[] { false,
            false };
        Display.getDefault().syncExec(new Runnable() {

          public void run() {
            try {
              confirmedCanceled[0] = confirmProjectDeletion(
                  projectsToDelete, event);
            } catch (OperationCanceledException e) {
              confirmedCanceled[1] = true;
            }
          }
        });
        if (confirmedCanceled[1])
          return;
        removeProjects = confirmedCanceled[0];
      }
    }

    final boolean deleteWorkDir = deleteWorkingDir;
    final boolean removeProj = removeProjects;

    Job job = new WorkspaceJob(UIText.RemoveCommand_RemoveRepositoriesJob) {

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {

        monitor.setTaskName(UIText.RepositoriesView_DeleteRepoDeterminProjectsMessage);

        if (removeProj) {
          // confirmed deletion
          deleteProjects(delete, projectsToDelete,
              monitor);
        }
        for (RepositoryNode node : selectedNodes) {
          util.removeDir(node.getRepository().getDirectory());
        }

        if (delete) {
          try {
            deleteRepositoryContent(selectedNodes, deleteWorkDir);
          } catch (IOException e) {
            return Activator.createErrorStatus(e.getMessage(), e);
          }
        }
        return Status.OK_STATUS;
      }

      @Override
      public boolean belongsTo(Object family) {
        if (JobFamilies.REPOSITORY_DELETE.equals(family))
          return true;
        else
          return super.belongsTo(family);
      }
    };

    service.schedule(job);
  }
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

        return Status.OK_STATUS;
      }
    };
    IWorkbenchSite activeSite = HandlerUtil.getActiveSite(event);
    IWorkbenchSiteProgressService service = CommonUtils.getService(activeSite, IWorkbenchSiteProgressService.class);
    service.schedule(job);

    return null;
  }
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

*         (IModelElement -> IResource).
*/
public class FormatActionDelegate extends
    org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate {
  private IWorkbenchSiteProgressService getActiveProgressService() {
    IWorkbenchSiteProgressService service = null;
    if (PlatformUI.isWorkbenchRunning()) {
      IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow();
      if (activeWorkbenchWindow != null) {
        IWorkbenchPage activePage = activeWorkbenchWindow
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

    /* Create the Search Bar */
    createSearchBar(parent);

    /* Show Busy when reload occurs */
    IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) fViewSite.getAdapter(IWorkbenchSiteProgressService.class);
    service.showBusyForFamily(Controller.getDefault().getReloadFamily());
  }
View Full Code Here

Examples of org.eclipse.ui.progress.IWorkbenchSiteProgressService

  @Override
  public void init(IViewSite site, IMemento memento) throws PartInitException {
    super.init(site, memento);
    m_stateMemento = memento;

    IWorkbenchSiteProgressService progressService = getProgressService();
    if(progressService != null) {
      progressService.showBusyForFamily(TestRunnerViewPart.FAMILY_RUN);
    }

    // Start the watcher thread, if applicable
    updateResultThread();
  }
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.