This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Excerpt from email from jglick: ---------------------------------------------------------------------- In an issue relating to documentation of annotations: http://www.netbeans.org/issues/show_bug.cgi?id=14424 I balked for a while before understanding that every module was, in fact, supposed to define its own annotations, and that the API defines none. In the case of error annotations this seems somewhat odd, since the old and now deprecated API provides this functionality. After a while I did implement special annotations for the Ant module, but it was not trivial and I would hate to do it again. "Current" and "breakpoint" are clearly debugger notions, but "error" is pretty general. Most of the time you want things to behave like this: - a line with a hyperlink is displayed in the Output Window - the source, if open, gets an annotation (red X perhaps?) at a corresponding place, with some tool tip listing the error message - the OW line if selected, moves an open display to that line; if double-clicked, forcibly opens and fronts it, also displaying the error in the status bar - the line in the editor, if edited by the user, is cleared of its annotation (i.e. the error was possibly corrected) - if the OW tab is closed, the annotation goes away All of this functionality is cumbersome to reimplement every time, since it is pretty standard stuff. I would suggest some standard implementation (in org.openidex.text maybe?) that would: - define the annotation type in a layer, with a known name, and a reasonable glyph and color selection (red) - provide a Java API something like this: public abstract class ErrorAnnotation extends Annotation implements OutputListener { public ErrorAnnotation(); /** the error message to show in tooltip and status bar */ protected abstract String error(); /** could be a Line or Line.Part */ protected abstract Annotatable line() throws IOException; // now impl all abstract methods of Annotation and OutputListener, // all final } Maybe it also needs to ask subclasses for a Document, or maybe you should give only a Document and a line number (assuming it will use Line.getOriginal()), or something like this. You could use it by printing a line to the Output Window with it as a listener. Then when clicked it would attach itself. Does it sound useful? Please take a look at org.apache.tools.ant.module.run.OutputWriterOutputStream.Hyperlink by way of comparison. ---------------------------------------------------------------------- Right now the error annotation, its handling, etc. is done in three different places. Some generic solution should be created to prevent duplication of code.
LayerDataNode in apisupport could use this too.
reassigne to David K., new owner of editor
Changing TM to FUTURE. This issue is not planned for next version. Feel free to disagree.
Reassigning to new module owner mslama.