X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/test/PHPParserSuperclass.java b/net.sourceforge.phpeclipse/src/test/PHPParserSuperclass.java index c500582..1dee6aa 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParserSuperclass.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParserSuperclass.java @@ -181,6 +181,40 @@ public abstract class PHPParserSuperclass { * This will set a marker. * @param file the file that generated the marker * @param message the message + * @param line the line number + * @param errorLevel the error level ({@link PHPParserSuperclass#ERROR}, + * {@link PHPParserSuperclass#INFO},{@link PHPParserSuperclass#WARNING}) + * @throws CoreException an exception throwed by the MarkerUtilities + */ + public static void setMarker(final IFile file, + final String message, + final int line, + final int errorLevel, + final String location) + throws CoreException { + if (file != null) { + final Hashtable attributes = new Hashtable(); + MarkerUtilities.setMessage(attributes, message); + switch (errorLevel) { + case Parser.ERROR : + attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR)); + break; + case Parser.WARNING : + attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING)); + break; + case Parser.INFO : + attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO)); + break; + } + attributes.put(IMarker.LOCATION,location); + MarkerUtilities.setLineNumber(attributes, line); + MarkerUtilities.createMarker(file, attributes, IMarker.PROBLEM); + } + } + /** + * This will set a marker. + * @param file the file that generated the marker + * @param message the message * @param charStart the starting character * @param charEnd the end character * @param errorLevel the error level ({@link PHPParserSuperclass#ERROR},