Re: [tasklist] tasklist/editor/TaskEditorListener

Tor Norbye <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.tasklist.devel
Message-ID <Pine.GSO.4.10.10303061507501.18622-100000@norbye>
On Thu, 6 Mar 2003, Tim Lebedkov wrote:

 | Hi,
 | 
 | I try to change the TL/compiler module so it shows the errors in a new view
 | but sometimes core/GoToTaskAction does not work.
 | I suppose it is because TL/compiler module does not depend on TL/editor
 | and TL/editor/TaskEditorListener is not yet registered as tasklist/compiler
 | is loaded.

Hm, that's strange. Is this because you call GoToTaskAction between the
TaskListView has been opened? 

As soon as componentOpened is called on TaskListView, it looks up and
finds the editor listeners.  TaskListView.show() (which is what
GoToTaskAction calls) then uses these listeners.

A simple fix would be for TaskListView.show() to call registerListeners()
first (to make sure it's always done before trying to use the listener
array), and then to add a check to registerListeners such that it's only
run once (e.g. an "isInitialized" boolean field.)

 | On the other hand TaskEditorListener depends only on openide module. So it
 | would be
 | possible to rewrite TL/core/GoToTaskAction so it uses openide directly to
 | show a line and
 | remove TL/editor/TaskEditorListener.

Yes, that should be possible, except I've been talking to David Konecny
offline about the possibility to do something more advanced with editor
annotations (such that you can click on the glyph itself to bring up
confirmation details, etc. etc.)  I also want to try to change the
annotation type icon to match the suggestion, instead of having a generic
lightbulb icon for all. Anyway, this may require some API changes. Getting
those changes into openide is pretty hard - changing OpenAPI takes a
couple of U.N. Resolutions :) Getting a change to the editor module may be
easier, and in that case the tasklist annotations functionality will be
bound to the editor module.

 | Also I found only one class that implements TL/core/TaskViewListener:
 | TL/editor/TaskEditorListener.
 | So if the usage of Lookup.lookup(TaskViewListener.class) is not neccessary I
 | could
 | delete it too.

Yup. We should be able to move annotation showing into tasklist core, such
that the only thing the editor module does is register a margin-menu
action for adding a task.  However, as I mentioned above we may be able to
get more out of the editor annotations and then removing it now would mean
additional work.

-- Tor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.