| How can I get resources which contain errors [message #287252] |
Tue, 28 June 2005 05:12  |
Eclipse User |
|
|
|
Originally posted by: denis.roudet.rd.francetelecom.com
Hello,
I am developping a plug-in which make tests on Java classes. I want to
inform the user (with a message dialog) when he launches tests on classes
which contain errors. So, does anyone know a method which do this ? I have
got the resources on which the user want to make tests but I don't find
methods to detect compilation erros.
Thanks.
Denis
|
|
|
| Re: How can I get resources which contain errors [message #287265 is a reply to message #287252] |
Tue, 28 June 2005 11:17  |
Eclipse User |
|
|
|
This is a multipart message in MIME format.
--=_alternative 005400EDC125702E_=
Content-Type: text/plain; charset="US-ASCII"
Hi Denis,
I would call the method findMarkers(String type, boolean includeSubtypes,
int depth)on IResource. Where the type would be something like
org.eclipse.core.resources.problemmarker.
That should return you an array of markers of the given type. So you just
need to know which marker type you are looking for. And if for example
error markers are found your resource has some kind of errors. Look at the
JDT plugins, they might introduce special marker types for compilation
errors, I dont know.
hth regards,
-philipp
--=_alternative 005400EDC125702E_=
Content-Type: text/html; charset="US-ASCII"
<br><font size=2 face="sans-serif">Hi Denis,</font>
<br>
<br><font size=2 face="sans-serif">I would call the method </font><a href=" http://help.eclipse.org/help30/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/core/resources/IResource.htm l#findMarkers(java.lang.String, boolean, int)"><font size=3 color=blue><tt><b><u>findMarkers</u></b></tt></font> </a><font size=3><tt>(</tt></font><a href= http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.htm l><font size=3 color=blue><tt><u>String</u></tt></font></a><font size=3><tt> type,
boolean includeSubtypes, int depth)</tt></font><font size=2 face="sans-serif">on
IResource. Where the type would be something like </font><font size=3><tt>org.eclipse.core.resources.problemmarker</tt></font ><font size=3>.
</font>
<br>
<br><font size=3>That should return you an array of markers of the given
type. So you just need to know which marker type you are looking for. And
if for example error markers are found your resource has some kind of errors.
Look at the JDT plugins, they might introduce special marker types for
compilation errors, I dont know.</font>
<br>
<br>
<br><font size=3>hth regards,</font>
<br><font size=3>-philipp</font>
--=_alternative 005400EDC125702E_=--
|
|
|
Powered by
FUDForum. Page generated in 0.02587 seconds