org.eclipse.core.runtime.Status Java Examples

The following examples show how to use org.eclipse.core.runtime.Status. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KpsewhichRunner.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
    * 
    * @param command The command string to execute
    * @param resource The path to run the command in
    * @return Output from the command
    * @throws CoreException Thrown if running the external command generates an exception
    */
protected String run(String[] command, IResource resource) throws CoreException {
    // check if we are using console
       String console = null;
       if (TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.BUILDER_CONSOLE_OUTPUT)) {
           console = getProgramName();
       }
       
	extrun.setup(command, resource.getLocation().toFile().getParentFile(), console);
	
       String output = null;
       try {
               output = extrun.run();
           
       } catch (Exception e) {
           throw new CoreException(new Status(IStatus.ERROR, TexlipsePlugin.getPluginId(),
                   IStatus.ERROR, "Building the project: ", e));
       } finally {
           extrun.stop();
       }
       
       return output;
	
}
 
Example #2
Source File: DeleteApplicationCommand.java    From orion.server with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected IStatus validateParams() {
	try {
		/* read deploy parameters */
		ManifestParseTree manifest = application.getManifest();
		ManifestParseTree app = manifest.get("applications").get(0); //$NON-NLS-1$

		if (application.getName() != null) {
			appName = application.getName();
			return Status.OK_STATUS;
		}

		appName = app.get(CFProtocolConstants.V2_KEY_NAME).getValue();
		return Status.OK_STATUS;

	} catch (InvalidAccessException e) {
		return new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, e.getMessage(), null);
	}
}
 
Example #3
Source File: EnableSarlMavenNatureAction.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** Create the configuration job for a Java project.
 *
 * @param project the project to configure.
 * @return the job.
 */
@SuppressWarnings("static-method")
protected Job createJobForJavaProject(IProject project) {
	return new Job(Messages.EnableSarlMavenNatureAction_0) {

		@Override
		protected IStatus run(IProgressMonitor monitor) {
			final SubMonitor mon = SubMonitor.convert(monitor, 3);
			// Force the project configuration to SARL.
			SARLProjectConfigurator.configureSARLProject(
					// Project to configure
					project,
					// Add SARL natures
					true,
					// Force java configuration
					true,
					// Create folders
					true,
					// Monitor
					mon.newChild(3));
			return Status.OK_STATUS;
		}
	};
}
 
Example #4
Source File: NodeJSService.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IStatus validateSourcePath(IPath path)
{
	if (path == null || path.isEmpty())
	{
		return new Status(Status.ERROR, JSCorePlugin.PLUGIN_ID, Messages.NodeJSService_EmptySourcePath);
	}

	if (!path.toFile().isDirectory())
	{
		return new Status(Status.ERROR, JSCorePlugin.PLUGIN_ID, INodeJS.ERR_DOES_NOT_EXIST, MessageFormat.format(
				Messages.NodeJSService_NoDirectory_0, path), null);
	}

	if (!path.append(LIB).toFile().isDirectory())
	{
		return new Status(Status.ERROR, JSCorePlugin.PLUGIN_ID, MessageFormat.format(
				Messages.NodeJSService_InvalidLocation_0, LIB));
	}
	// TODO Any other things we want to check for to "prove" it's a NodeJS source install?

	return Status.OK_STATUS;
}
 
Example #5
Source File: EnableDisableInjectMetricsAction.java    From codewind-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public static void enableDisableInjectMetrics(CodewindApplication app, boolean enable) {
	Job job = new Job(NLS.bind(Messages.EnableDisableInjectMetricsJob, app.name)) {
		@Override
		protected IStatus run(IProgressMonitor monitor) {
			try {
				app.connection.requestInjectMetrics(app.projectID, enable);
				app.connection.refreshApps(app.projectID);
				return Status.OK_STATUS;
			} catch (Exception e) {
				Logger.logError("An error occurred changing inject metric setting for: " + app.name + ", with id: " + app.projectID, e); //$NON-NLS-1$ //$NON-NLS-2$
				return new Status(IStatus.ERROR, CodewindUIPlugin.PLUGIN_ID, NLS.bind(Messages.ErrorOnEnableDisableInjectMetrics, app.name), e);
			}
		}
	};
	job.schedule();
}
 
Example #6
Source File: RenameExperimentDialog.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
private void validateNewExperimentName() {

        String name = fNewExperimentName.getText();
        IWorkspace workspace = fExperimentFolder.getWorkspace();
        IStatus nameStatus = workspace.validateName(name, IResource.FOLDER);

        if ("".equals(name)) { //$NON-NLS-1$
            updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null));
            return;
        }

        if (!nameStatus.isOK()) {
            updateStatus(nameStatus);
            return;
        }

        IPath path = new Path(name);
        if (fExperimentFolder.getFolder(path).exists() || fExperimentFolder.getFile(path).exists()) {
            updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null));
            return;
        }

        updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); //$NON-NLS-1$
    }
 
Example #7
Source File: DocumentLineList.java    From tm4e with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void documentChanged(DocumentEvent event) {
	IDocument document = event.getDocument();
	try {
		int startLine = DocumentHelper.getStartLine(event);
		if (!DocumentHelper.isRemove(event)) {
			int endLine = DocumentHelper.getEndLine(event, false);
			// Insert new lines
			for (int i = startLine; i < endLine; i++) {
				DocumentLineList.this.addLine(i + 1);
			}
			if (startLine == endLine) {
				DocumentLineList.this.updateLine(startLine);
			}
		} else {
			// Update line
			DocumentLineList.this.updateLine(startLine);
		}
		invalidateLine(startLine);
	} catch (BadLocationException e) {
		TMUIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TMUIPlugin.PLUGIN_ID, e.getMessage(), e));
	}
}
 
Example #8
Source File: EC2CloudTLCInstanceParameters.java    From tlaplus with MIT License 6 votes vote down vote up
@Override
public IStatus validateCredentials() {
	// must not be null
	if (getIdentity() != null && getCredentials() != null) {
		// identity always starts with "AIKA" and has 20 chars
		if (getIdentity().matches("AKIA[a-zA-Z0-9]{16}")) {
			// secret has 40 chars
			if (getCredentials().length() == 40) {
				return Status.OK_STATUS;
			}
		}
	}
	return new Status(Status.ERROR, "org.lamport.tla.toolbox.jcloud",
			"Invalid credentials, please check the environment variables "
					+ "(AWS_ACCESS_KEY_ID & AWS_SECRET_ACCESS_KEY) are correctly "
					+ "set up and picked up by the Toolbox."
					+ "\n\nPlease visit the Toolbox help and read section 4 "
					+ "of \"Cloud based distributed TLC\" on how to setup authentication.");
}
 
Example #9
Source File: APKInstallJob.java    From Flashtool with GNU General Public License v3.0 6 votes vote down vote up
protected IStatus run(IProgressMonitor monitor) {
 	try {
File files = new File(instpath);
File[] chld = files.listFiles(new APKFilter());
LogProgress.initProgress(chld.length);
for(int i = 0; i < chld.length; i++){
	if (chld[i].getName().toUpperCase().endsWith(".APK"))
		AdbUtility.install(chld[i].getPath());
	LogProgress.updateProgress();
}
LogProgress.initProgress(0);
logger.info("APK Installation finished");
return Status.OK_STATUS;
 	}
 	catch (Exception e) {
 		e.printStackTrace();
 		logger.error(e.getMessage());
 		LogProgress.initProgress(0);
 		return Status.CANCEL_STATUS;
 	}
 }
 
Example #10
Source File: XtextEditorErrorTickUpdater.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public IStatus runInUIThread(final IProgressMonitor monitor) {
	IEditorSite site = null != editor ? editor.getEditorSite() : null;
	if (site != null) {
		if (!monitor.isCanceled() && editor != null) {
			if (titleImage != null && !titleImage.isDisposed()) {
				editor.updatedTitleImage(titleImage);
				titleImage = null;
			} else if (titleImageDescription != null) {
				Image image = imageHelper.getImage(titleImageDescription);
				if (editor.getTitleImage() != image) {
					editor.updatedTitleImage(image);
				}
				titleImageDescription = null;
			}
		}
	}
	if (monitor.isCanceled()) {
		return Status.CANCEL_STATUS;
	}
	return Status.OK_STATUS;
}
 
Example #11
Source File: JsonEditor.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 6 votes vote down vote up
protected void runValidate(final boolean onOpen) {
    ValidationOperation validationOperation = createValidationOperation(onOpen);
    SafeWorkspaceJob validationJob = new SafeWorkspaceJob("Update KaiZen Editor validation markers") {
        @Override
        public IStatus doRunInWorkspace(IProgressMonitor monitor) throws CoreException {
            validationOperation.run(monitor);
            return Status.OK_STATUS;
        }

        @Override
        public boolean belongsTo(Object family) {
            if (family instanceof ValidationOperation) {
                return getEditorInput().equals(((ValidationOperation) family).getEditorInput());
            }
            return false;
        }
    };
    Job.getJobManager().cancel(validationOperation);
    validationJob.schedule();
}
 
Example #12
Source File: AzureARMCloudTLCInstanceParameters.java    From tlaplus with MIT License 6 votes vote down vote up
@Override
public IStatus validateCredentials() {
	final String credential = System.getenv(AZURE_COMPUTE_SERVICE_PRINCIPAL_PASSWORD);
	final String identity = System.getenv(AZURE_COMPUTE_SERVICE_PRINCIPAL);
	final String subscription = System.getenv(AZURE_COMPUTE_SUBSCRIPTION);
	final String tenantId = System.getenv(AZURE_COMPUTE_TENANT);
	if (credential == null || identity == null || subscription == null || tenantId == null) {
		return new Status(Status.ERROR, "org.lamport.tla.toolbox.jcloud",
				"Invalid credentials, please check the environment variables "
						+ "(" + AZURE_COMPUTE_SERVICE_PRINCIPAL_PASSWORD + " & " + AZURE_COMPUTE_SERVICE_PRINCIPAL + " "
						+ "& " + AZURE_COMPUTE_TENANT + " and " + AZURE_COMPUTE_SUBSCRIPTION + ") are correctly "
						+ "set up and picked up by the Toolbox."
						+ "\n\nPlease visit the Toolbox help and read section 4 "
						+ "of \"Cloud based distributed TLC\" on how to setup authentication.");
	}
	return Status.OK_STATUS;
}
 
Example #13
Source File: GamlEditTemplateDialog.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
protected SourceViewer createViewer(final Composite parent) {
	final Builder editorBuilder = configuration.getEmbeddedEditorFactory().newEditor(resourceProvider);
	editorBuilder.processIssuesBy((issues, monitor) -> {
		IStatus result = Status.OK_STATUS;
		final StringBuilder messages = new StringBuilder();
		for (final Issue issue : issues) {
			if (issue.getSeverity() == Severity.ERROR) {
				if (messages.length() != 0) {
					messages.append('\n');
				}
				messages.append(issue.getMessage());
			}
		}
		if (messages.length() != 0) {
			result = createErrorStatus(messages.toString(), null);
		}
		final IStatus toBeUpdated = result;
		getShell().getDisplay().asyncExec(() -> updateStatus(toBeUpdated));
	});
	final EmbeddedEditor handle = editorBuilder.withParent(parent);
	partialModelEditor = handle.createPartialEditor(getPrefix(), data.getTemplate().getPattern(), "", true);
	return handle.getViewer();
}
 
Example #14
Source File: ConvertToHybridProjectHandler.java    From thym with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    
    IProject project = getProject(event);
    if(project != null ){
        final IProject theProject = project;//to pass to Job
        WorkspaceJob job = new WorkspaceJob(NLS.bind("Convert {0} to Hybrid Mobile project", project.getName())) {
            
            @Override
            public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
                HybridProjectCreator creator = new HybridProjectCreator();
                creator.convertProject(theProject, new NullProgressMonitor());
                return Status.OK_STATUS;
            }
        };
        job.schedule();
    }
    return null;
}
 
Example #15
Source File: Log.java    From JReFrameworker with MIT License 5 votes vote down vote up
public static void log(int severity, String string, Throwable e) {
	if(log == null){
		System.err.println(string + "\n" + e);
	} else {
		IStatus status = new Status(severity, Activator.PLUGIN_ID, string, e);
		log.log(status);
	}
}
 
Example #16
Source File: FlatDataLoader.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * From @see DelayableJob.IWorker
 */
public IStatus work(IProgressMonitor monitor, HashMap<String, Object> params){
	if (isSuspended()) {
		return Status.CANCEL_STATUS;
	}
	final TableViewer tv = (TableViewer) cv.getViewerWidget();
	if (filtered != null) {
		filtered.clear();
	}
	filtered = null;
	setQuery();
	applyQueryFilters();
	if (orderFields != null) {
		qbe.orderBy(false, orderFields);
	}
	if (monitor.isCanceled()) {
		return Status.CANCEL_STATUS;
	}
	raw = qbe.execute();
	if (monitor.isCanceled()) {
		return Status.CANCEL_STATUS;
	}
	UiDesk.asyncExec(new Runnable() {
		public void run(){
			// Avoid access to disposed table
			if (tv != null && !tv.getTable().isDisposed()) {
				tv.setItemCount(0);
				filtered = raw;
				tv.setItemCount(raw.size());
			}
		}
	});
	
	return Status.OK_STATUS;
}
 
Example #17
Source File: WebAppTabGroup.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private void createUpdateJob() {
  new WorkbenchJob("WebAppTabGroup") {
    @Override
    public IStatus runInUIThread(IProgressMonitor monitor) {
      ILaunchConfigurationTab tab = launchConfigurationDialog.getActiveTab();
      if (tab != null && !tab.getControl().isDisposed()) {
        launchConfigurationDialog.updateButtons();
        launchConfigurationDialog.updateMessage();
      }
      return Status.OK_STATUS;
    }
  }.schedule();
}
 
Example #18
Source File: JReFrameworker.java    From JReFrameworker with MIT License 5 votes vote down vote up
public static IStatus deleteProject(IProject project) {
	if (project != null && project.exists())
		try {
			project.delete(true, true, new NullProgressMonitor());
		} catch (CoreException e) {
			Log.error("Could not delete project", e);
			return new Status(Status.ERROR, Activator.PLUGIN_ID, "Could not delete project", e);
		}
	return Status.OK_STATUS;
}
 
Example #19
Source File: CordovaPlugin.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Checks if the given engine is compatible with this plug-in. Returns a
 * {@link MultiStatus} as there may be more than one reason for an engine to
 * fail.
 * 
 * @param engine
 * @return A WARNING or OK level status
 * 
 */
public IStatus isEngineCompatible(HybridMobileEngine engine) {
	if (supportedEngines == null || supportedEngines.isEmpty())
		return Status.OK_STATUS;
	MultiStatus status = new MultiStatus(HybridCore.PLUGIN_ID, 0,
			NLS.bind("Plug-in {0} is not compatible with {1} version {2}",
					new Object[] { getLabel(), engine.getName(), engine.getSpec() }),
			null);
	for (EngineDefinition definition : supportedEngines) {
		status.add(isDefinitionSatisfied(definition, engine));
	}
	return status;
}
 
Example #20
Source File: ExportConnectorArchiveOperation.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected IStatus addImplementationJar(final ConnectorImplementation implementation, final IFolder classpathFolder, final SourceRepositoryStore sourceStore, final IRepositoryStore implStore, final List<IResource> resourcesToExport) throws CoreException, InvocationTargetException, InterruptedException {
    final String connectorJarName = NamingUtils.toConnectorImplementationFilename(implementation.getImplementationId(), implementation.getImplementationVersion(),false) +".jar";
    final IFile jarFile = classpathFolder.getFile(Path.fromOSString(connectorJarName)) ;
    final String qualifiedClassName = impl.getImplementationClassname() ;
    String packageName ="" ;
    if(qualifiedClassName.indexOf(".")!= -1){
        packageName = qualifiedClassName.substring(0, qualifiedClassName.lastIndexOf(".")) ;
    }
    final PackageFileStore file =  (PackageFileStore) sourceStore.getChild(packageName, true) ;
    if(file != null){
        file.exportAsJar(jarFile.getLocation().toFile().getAbsolutePath(), false) ;
        if(includeSources){
            final IFolder srcFolder = implStore.getResource().getFolder(SRC_DIR) ;
            if(srcFolder.exists()){
                srcFolder.delete(true, Repository.NULL_PROGRESS_MONITOR) ;
            }
            srcFolder.create(true, true, Repository.NULL_PROGRESS_MONITOR) ;
            cleanAfterExport.add(srcFolder) ;

            final IPath path = file.getResource().getFullPath().makeRelativeTo(sourceStore.getResource().getFullPath()) ;
            final IFolder newFolder = srcFolder.getFolder(path) ;
            newFolder.getLocation().toFile().getParentFile().mkdirs() ;
            srcFolder.refreshLocal(IResource.DEPTH_INFINITE, Repository.NULL_PROGRESS_MONITOR) ;
            file.getResource().copy(newFolder.getFullPath(),true, Repository.NULL_PROGRESS_MONITOR) ;


            resourcesToExport.add(srcFolder) ;
        }
    }

    return Status.OK_STATUS ;
}
 
Example #21
Source File: LineWrappingTabPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void indentStyleChanged(int indentStyle) {
    Iterator<Category> iterator= fSelectionState.fElements.iterator();
    String currentKey;
       while (iterator.hasNext()) {
           currentKey= iterator.next().key;
       	try {
           	changeIndentStyle(currentKey, indentStyle);
       	} catch (IllegalArgumentException e) {
   			fWorkingValues.put(currentKey, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NO_SPLIT, indentStyle));
   			JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK,
   			        Messages.format(FormatterMessages.LineWrappingTabPage_error_invalid_value, currentKey), e));
   		}
       }
       fSelectionState.refreshState(fSelection);
}
 
Example #22
Source File: DownloadManager.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Download the remote content.
 * 
 * @param monitor
 */
protected IStatus download(IProgressMonitor monitor)
{
	SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.DownloadManager_downloadingContent,
			downloads.size());
	MultiStatus multi = new MultiStatus(CoreIOPlugin.PLUGIN_ID, IStatus.OK, null, null);
	completedDownloadsPaths = new ArrayList<IPath>(downloads.size());
	for (Iterator<ContentDownloadRequest> iterator = downloads.iterator(); iterator.hasNext();)
	{
		if (subMonitor.isCanceled())
		{
			// TODO Append to multi status and return that?
			return Status.CANCEL_STATUS;
		}

		ContentDownloadRequest request = iterator.next();
		request.execute(subMonitor.newChild(1));
		IStatus result = request.getResult();
		if (result != null)
		{
			if (result.isOK())
			{
				completedDownloadsPaths.add(request.getDownloadLocation());
				iterator.remove();
			}
			multi.add(result);
		}
		subMonitor.setWorkRemaining(downloads.size());
	}

	return multi;
}
 
Example #23
Source File: UndeployProcessOperation.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected IStatus undeploy(final IProgressMonitor monitor) {
    for (final AbstractProcess process : processes) {
        try {
            undeployProcess(process, monitor);
        } catch (Exception e) {
            BonitaStudioLog.error(e, EnginePlugin.PLUGIN_ID);
            return new Status(Status.ERROR, EnginePlugin.PLUGIN_ID, String.format("%s (%s): %s",process.getName(),process.getVersion(),e.getMessage()), e);
        }
    }
    return Status.OK_STATUS;
}
 
Example #24
Source File: Activator.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public boolean isAvailable() {
	boolean available = JhlClientAdapterFactory.isAvailable();
	if (!available && !loadErrorLogged) {
		getLog().log(new Status(IStatus.INFO, PLUGIN_ID, 0, getLoadErrors(), null));
		loadErrorLogged = true;
		org.tigris.subversion.clientadapter.Activator.getDefault().handleLoadErrors(this);
	}
	return available;
}
 
Example #25
Source File: DeployProcessOperation.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected IStatus openProcessEnablementProblemsDialog(final AbstractProcess process,
        final List<Problem> processResolutionProblems) {
    Display.getDefault().syncExec(new Runnable() {

        @Override
        public void run() {
            problemResolutionResult = createProcessEnablementProblemsDialog(process, processResolutionProblems)
                    .open();
        }

    });

    return problemResolutionResult == IDialogConstants.OK_ID ? Status.OK_STATUS : Status.CANCEL_STATUS;
}
 
Example #26
Source File: StaticHTMLPrviewPlugin.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private void deleteTempFile( )
{
	Job deleteJob = new Job( "Delete temporary files" ) { //$NON-NLS-1$

		protected IStatus run( IProgressMonitor monitor )
		{
			deleteFile( new File( getTempFolder( ) ) );
			return Status.OK_STATUS;
		}
	};
	deleteJob.setSystem( true );
	deleteJob.schedule( );
}
 
Example #27
Source File: ApplicationFileStore.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public IStatus build(IPath buildPath, IProgressMonitor monitor) {
    IPath applicationFolderPath = buildPath.append("application");
    IFolder applicationFolder = getRepository().getProject()
            .getFolder(applicationFolderPath.makeRelativeTo(getRepository().getProject().getLocation()));
    if (!applicationFolder.exists()) {
        try {
            applicationFolder.create(true, true, new NullProgressMonitor());
            getResource().copy(applicationFolder.getFile(getName()).getFullPath(), false, new NullProgressMonitor());
        } catch (CoreException e) {
            return e.getStatus();
        }
    }
    return Status.OK_STATUS;
}
 
Example #28
Source File: ExtractJob.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * If we've finished the job and it didn't fail, fire the specified completed
 * action.
 */
protected void maybeFireCompletedAction(IStatus jobStatus) {
  if (completedAction != null && jobStatus == Status.OK_STATUS) {
    Display.getDefault().asyncExec(new Runnable() {
      public void run() {
        completedAction.run();
      }
    });
  }
}
 
Example #29
Source File: DiagnosticHandler.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public Object execute(ExecutionEvent event) throws ExecutionException
{
	Job job = new Job("Getting Diagnostic Logs") //$NON-NLS-1$
	{

		@Override
		protected IStatus run(IProgressMonitor monitor)
		{
			final String content = getLogContent();
			UIUtils.getDisplay().asyncExec(new Runnable()
			{

				public void run()
				{
					DiagnosticDialog dialog = new DiagnosticDialog(UIUtils.getActiveShell());
					dialog.open();
					dialog.setText(content);
				}
			});
			return Status.OK_STATUS;
		}
	};
	EclipseUtil.setSystemForJob(job);
	job.schedule();

	return null;
}
 
Example #30
Source File: ShowHiddenNeighborsOperation.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
	for (NodePart neighborPart : shownNeighbors) {
		hidingModel.hide(neighborPart);
		neighborPart.deactivate();
	}
	return Status.OK_STATUS;
}