當前位置: 首頁>>代碼示例>>Java>>正文


Java IStatus.OK屬性代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.IStatus.OK屬性的典型用法代碼示例。如果您正苦於以下問題:Java IStatus.OK屬性的具體用法?Java IStatus.OK怎麽用?Java IStatus.OK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.core.runtime.IStatus的用法示例。


在下文中一共展示了IStatus.OK屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: applyToStatusLine

/** copied from PropertyAndPreferencePage */
private static void applyToStatusLine(DialogPage page, IStatus status) {
	String message = status.getMessage();
	if (message != null && message.length() == 0) {
		message = null;
	}
	switch (status.getSeverity()) {
	case IStatus.OK:
		page.setMessage(message, IMessageProvider.NONE);
		page.setErrorMessage(null);
		break;
	case IStatus.WARNING:
		page.setMessage(message, IMessageProvider.WARNING);
		page.setErrorMessage(null);
		break;
	case IStatus.INFO:
		page.setMessage(message, IMessageProvider.INFORMATION);
		page.setErrorMessage(null);
		break;
	default:
		page.setMessage(null);
		page.setErrorMessage(message);
		break;
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:25,代碼來源:AbstractN4JSPreferencePage.java

示例2: performFinish

/**
 * Creates the project, all the directories and files and open the .odesign.
 * 
 * @return true if successful
 */
@Override
public boolean performFinish() {
	try {
		// if user do not reach page 2, the VSM name is defined according to
		// the project name
		if (!newOdesignPage.isVsmNameChanged) {
			newOdesignPage.modelName.setText(newOdesignPage
					.extractModelName(newOdesignPage.firstPage
							.getProjectName()));
		}
		ViewpointSpecificationProject
				.createNewViewpointSpecificationProject(workbench,
						newProjectPage.getProjectName(), newProjectPage
								.getLocationPath(), newOdesignPage
								.getModelName().getText(), newOdesignPage
								.getInitialObjectName(), newOdesignPage
								.getEncoding(), getContainer());
		return true;
	} catch (final CoreException e) {
		final IStatus status = new Status(IStatus.ERROR,
				SiriusEditorPlugin.PLUGIN_ID, IStatus.OK, e.getMessage(), e);
		SiriusEditorPlugin.getPlugin().getLog().log(status);
		return false;
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:30,代碼來源:NewGemocSiriusProjectWizard.java

示例3: setGW4ENature

/**
 * Set the GW4E Nature to the passed project
 * 
 * @param project
 * @return
 * @throws CoreException
 */
public static IStatus setGW4ENature(IProject project) throws CoreException {
	IProjectDescription description = project.getDescription();
	String[] natures = description.getNatureIds();
	String[] newNatures = new String[natures.length + 1];
	System.arraycopy(natures, 0, newNatures, 0, natures.length);

	// add our id
	newNatures[natures.length] = GW4ENature.NATURE_ID;

	// validate the natures
	IWorkspace workspace = ResourcesPlugin.getWorkspace();
	IStatus status = workspace.validateNatureSet(newNatures);

	if (status.getCode() == IStatus.OK) {
		description.setNatureIds(newNatures);
		project.setDescription(description, null);
	}
	return status;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:26,代碼來源:GW4ENature.java

示例4: getStatus

/**
 * Returns the status of the operation. If there were any errors, the result is a status object containing
 * individual status objects for each error. If there were no errors, the result is a status object with error code
 * <code>OK</code>.
 *
 * @return the status
 */
public IStatus getStatus() {
	IStatus[] errors = new IStatus[errorTable.size()];
	errorTable.toArray(errors);
	return new MultiStatus(
			"org.eclipse.n4js.ui",
			IStatus.OK,
			errors,
			N4ExportMessages.FileSystemExportOperation_problemsExporting,
			null);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:17,代碼來源:AbstractExportOperation.java

示例5: addNature

private void addNature(IProject project) throws CoreException{
	if(!project.hasNature(ProjectNature.NATURE_ID)){
		IProjectDescription description = project.getDescription();
		String[] prevNatures = description.getNatureIds();
		String[] newNatures = new String[prevNatures.length + 3];
		System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
		newNatures[prevNatures.length] = ProjectNature.NATURE_ID;
		newNatures[prevNatures.length + 1] = JavaCore.NATURE_ID;
		newNatures[prevNatures.length + 2] = ORG_ECLIPSE_M2E_CORE_MAVEN2_NATURE;

		// validate the natures
		IWorkspace workspace = ResourcesPlugin.getWorkspace();
		IStatus status = workspace.validateNatureSet(newNatures); 
		ICommand javaBuildCommand= description.newCommand();
		javaBuildCommand.setBuilderName("org.eclipse.jdt.core.javabuilder");
		ICommand mavenBuildCommand= description.newCommand();
		mavenBuildCommand.setBuilderName("org.eclipse.m2e.core.maven2Builder");
		ICommand[] iCommand = {javaBuildCommand, mavenBuildCommand};
		description.setBuildSpec(iCommand); 
		// only apply new nature, if the status is ok
		if (status.getCode() == IStatus.OK) {
			description.setNatureIds(newNatures);
			project.setDescription(description, null);
		}
		logger.debug("Project nature added"); 
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:27,代碼來源:ProjectStructureCreator.java

示例6: throwCoreException

private void throwCoreException ( final String message ) throws CoreException
{
    final IStatus status = new Status ( IStatus.ERROR, "org.eclipse.scada.ca.ui.editor.wizard", IStatus.OK, message, null );
    throw new CoreException ( status );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:5,代碼來源:NewArchiveWizard.java

示例7: throwCoreException

private void throwCoreException(String message) throws CoreException {
	IStatus status = new Status(IStatus.ERROR, "osets-eclipse-plugin", IStatus.OK, message, null);
	throw new CoreException(status);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:4,代碼來源:InitAssemblyWizard.java

示例8: validateClassName

public static boolean validateClassName(String name) {
	String temp = name + ".java";
	IStatus status = JavaConventions.validateCompilationUnitName(temp, JavaCore.VERSION_1_8, JavaCore.VERSION_1_8);
	boolean b = (status.getCode() == IStatus.OK);
	return b;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:6,代碼來源:JDTManager.java

示例9: validateLinkedResource

protected IStatus validateLinkedResource() {
	return new Status(IStatus.OK, Activator.PLUGIN_ID, IStatus.OK, "", null);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:3,代碼來源:ImportEngineXmlWizardPage.java

示例10: throwCoreException

private void throwCoreException(String message) throws CoreException {
	IStatus status = new Status(IStatus.ERROR, EditorConfigPlugin.PLUGIN_ID, IStatus.OK, message, null);
	throw new CoreException(status);
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:4,代碼來源:NewEditorConfigWizard.java

示例11: throwCoreException

private void throwCoreException(String message) throws CoreException {
	IStatus status = new Status(IStatus.ERROR, "pt.iscte.perspective", IStatus.OK, message, null);
	throw new CoreException(status);
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:4,代碼來源:NewPackageWizard.java


注:本文中的org.eclipse.core.runtime.IStatus.OK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。