Package org.eclipse.ui.progress

Examples of org.eclipse.ui.progress.UIJob


  private void createJob(ITask.Priority priority) {

    /* Create a UI-Job */
    if (fRunInUIThread) {
      fJob = new UIJob("") { //$NON-NLS-1$
        @Override
        public IStatus runInUIThread(IProgressMonitor monitor) {
          try {
            if (!monitor.isCanceled() && fTask != null)
              return fTask.run(monitor);
View Full Code Here


    /* Only run if not canceld yet */
    if (!monitor.isCanceled())
      synchronizedSafeRunInBackground(monitor);

    /* Schdule UIJob now */
    UIJob uiJob = new UIJob(NAME) {
      @Override
      public IStatus runInUIThread(IProgressMonitor monitor) {

        /* If Control is provided, check disposed State */
        if (fControl != null && fControl.isDisposed())
          return Status.OK_STATUS;

        /* Run UI-Task */
        synchronizedSafeRunInUI(monitor);

        return Status.OK_STATUS;
      }
    };

    uiJob.setSystem(true);
    uiJob.setUser(false);

    /* Only run if not canceld yet */
    if (!monitor.isCanceled())
      uiJob.schedule();

    monitor.done();

    return Status.OK_STATUS;
  }
View Full Code Here

    initResources();
  }

  private void createAutoCloser() {
    fAutoCloser = new UIJob(PlatformUI.getWorkbench().getDisplay(), "") {
      @Override
      public IStatus runInUIThread(IProgressMonitor monitor) {
        if (getShell() != null && !getShell().isDisposed())
          close();
View Full Code Here

   * @param runnable
   * @param widget
   */
  public static void runInUIThread(int delay, final Widget widget, final Runnable runnable) {
    Assert.isNotNull(runnable);
    UIJob uiJob = new UIJob("UIJob Runner") { //$NON-NLS-1$
      @Override
      public IStatus runInUIThread(IProgressMonitor monitor) {
        if (widget == null || !widget.isDisposed())
          runnable.run();
        return Status.OK_STATUS;
      }
    };

    uiJob.setSystem(true);
    uiJob.setUser(false);
    uiJob.schedule(delay);
  }
View Full Code Here

  private void createJob(ITask.Priority priority) {

    /* Create a UI-Job */
    if (fRunInUIThread) {
      fJob = new UIJob("") { //$NON-NLS-1$
        @Override
        public IStatus runInUIThread(IProgressMonitor monitor) {
          try {
            if (!monitor.isCanceled() && fTask != null)
              return fTask.run(monitor);
View Full Code Here

    /* Only run if not canceld yet */
    if (!monitor.isCanceled())
      synchronizedSafeRunInBackground(monitor);

    /* Schdule UIJob now */
    UIJob uiJob = new UIJob(NAME) {
      @Override
      public IStatus runInUIThread(IProgressMonitor monitor) {

        /* If Control is provided, check disposed State */
        if (fControl != null && fControl.isDisposed())
          return Status.OK_STATUS;

        /* Run UI-Task */
        synchronizedSafeRunInUI(monitor);

        return Status.OK_STATUS;
      }
    };

    uiJob.setSystem(true);
    uiJob.setUser(false);

    /* Only run if not canceld yet */
    if (!monitor.isCanceled())
      uiJob.schedule();

    monitor.done();

    return Status.OK_STATUS;
  }
View Full Code Here

   * @param runnable
   * @param widget
   */
  public static void runInUIThread(int delay, final Widget widget, final Runnable runnable) {
    Assert.isNotNull(runnable);
    UIJob uiJob = new UIJob("UIJob Runner") { //$NON-NLS-1$
      @Override
      public IStatus runInUIThread(IProgressMonitor monitor) {
        if (widget == null || !widget.isDisposed())
          runnable.run();
        return Status.OK_STATUS;
      }
    };

    uiJob.setSystem(true);
    uiJob.setUser(false);
    uiJob.schedule(delay);
  }
View Full Code Here

    /* Remember to dispose later */
    fLastUsedRegion = region;
  }

  private void createAutoCloser() {
    fAutoCloser = new UIJob(PlatformUI.getWorkbench().getDisplay(), "") {
      @Override
      public IStatus runInUIThread(IProgressMonitor monitor) {
        if (!fMouseOverNotifier && getShell() != null && !getShell().isDisposed())
          doClose();

View Full Code Here

    /* Remember to dispose later */
    fLastUsedRegion = region;
  }

  private void createAutoCloser() {
    fAutoCloser = new UIJob(PlatformUI.getWorkbench().getDisplay(), "") { //$NON-NLS-1$
      @Override
      public IStatus runInUIThread(IProgressMonitor monitor) {
        if (!fMouseOverNotifier && getShell() != null && !getShell().isDisposed() && !monitor.isCanceled())
          doClose();

View Full Code Here

    if (!forceAsync && delay == 0 && (widget == null || !widget.isDisposed()) && Display.getCurrent() != null)
      runnable.run();

    /* Otherwise use UI Job */
    else {
      UIJob uiJob = new UIJob("") { //$NON-NLS-1$
        @Override
        public IStatus runInUIThread(IProgressMonitor monitor) {
          if (widget == null || !widget.isDisposed())
            runnable.run();
          return Status.OK_STATUS;
        }
      };

      uiJob.setSystem(true);
      uiJob.setUser(false);
      uiJob.schedule(delay);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.progress.UIJob

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.