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


Java IMarker.SEVERITY_INFO屬性代碼示例

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


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

示例1: getSeverity

private int getSeverity() {
	IEditorInput editorInput = getEditorInput();
	if (editorInput == null) {
		return IMarker.SEVERITY_INFO;
	}
	try {
		final IResource resource = ResourceUtil.getResource(editorInput);
		if (resource == null) {
			return IMarker.SEVERITY_INFO;
		}
		int severity = resource.findMaxProblemSeverity(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
		return severity;
	} catch (CoreException e) {
		// Might be a project that is not open
	}
	return IMarker.SEVERITY_INFO;
}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:17,代碼來源:BatchEditor.java

示例2: createMarker

@Override
public void createMarker(Resource res, String message, Severity severity) {

	final int severityEclipse;
	switch (severity) {
	case INFO:
		severityEclipse = IMarker.SEVERITY_INFO;
		break;
	case WARNING:
		severityEclipse = IMarker.SEVERITY_WARNING;
		break;
	default:
		severityEclipse = IMarker.SEVERITY_ERROR;
		break;
	}

	try {
		IMarker marker = toIFile(res).createMarker(MARKER__ORG_ECLIPSE_IDE_N4JS_UI_COMPILER_ERROR);
		marker.setAttribute(IMarker.MESSAGE, message);
		marker.setAttribute(IMarker.SEVERITY, severityEclipse);
		marker.setAttribute(IMarker.LINE_NUMBER, 1);
	} catch (CoreException e) {
		LOGGER.error(e.getStatus());
		String resInfo = "";
		if (res != null) {
			if (res.getURI() != null) {
				resInfo = "on resource with uri=" + res.getURI();
			} else {
				resInfo = "on resource=" + res;
			}
		}
		throw new RuntimeException("Cannot create error marker with message='" + message + "' " + resInfo + ".", e);
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:34,代碼來源:GeneratorMarkerSupport.java

示例3: getTitleImageName

private String getTitleImageName(int severity) {
	switch (severity) {
	case IMarker.SEVERITY_ERROR:
		return "bash-editor-with-error.png";
	case IMarker.SEVERITY_WARNING:
		return "bash-editor-with-warning.png";
	case IMarker.SEVERITY_INFO:
		return "bash-editor-with-info.png";
	default:
		return "bash-editor.png";
	}
}
 
開發者ID:de-jcup,項目名稱:eclipse-bash-editor,代碼行數:12,代碼來源:BashEditor.java

示例4: getSeverityLevel

public static int getSeverityLevel(String severity)  {
	String temp = severity.trim();
	if (temp.equalsIgnoreCase("E")) {
		return IMarker.SEVERITY_ERROR;
	} else {
		if (temp.equalsIgnoreCase("W")) {
			return IMarker.SEVERITY_WARNING;
		} else {
			if (temp.equalsIgnoreCase("I")) {
				return IMarker.SEVERITY_INFO;
			} 
		}
	}
	return -1;	
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:15,代碼來源:BuildPolicy.java


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