本文整理汇总了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;
}
示例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);
}
}
示例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";
}
}
示例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;
}