Java Code Examples for org.eclipse.ui.texteditor.MarkerUtilities#getMarkerType()

The following examples show how to use org.eclipse.ui.texteditor.MarkerUtilities#getMarkerType() . 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: IssueUtil.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @deprecated As we are using IMarker.getAttributes() in {@link #createIssue(IMarker)}, we do not call this method any more
 * @since 2.3
 */
@Deprecated
protected CheckType getCheckType(IMarker marker) {
	String markerType = MarkerUtilities.getMarkerType(marker);
	if (markerTypeProvider != null)
		return markerTypeProvider.getCheckType(markerType);
	return MarkerTypes.toCheckType(markerType);
}
 
Example 2
Source File: IResourcesSetupUtil.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public static void assertNoErrorsInWorkspace() throws CoreException {
	IMarker[] findMarkers = ResourcesPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
	String msg = "";
	for (IMarker iMarker : findMarkers) {
		if (MarkerUtilities.getSeverity(iMarker) == IMarker.SEVERITY_ERROR)
			msg += "\n - "+iMarker.getResource().getName()+":"+MarkerUtilities.getLineNumber(iMarker)+" - "+MarkerUtilities.getMessage(iMarker) + "("+MarkerUtilities.getMarkerType(iMarker)+")";
	}
	if (msg.length()>0)
		Assert.fail("Workspace contained errors: "+msg);
}
 
Example 3
Source File: IResourcesSetupUtil.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public static void assertNoErrorsInWorkspace() throws CoreException {
	IMarker[] findMarkers = root().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
	String msg = "";
	for (IMarker iMarker : findMarkers) {
		if (MarkerUtilities.getSeverity(iMarker) == IMarker.SEVERITY_ERROR)
			msg += "\n - "+iMarker.getResource().getName()+":"+MarkerUtilities.getLineNumber(iMarker)+" - "+MarkerUtilities.getMessage(iMarker) + "("+MarkerUtilities.getMarkerType(iMarker)+")";
	}
	if (msg.length()>0)
		Assert.fail("Workspace contained errors: "+msg);
}
 
Example 4
Source File: JavaMarkerAnnotation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Tells whether the given marker can be treated as a Java annotation
 * which will later be update by JDT Core problems.
 *
 * @param marker the marker
 * @return <code>true</code> if the marker can be treated as a Java annotation
 * @since 3.3.2
 */
static final boolean isJavaAnnotation(IMarker marker) {
	// Performance
	String markerType= MarkerUtilities.getMarkerType(marker);
	if (IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER.equals(markerType) ||
			IJavaModelMarker.TASK_MARKER.equals(markerType) ||
			IJavaModelMarker.TRANSIENT_PROBLEM.equals(markerType) ||
		IJavaModelMarker.BUILDPATH_PROBLEM_MARKER.equals(markerType))
		return true;


	return MarkerUtilities.isMarkerType(marker, IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER);
}
 
Example 5
Source File: JavaMarkerAnnotation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public String getMarkerType() {
	IMarker marker= getMarker();
	if (marker == null  || !marker.exists())
		return null;

	return  MarkerUtilities.getMarkerType(getMarker());
}