Examples of UIJob


Examples of org.eclipse.ui.progress.UIJob

    job.schedule();
  }

  public void navigateExternal() {
    UIJob job = new UIJob(label) {

      public IStatus runInUIThread(IProgressMonitor monitor) {
        CloudUiUtil.openUrl(location, WebBrowserPreference.EXTERNAL);
        return Status.OK_STATUS;
      }
    };

    job.schedule();
  }
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

    private static boolean running = false;
    private static boolean reported = false;

    @Override
    public void run() {
        final UIJob job = new UIJob("erlide set runtime") {
            @Override
            public IStatus runInUIThread(final IProgressMonitor monitor) {
                if (running) {
                    return Status.OK_STATUS;
                }
                running = true;
                if (reported) {
                    MessageReporter
                            .showError("Erlang support requires an Erlang installation. "
                                    + "Did you configure it?");
                } else {
                    MessageReporter
                            .showError("Erlang support requires an Erlang installation. "
                                    + "Please configure it. "
                                    + "Eclipse will restart afterwards.");
                }
                reported = true;

                final PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(
                        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                        "org.erlide.ui.preferences.runtimes", null, null);
                if (pref != null) {
                    if (pref.open() == Window.OK) {
                        ErlLogger
                                .info("Restarting workbench after initial runtime configuration...");
                        PlatformUI.getWorkbench().restart();
                    }
                }
                running = false;
                return Status.OK_STATUS;
            }
        };
        job.schedule();
    }
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

        try {
            final RpcFuture result = call();
            if (result == null) {
                return;
            }
            final Job job = new UIJob("async call updater") {
                @Override
                public IStatus runInUIThread(final IProgressMonitor monitor) {
                    try {
                        if (result.checkedGet(1, TimeUnit.MILLISECONDS) == null) {
                            schedule(interval);
                        }
                    } catch (final RpcException e) {
                        ErlLogger.error(e);
                    } catch (final TimeoutException e) {
                        ErlLogger.error(e);
                    }
                    handleResult(context, result);
                    if (monitor.isCanceled()) {
                        return Status.CANCEL_STATUS;
                    }
                    return new Status(IStatus.OK, ErlideUIPlugin.PLUGIN_ID, "done");
                }
            };
            job.schedule(interval);
        } catch (final BackendException e) {
            ErlLogger.error(e);
        }

    }
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

        final String title = "Update Erlang Model in CommonViewer: " + file.getName();
        if (viewer == null) {
            return;
        }
        new UIJob(title) {
            @Override
            public IStatus runInUIThread(final IProgressMonitor monitor) {
                if (viewer != null && !viewer.getControl().isDisposed()) {
                    viewer.refresh(file);
                    // viewer.update(file, null);
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

public class UIMessageReporter {

    @Subscribe
    public void displayMessage(final ErlideMessage emsg) {
        try {
            new UIJob("erlide message") {
                @Override
                public IStatus runInUIThread(final IProgressMonitor monitor) {
                    final MultiStatus msg = new MultiStatus("org.erlide.ui", 0,
                            emsg.getMessage(), null);
                    if (emsg.getDetails() != null) {
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

        bars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), fPreviousAnnotation);
    }

    public void displayMessage(final String message) {
        getActionBars().getStatusLineManager().setMessage(message);
        new UIJob("message clear") {

            @Override
            public IStatus runInUIThread(final IProgressMonitor monitor) {
                getActionBars().getStatusLineManager().setMessage(null);
                return Status.OK_STATUS;
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

        // save column widths
        final IDialogSettings settings = ErlideUIPlugin.getDefault().getDialogSettings();
        saveColumnSettings(settings, RUNTIMES_PREFERENCE_PAGE);

        if (restart) {
            new UIJob("restart") {

                @Override
                public IStatus runInUIThread(final IProgressMonitor monitor) {
                    PlatformUI.getWorkbench().restart();
                    return Status.OK_STATUS;
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

                final String location = LogUtil.getReportFile();

                final ProblemData data = gatherProblemData(attach, title, contact, body);
                sendToDisk(location, data);

                final Job inner = new UIJob("update report ui") {
                    @Override
                    public IStatus runInUIThread(final IProgressMonitor amonitor) {
                        sendButton.setText("Done!");
                        responseLabel.setVisible(true);
                        locationLabel.setText(location);
                        locationLabel.setVisible(true);
                        responseLabel_1.setVisible(true);
                        return Status.OK_STATUS;
                    }
                };
                inner.setPriority(Job.INTERACTIVE);
                inner.setSystem(true);
                inner.schedule();

                return Status.OK_STATUS;
            }
        };
        j.setPriority(Job.SHORT);
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

       
        if (!isBreakpointReached() &&
            !PerlEditorPlugin.getDefault().getBooleanPreference(
                PreferenceConstants.DEBUG_SUSPEND_AT_FIRST))
        {
            UIJob resume = new UIJob("PerlDebugThread.resume") {
                public IStatus runInUIThread(IProgressMonitor monitor)
                {
                    try { resume(); }
                    catch (DebugException e)
                    {
                        PerlDebugPlugin.log(e);
                    }
                    return Status.OK_STATUS;
                }
            };
            resume.setSystem(true);
            resume.schedule();
        }
        else fireSuspendEvent(DebugEvent.BREAKPOINT);
    }
View Full Code Here

Examples of org.eclipse.ui.progress.UIJob

      return true;
    case IResource.FILE:
      final IFile file = (IFile) source;
      if (PLAN_EXT.equals(file.getFileExtension())) {
        ToolPlan.getInstance(file);
        new UIJob("Update Plan Model in ToolViewer") { 
          public IStatus runInUIThread(IProgressMonitor monitor) {
            if (viewer != null && !viewer.getControl().isDisposed())
              viewer.refresh(file);
            return Status.OK_STATUS;           
          }
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.