/** * Opens the editor for the given spec (needs access to the UI thus has to * run as a UI job) */ private void openEditorInUIThread(final Spec spec) { // with parsing done, we are ready to open the spec editor final UIJob uiJob = new UIJob("NewSpecWizardEditorOpener") { @Override public IStatus runInUIThread(final IProgressMonitor monitor) { // create parameters for the handler final HashMap<String, String> parameters = new HashMap<String, String>(); parameters.put(OpenSpecHandler.PARAM_SPEC, spec.getName()); // runs the command UIHelper.runCommand(OpenSpecHandler.COMMAND_ID, parameters); return Status.OK_STATUS; } }; uiJob.schedule(); }
@Override public void run() { UIJob uiJob = new UIJob(Messages.MANAGE_SERVICES_TO_APPLICATIONS_TITLE) { public IStatus runInUIThread(IProgressMonitor monitor) { try { if (serverBehaviour != null) { ServiceToApplicationsBindingWizard wizard = new ServiceToApplicationsBindingWizard( servicesHandler, serverBehaviour.getCloudFoundryServer(), editorPage); WizardDialog dialog = new WizardDialog(editorPage.getSite().getShell(), wizard); dialog.open(); } } catch (CoreException e) { if (Logger.ERROR) { Logger.println(Logger.ERROR_LEVEL, this, "runInUIThread", "Error launching wizard", e); //$NON-NLS-1$ //$NON-NLS-2$ } } return Status.OK_STATUS; } }; uiJob.setSystem(true); uiJob.setPriority(Job.INTERACTIVE); uiJob.schedule(); }
@Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible) { // Launch it as a job, to give the wizard time to display // the spaces viewer UIJob job = new UIJob(Messages.CloneServerPage_JOB_REFRESH_ORG_SPACE) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { updateSpacesDescriptor(); refreshListOfSpaces(); return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); } }
protected void processFile(IFile file) { if (file != null && file.getFileExtension().equalsIgnoreCase( GUIEditorPlugin.FORGED_UI_EXTENSION)) { if (GUIEditorPlugin.getDefault().getWorkbench() .saveAllEditors(true)) { // Do the start of the job here. Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); IProgressService progressService = PlatformUI.getWorkbench() .getProgressService(); CodeGenJob job = new CodeGenJob(file); UIJob runJob = new EditorUIJob(job); progressService.showInDialog(shell, runJob); // runJob.setRule(ISchedulingRule); runJob.schedule(); } } }
private void registerExampleDropAdapter() { UIJob registerJob = new UIJob(Display.getDefault(), "Registering example drop adapter.") { { setPriority(Job.SHORT); setSystem(true); } @Override public IStatus runInUIThread(IProgressMonitor monitor) { IWorkbench workbench = PlatformUI.getWorkbench(); workbench.addWindowListener(workbenchListener); IWorkbenchWindow[] workbenchWindows = workbench .getWorkbenchWindows(); for (IWorkbenchWindow window : workbenchWindows) { workbenchListener.hookWindow(window); } return Status.OK_STATUS; } }; registerJob.schedule(); }
protected void schedulePerspectiveSwitchJob(final String perspectiveID) { Job switchJob = new UIJob(DebugUIPlugin.getStandardDisplay(), "Perspective Switch Job") { //$NON-NLS-1$ public IStatus runInUIThread(IProgressMonitor monitor) { IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow(); if (window != null && !(isCurrentPerspective(window, perspectiveID))) { switchToPerspective(window, perspectiveID); } // Force the debug view to open if (window != null) { try { window.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(SIMULATION_VIEW_ID); } catch (PartInitException e) { e.printStackTrace(); } } return Status.OK_STATUS; } }; switchJob.setSystem(true); switchJob.setPriority(Job.INTERACTIVE); switchJob.setRule(AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(this)); switchJob.schedule(); }
@Override public void handleError(final IStatus status) { if (status != null && status.getSeverity() == IStatus.ERROR) { UIJob job = new UIJob(Messages.DockerFoundryUiCallback_JOB_CF_ERROR) { public IStatus runInUIThread(IProgressMonitor monitor) { Shell shell = CloudUiUtil.getShell(); if (shell != null) { new MessageDialog(shell, Messages.DockerFoundryUiCallback_ERROR_CALLBACK_TITLE, null, status.getMessage(), MessageDialog.ERROR, new String[] { Messages.COMMONTXT_OK }, 0) .open(); } return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); } }
private void hookToCommands(final ToolItem lastEdit, final ToolItem nextEdit) { final UIJob job = new UIJob("Hooking to commands") { @Override public IStatus runInUIThread(final IProgressMonitor monitor) { final ICommandService service = WorkbenchHelper.getService(ICommandService.class); final Command nextCommand = service.getCommand(IWorkbenchCommandConstants.NAVIGATE_FORWARD_HISTORY); nextEdit.setEnabled(nextCommand.isEnabled()); final ICommandListener nextListener = e -> nextEdit.setEnabled(nextCommand.isEnabled()); nextCommand.addCommandListener(nextListener); final Command lastCommand = service.getCommand(IWorkbenchCommandConstants.NAVIGATE_BACKWARD_HISTORY); final ICommandListener lastListener = e -> lastEdit.setEnabled(lastCommand.isEnabled()); lastEdit.setEnabled(lastCommand.isEnabled()); lastCommand.addCommandListener(lastListener); // Attaching dispose listeners to the toolItems so that they remove the // command listeners properly lastEdit.addDisposeListener(e -> lastCommand.removeCommandListener(lastListener)); nextEdit.addDisposeListener(e -> nextCommand.removeCommandListener(nextListener)); return Status.OK_STATUS; } }; job.schedule(); }
public Object execute(ExecutionEvent event) throws ExecutionException { UIJob job = new UIJob("Open Theme Preferences") //$NON-NLS-1$ { @Override public IStatus runInUIThread(IProgressMonitor monitor) { final PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(UIUtils.getActiveShell(), ThemePreferencePage.ID, null, null); dialog.open(); return Status.OK_STATUS; } }; job.setPriority(Job.INTERACTIVE); job.setRule(PopupSchedulingRule.INSTANCE); job.schedule(); return null; }
/** * Update the shown name with the server stop/stopping state. */ private void updateName(int serverState) { final String computedName; if (serverState == IServer.STATE_STARTING) { computedName = Messages.getString("SERVER_STARTING_TEMPLATE", unprefixedName); } else if (serverState == IServer.STATE_STOPPING) { computedName = Messages.getString("SERVER_STOPPING_TEMPLATE", unprefixedName); } else if (serverState == IServer.STATE_STOPPED) { computedName = Messages.getString("SERVER_STOPPED_TEMPLATE", unprefixedName); } else { computedName = unprefixedName; } UIJob nameUpdateJob = new UIJob("Update server name") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { LocalAppEngineConsole.this.setName(computedName); return Status.OK_STATUS; } }; nameUpdateJob.setSystem(true); nameUpdateJob.schedule(); }
@Override public void execute(String newWorkingDir) { IContainer container = WorkbenchResourceUtil.findContainerFromWorkspace(getWorkingDir()); if (container != null) { IProject project = container.getProject(); new UIJob(AngularCLIMessages.NgBuildCommandInterpreter_jobName) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { try { AngularCLIJson cliJson = AngularCLIProject.getAngularCLIProject(project).getAngularCLIJson(); IFolder distFolder = project.getFolder(cliJson.getOutDir()); distFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor); if (distFolder.exists()) { // Select dist folder in the Project Explorer. UIInterpreterHelper.selectRevealInDefaultViews(distFolder); } } catch (CoreException e) { return new Status(IStatus.ERROR, AngularCLIPlugin.PLUGIN_ID, AngularCLIMessages.NgBuildCommandInterpreter_error, e); } return Status.OK_STATUS; } }.schedule(); } }
/** * Tests bug https://jira.int.sys.net/browse/AIG-931. * * @throws Exception * the exception */ @Test public void testBugAig931() throws Exception { final String partialModel = "package p catalog T for grammar com.avaloq.tools.ddk.check.Check { error \"X\" for "; final String[] expectedContextTypeProposals = {"EObject - org.eclipse.emf.ecore", "JvmType - org.eclipse.xtext.common.types"}; new UIJob("compute completion proposals") { @SuppressWarnings("restriction") @Override public IStatus runInUIThread(final IProgressMonitor monitor) { try { completionsExist(newBuilder().append(partialModel).computeCompletionProposals(), expectedContextTypeProposals); // CHECKSTYLE:OFF } catch (Exception e) { // CHECKSTYLE:ON return new Status(Status.ERROR, "com.avaloq.tools.ddk.check.ui.test", 1, e.getMessage(), e); } return Status.OK_STATUS; } }; }
public void doRun(final CloudFoundryServer cloudServer) { final Shell shell = activePart != null && activePart.getSite() != null ? activePart.getSite().getShell() : CFUiUtil.getShell(); if (shell != null) { UIJob job = new UIJob(getJobName()) { public IStatus runInUIThread(IProgressMonitor monitor) { OrgsAndSpacesWizard wizard = new OrgsAndSpacesWizard(cloudServer); WizardDialog dialog = new WizardDialog(shell, wizard); dialog.open(); return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); } else { CloudFoundryPlugin.logError("Unable to find an active shell to open the orgs and spaces wizard."); //$NON-NLS-1$ } }
@Override public boolean performFinish() { final String targetPath = this.page.getSourcePath(); final String fileName = this.page.getPagePath(); pageName = this.page.getPageName(); Job menuJob = new UIJob("") { public IStatus runInUIThread(IProgressMonitor monitor) { try { doFinish(targetPath, fileName, monitor); } catch (CoreException e) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; menuJob.schedule(300L); return true; }
private static void showErrorMessage(final String title, final String message, final Throwable exception) { if (Display.getCurrent() == null || exception != null) { UIJob job = new UIJob(message) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (exception == null) { showErrorDialog(title, message); return Status.OK_STATUS; } return new Status(IStatus.ERROR, UIPlugin.PLUGIN_ID, null, exception); } }; job.setPriority(Job.INTERACTIVE); job.setUser(true); job.schedule(); } else { showErrorDialog(title, message); } }
private void resetPerspective(final IWorkbenchPage page) { UIJob job = new UIJob("Resetting Studio perspective...") //$NON-NLS-1$ { @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (MessageDialog.openQuestion(UIUtils.getActiveShell(), com.aptana.ui.Messages.UIPlugin_ResetPerspective_Title, com.aptana.ui.Messages.UIPlugin_ResetPerspective_Description)) { page.resetPerspective(); } return Status.OK_STATUS; } }; EclipseUtil.setSystemForJob(job); job.setPriority(Job.INTERACTIVE); job.schedule(); }
private void jobUIFilter_10_Create() { _jobUIFilter = new UIJob("PicDirImages: Update UI with filtered gallery images") { //$NON-NLS-1$ @Override public IStatus runInUIThread(final IProgressMonitor monitor) { _jobUIFilterJobIsScheduled.set(false); try { jobUIFilter_30_Run(); } catch (final Exception e) { StatusUtil.log(e); } return Status.OK_STATUS; } }; _jobUIFilter.setSystem(true); }
/** * Shows a dialog to the user, asking whether the analysis should really be aborted. * Blocks the caller. * * @return {@code true} if the analysis should be aborted. */ public boolean ask() { final AbortConfirmJob askJob = new AbortConfirmJob(); this.askingThread = Thread.currentThread(); askJob.schedule(); try { askJob.join(); } catch (final InterruptedException interrupted) { new UIJob(Display.getDefault(), "Close question dialog") { @Override public IStatus runInUIThread(final IProgressMonitor monitor) { AbortQuestion.this.questionDialog.close(); return Status.OK_STATUS; } }.schedule(); return false; } finally { this.askingThread = null; } return askJob.wantsToAbort; }
/** * Initialises this window. */ public synchronized void initialise() { if (this.progressWindow == null) { final UIJob creationJob = inUI(() -> { final Shell ourShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); this.progressWindow = new ProgressMessageWindow(ourShell); }); while (this.progressWindow == null) { try { creationJob.join(); } catch (final InterruptedException interrupted) { // It’s crucial that the window has been created after this point. So // we try again. } } } }
private Composite createBrowserArea(Composite parent) { GridLayout gridLayout = new GridLayout(1, false); parent.setLayout(gridLayout); GridData gd_displayArea = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1); parent.setLayoutData(gd_displayArea); tabFolder = new CTabFolder(parent, SWT.TOP|SWT.MULTI|SWT.FLAT); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); UIJob job = new UIJob(Display.getDefault(),"refresh browser") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { refreshTabContent(); return Status.OK_STATUS; } /** (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#shouldRun() */ @Override public boolean shouldRun() { return !tabFolder.isDisposed(); } }; job.schedule(); return parent; }
@Override public void update(Message msg) { if (msg.getHeader().getMessageType() == MessageType.MANAGEMENT) { UIJob job = new UIJob("Set Text") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (msg.getPayload()[0] == 27) textVerificatorOutput.setText(new String(msg.getPayload())); else textLoops.setText(new String(msg.getPayload())); return Status.OK_STATUS; } }; job.schedule(); } }
public void earlyStartup() { UIJob registerJob = new UIJob(PlatformUI.getWorkbench().getDisplay(), "ForceProjectDrop") { { setPriority(Job.SHORT); setSystem(true); } @Override public IStatus runInUIThread(IProgressMonitor monitor) { IWorkbench workbench = PlatformUI.getWorkbench(); workbench.addWindowListener(workbenchListener); IWorkbenchWindow[] workbenchWindows = workbench .getWorkbenchWindows(); for (IWorkbenchWindow window : workbenchWindows) { workbenchListener.hookWindow(window); } return Status.OK_STATUS; } }; registerJob.schedule(); }
public void run() { final List<EObject> theResourceContents = resource.getContents(); if (theResourceContents.isEmpty()) { return; } final EObject theRootModel = theResourceContents.get(0); final Job job = new UIJob(Activator.INSTANCE.getString("_UI_ModelValidator_job_name", new Object[] { resource.getURI() })) { @Override public IStatus runInUIThread(final IProgressMonitor monitor) { handleDiagnostic(validate(theRootModel)); return Status.OK_STATUS; } }; job.setPriority(Job.DECORATE); job.schedule(); }
/** * Remove the editor from askReparse and if it's the last one, do the find. */ private void doFindIfLast() { synchronized (lock) { askReparse.remove(editToReparse); if (askReparse.size() > 0) { return; //not the last one (we'll only do the find when all are reparsed. } } /** * Create an ui job to actually make the find. */ UIJob job = new UIJob("Find") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { try { findDefinitionsAndOpen(true); } catch (Throwable e) { Log.log(e); } return Status.OK_STATUS; } }; job.setPriority(Job.INTERACTIVE); job.schedule(); }
@Override public void initialize() { //need to do this asynchronously, or it has no effect new UIJob("Show/Hide Column") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { showColumn(fPreemptColumn, PyHoverPreferencesPage.getCombineHoverInfo()); showColumn(fModifierColumn, !PyHoverPreferencesPage.getCombineHoverInfo()); fModifierFieldLabel.setEnabled(!fCombineHovers.getSelection()); return Status.OK_STATUS; } }.schedule(); doInit(true); }
private void updateTicket() { new UIJob("Update Ticket") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { try { Ticket ticket = getInput(); client.updateTicket(ticket, monitor); setInput(ticket); } catch (ProjectOpenException e) { throw new RuntimeException(e); } return Status.OK_STATUS; } }.schedule(); }
protected static void searchCompleted(final Object source, final String typeName, final int lineNumber, final IStatus status) { UIJob job = new UIJob("link search complete") { //$NON-NLS-1$ public IStatus runInUIThread(IProgressMonitor monitor) { if (source == null) { if (status == null) { // did not find source MessageDialog.openInformation(JDIDebugUIPlugin.getActiveWorkbenchShell(), ConsoleMessages.JavaStackTraceHyperlink_Information_1, MessageFormat.format(ConsoleMessages.JavaStackTraceHyperlink_Source_not_found_for__0__2, new Object[] {typeName})); } else { JDIDebugUIPlugin.statusDialog(ConsoleMessages.JavaStackTraceHyperlink_3, status); } } else { processSearchResult(source, typeName, lineNumber); } return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); }
@Override public void start(BundleContext context) throws Exception{ super.start(context); UIJob job = new UIJob("InitCommandsWorkaround") { public IStatus runInUIThread(@SuppressWarnings("unused") IProgressMonitor monitor){ ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getService(ICommandService.class); Command command = commandService.getCommand(LoadESRFileHandler.COMMAND_ID); command.isEnabled(); return new Status(IStatus.OK, "my.plugin.id", "Init commands workaround performed succesfully"); } }; job.schedule(); }
private void scheduleClosingDialogAfterOpen(final CloseAction closeAction) { dialogCloser = new UIJob("dialog closer") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (dialog.getShell() != null && dialog.getShell().isVisible()) { closeDialog(closeAction); } else { schedule(100); } return Status.OK_STATUS; } }; dialogCloser.schedule(); }
/** * Opens the specified url in a Web browser instance in a UI thread. * * @param urlPath the URL to display * @param browserId if an instance of a browser with the same id is already opened, it will be * returned instead of creating a new one. Passing null will create a new instance with a * generated id. * @param name a name displayed on the tab of the internal browser * @param tooltip the text for a tooltip on the <code>name</code> of the internal browser */ public static void openInBrowserInUiThread(final String urlPath, final String browserId, final String name, final String tooltip) { final IWorkbench workbench = PlatformUI.getWorkbench(); Job launchBrowserJob = new UIJob(workbench.getDisplay(), name) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { return openInBrowser(workbench, urlPath, browserId, name, tooltip); } }; launchBrowserJob.schedule(); }
@Override public void doubleClicked(ITextViewer viewer) { final int offset = viewer.getSelectedRange().x; if (offset < 0) return; PageRoot model = editor.getPageModel(); PagePart part = model.partAtOffset(offset); if (part.getKind() != Kind.TABLE) { super.doubleClicked(viewer); return; } UIJob job = new UIJob("Table editor") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { TableDialog dialog = new TableDialog(part); int ret = dialog.open(); if (ret == 0) { String newTable = dialog.build(); ISourceRange range = part.getSourceRange(); editor.getViewer().setSelectedRange(range.getOffset(), 0); TextEdit edit = new ReplaceEdit(range.getOffset(), range.getLength(), newTable); try { edit.apply(editor.getDocument()); } catch (MalformedTreeException | BadLocationException e) { Log.error("Failed to insert new table in part " + part + " (" + e.getMessage() + ")"); return Status.CANCEL_STATUS; } } return Status.OK_STATUS; } }; job.setPriority(Job.INTERACTIVE); job.schedule(200); }
@Override public void execute(String newWorkingDir) { final IContainer[] c = ResourcesPlugin.getWorkspace().getRoot() .findContainersForLocation(getWorkingDirPath().append(path)); if (c != null && c.length > 0) { for (int i = 0; i < c.length; i++) { UIJob job = new RefreshContainerJob(c[i].getParent(), true); job.schedule(); } } }
@Override public void execute(String newWorkingDir) { try { final IContainer[] c = ResourcesPlugin.getWorkspace().getRoot() .findContainersForLocation(new Path(newWorkingDir)); if (c != null && c.length > 0) { for (int i = 0; i < c.length; i++) { UIJob job = new RefreshContainerJob(c[i], false); job.schedule(); } } } catch (Throwable e) { e.printStackTrace(); } }
@Override public void execute(String newWorkingDir) { final IContainer[] c = ResourcesPlugin.getWorkspace().getRoot() .findContainersForLocation(new Path(getWorkingDir()).append(path).removeLastSegments(1)); if (c != null && c.length > 0) { for (int i = 0; i < c.length; i++) { UIJob job = new RefreshContainerJob(c[i], true); job.schedule(); } } }
/** * Runs the specified runnable asynchronously in a worker thread. Caller is * responsible for ensuring that any UI behaviour in the runnable is * executed in the UI thread, either synchronously (synch exec through * {@link Display} or asynch through {@link Display} or {@link UIJob}). * @param runnable * @param operationLabel */ protected void runAsynchWithWizardProgress(final ICoreRunnable runnable, String operationLabel) { if (runnable == null) { return; } if (operationLabel == null) { operationLabel = ""; //$NON-NLS-1$ } // Asynch launch as a UI job, as the wizard messages get updated before // and after the forked operation UIJob job = new UIJob(operationLabel) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { CoreException cex = null; try { // Fork in a worker thread. CFUiUtil.runForked(runnable, getWizard().getContainer()); } catch (OperationCanceledException e) { // Not an error. User can still enter manual values } catch (CoreException ce) { cex = ce; } // Do not update the wizard with an error, as users can still // complete the wizard with manual values. if (cex != null) { CloudFoundryPlugin.logError(cex); } return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); }
public void navigate() { UIJob job = new UIJob(label) { public IStatus runInUIThread(IProgressMonitor monitor) { CFUiUtil.openUrl(location); return Status.OK_STATUS; } }; job.schedule(); }
public void navigateExternal() { UIJob job = new UIJob(label) { public IStatus runInUIThread(IProgressMonitor monitor) { CFUiUtil.openUrl(location, WebBrowserPreference.EXTERNAL); return Status.OK_STATUS; } }; job.schedule(); }
private void createRoutesDomainsSection() { Section routeSection = toolkit.createSection(getSection().getParent(), Section.TITLE_BAR | Section.TWISTIE); routeSection.setLayout(new GridLayout()); GridDataFactory.fillDefaults().grab(true, true).applyTo(routeSection); routeSection.setText(Messages.ApplicationMasterPart_TEXT_ROUTES); routeSection.setExpanded(true); routeSection.clientVerticalSpacing = 0; Composite client = toolkit.createComposite(routeSection); client.setLayout(new GridLayout(1, false)); GridDataFactory.fillDefaults().grab(true, true).applyTo(client); routeSection.setClient(client); Button button = toolkit.createButton(client, Messages.ApplicationMasterPart_TEXT_REMOVE_BUTTON, SWT.PUSH); GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(button); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { UIJob uiJob = new UIJob(Messages.ApplicationMasterPart_JOB_REMOVE_ROUTE) { public IStatus runInUIThread(IProgressMonitor monitor) { CloudRoutesWizard wizard = new CloudRoutesWizard(cloudServer); WizardDialog dialog = new WizardDialog(editorPage.getEditorSite().getShell(), wizard); dialog.open(); return Status.OK_STATUS; } }; uiJob.setSystem(true); uiJob.setPriority(Job.INTERACTIVE); uiJob.schedule(); } }); }
/** * @param selectedElement * The element to use as the context for launching */ public void run(final IJSBuildFileNode selectedElement) { UIJob job = new UIJob(JSBuildFileViewActionMessages.RunTaskAction_2) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { launch(selectedElement); return Status.OK_STATUS; } }; job.schedule(); }