Java Code Examples for org.eclipse.core.resources.IResource.findMaxProblemSeverity()

The following are Jave code examples for showing how to use findMaxProblemSeverity() of the org.eclipse.core.resources.IResource class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: eclipse-batch-editor   File: BatchEditor.java   Source Code and License Vote up 6 votes
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;
}
 
Example 2
Project: eclipse-bash-editor   File: BashEditor.java   Source Code and License Vote up 6 votes
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;
}
 
Example 3
Project: eclipse-batch-editor   File: BatchEditor.java   Source Code and License Vote up 5 votes
/**
 * Set initial title image dependent on current marker severity. This will
 * mark error icon on startup time which is not handled by resource change
 * handling, because having no change...
 */
private void setTitleImageInitial() {
	IResource resource = resolveResource();
	if (resource != null) {
		try {
			int maxSeverity = resource.findMaxProblemSeverity(null, true, IResource.DEPTH_INFINITE);
			setTitleImageDependingOnSeverity(maxSeverity);
		} catch (CoreException e) {
			/* ignore */
		}
	}
}
 
Example 4
Project: eclipse-bash-editor   File: BashEditor.java   Source Code and License Vote up 5 votes
/**
 * Set initial title image dependent on current marker severity. This will
 * mark error icon on startup time which is not handled by resource change
 * handling, because having no change...
 */
private void setTitleImageInitial() {
	IResource resource = resolveResource();
	if (resource != null) {
		try {
			int maxSeverity = resource.findMaxProblemSeverity(null, true, IResource.DEPTH_INFINITE);
			setTitleImageDependingOnSeverity(maxSeverity);
		} catch (CoreException e) {
			/* ignore */
		}
	}
}