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.

Bug 14424 - Missing info on what to replace Line.mark* with
Summary: Missing info on what to replace Line.mark* with
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-08-15 01:27 UTC by Jesse Glick
Modified: 2008-12-22 19:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
two_new_chapters_into_text_package_documentation (10.91 KB, text/html)
2001-08-21 16:30 UTC, David Konecny
Details
two_new_chapters_into_text_package_documentation - once more now from the path without spaces in the name (10.91 KB, text/html)
2001-08-21 16:32 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-08-15 01:27:36 UTC
Line.markError etc. is deprecated but the deprecation gives no clue as
to what to replace it with. It says you can attach annotations but where
do you get e.g. an error annotation from? Please improve the Javadoc (or
reassign to me with explanation of what it should say).
Comment 1 David Konecny 2001-08-15 08:17:36 UTC
Jesse, this issue is on my TODO list. I will try to fix it till the 
end of this week - the chapter or two in Text package documentation 
must be rewritten as well. 

In case you filed this issue because you need to use Line.markError 
and just don't know how, let me know and I will assist (it is quite 
easy).
Comment 2 David Konecny 2001-08-21 16:30:44 UTC
Created attachment 2253 [details]
two_new_chapters_into_text_package_documentation
Comment 3 David Konecny 2001-08-21 16:32:46 UTC
Created attachment 2255 [details]
two_new_chapters_into_text_package_documentation - once more now from the path without spaces in the name
Comment 4 David Konecny 2001-08-21 16:38:58 UTC
Jesse,

I attached to this issue proposal for two new chapters into Text 
package documentation (download second attachment). They will replace 
current chapters "Using IDE special attributes" and "Handling IDE 
special attributes" in text package documentation. I would like to ask 
you (if you have a time of course) to read it and let me know if there 
are answers for all your questions and if it is what you 
required. Comments/criticism are welcome.

David
Comment 5 Jesse Glick 2001-08-22 12:08:28 UTC
OK, I will look at what you have and try to merge it into the Editor
API documentation. I can at least put in a first draft and either you
or I can revise it later if needed. Thanks!
Comment 6 David Konecny 2001-08-22 12:23:58 UTC
OK and many thanx for your help. I feel that this is what I should 
do, but my English is not so good and APIs should be clear.

I read through the Editor API document and there are four places which 
have to be fixed. I already mentioned two chapters - these should be 
removed 
and replaced by the ones I have prepared. The remaing two parts are:
* Contents - the links to the deleted chapters should be updated
* Implementing a Custom Editor - "Be able to mark certain lines of the 
document..." should contain also some mention about glyph gutter 
icons. And a few lines 
below there is "or background colors for IDE markings" - this should 
be at least replaced by mention about annotations.

Just let me know in case I could help somehow...
Comment 7 Jesse Glick 2001-08-22 20:59:42 UTC
The main thing I am missing is the answer to the original question: if
I have:

Line l = ...;
l.markError();

this is deprecated and what should it be replaced with? It seems you
need to get an "error" annotation from somewhere or other and
attach(l), but it is not at all obvious where the annotation comes
from. That is, the document is missing any helpful information for a
client of the API, it is focussed on the SPI (service provider).
Comment 8 David Konecny 2001-08-23 09:58:55 UTC
What have changed is that there is no definition of errorline, 
breakpointline anymore. The modules which want to use new version of
l.markError()
must provide their own ErrorAnnotation which extends 
openide.text.Annotation and the ErrorAnnotation requires to define XML 
file which describes the visual appearance of the ErrorAnnotation.

So, your code:

Line l = ...;
l.markError();

must be replaced by:

Annotation errorAnno = new Annotation() {
  public abstract String getAnnotationType() {
    return "your_type";
  }

  public abstract String getShortDescription() {
    return "your_tooltip_text";
  }
}
Line l = ...;
errorAnno.attach(l)

// and the XML file for the "your_type" must be defined

Is this answer to your question?
Comment 9 Jesse Glick 2001-08-23 15:09:40 UTC
Yes, I suppose so. It seems odd that every module providing error
lines would have to create a separate error annotation however; I can
think of offhand:

- org.openide.compilers.*

- Ant (hyperlinked errors in script output)

- apisupport layer parsing (XML syntax errors)

- probably any XML support module

Etc. These will all need to be separate annotation types? And the user
will need to e.g. configure colors for them all separately? ("Current"
and "breakpoint" are clearly debugger-specific but "error" is a pretty
general concept.) Given that, I would not be motivated to try to
replace the deprecated code!

Anyway this is enough for me to go on when documenting the API,
thanks.
Comment 10 Jesse Glick 2001-08-25 16:43:27 UTC
OK, now documented in Editor API, please check it sometime for
accuracy.
Comment 11 David Konecny 2001-08-27 12:47:45 UTC
Jesse,

I read the APIs and it looks good (and very nice with color syntex). 
Thank you very much for all improvements. I'm going to close this 
issue as verified.

To your previous question about using annotation for marking of 
errors. You are right, but I think the same approach should be applied 
as in debugger: 

There can be more implementation of debuggers. For example Java 
debugger, C++ debugger and they all share debuggercore module which 
contains definition of basic annotation types. 

So in case of compiler errors: I would also recommend to define some 
compiler error annotation type which all the compilers could share. 
Maybe the Compiler API is right place for this annotation type?
Comment 12 Quality Engineering 2003-07-01 16:15:36 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.