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 18290 - There is not possible to listen on opened editor panes.
Summary: There is not possible to listen on opened editor panes.
Status: VERIFIED DUPLICATE of bug 31101
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords: API
Depends on:
Blocks: 18026 21975
  Show dependency tree
 
Reported: 2001-12-03 13:49 UTC by Jan Jancura
Modified: 2008-12-22 19:35 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Jancura 2001-12-03 13:49:26 UTC
We (debugger) need to add some annotations to newly opened editor pane. But
there is no way how to listen on editor pane open / close. See property:
http://www.netbeans.org/download/apis/org/openide/cookies/EditorCookie.html#getOpenedPanes()

So we must add all existing annotations during startup of IDE. Thats really bad
for startup performance. Do you know some beter workarround?
Can it be fixed for NB3.3.1?
Thanks.
Comment 1 _ ttran 2001-12-03 13:57:22 UTC
Jan, it's really bad that you start filing such kind of bugs that late
in release cycle.  It's even worse that it requests API changes.

No way we will do it for NB 3.3.x
Comment 2 Jan Jancura 2001-12-03 14:54:04 UTC
???
Why is it bad to file some bug during feature freeze? Do we have some
bugfreeze? ;-)

Ou, sorry I understand.
But our original bug is one weak old, so I added bug to core as soon
as I investigated the problem. Its up on you when it will be fixed and
if its RFE or bug. But I think that you agree that its good to have it
in issuezilla as soon as possible.
Comment 3 Peter Zavadsky 2001-12-03 15:33:20 UTC
I think there is a way:
You should listen on TopComponent.Registry, i.e. particulary on
PROP_OPENED event fired and in that case retrieve what you need.
Eithre directly TC's from Registry.getActivated or getOpened methods, or
from getActivatedNodes and retrieve the editor cookie accordingly.

The rest what you need should maintain in your module.

CC Yarda, who knows much more about it, maybe he knows better solution.
If there should be the API changed later? Passing the question to
Yarda too.
 
Comment 4 Jaroslav Tulach 2001-12-04 08:58:47 UTC
Peter, you are right, this is a solution. Hanz, if you can build your
code around what Peter suggested, but separate it somehow so when
something better will be implemented you will not have problems to
change your implementation.
Comment 5 Jan Jancura 2001-12-04 09:27:00 UTC
Thanks,
I will try it.
Comment 6 Peter Zavadsky 2002-01-29 09:54:38 UTC
Eval.: The need is to have a possibility to get LineCookie (for
setting annotations), from opened/closed editor.

Currently TopComponent.Regitsry fires a PROP_OPENED prop change where
is possible to retrieve the TC's which were and are opened, thus which
are closed as well. But there is no nice way to get Node (DataObject)
which belong to the TC, thus not nice way to get LineCookie etc.

The solution probably will imply an API change. So there is needed to
discuss it, whether it is enough to make some possiblity to get from
TC to which node (dataobject) belongs if there is such. Moreover if
this is suffiecient for solving of this issue. (e.g. whether there
should be also fired a something like "PROP_CLOSED", saving the
necessary extraction from PROP_OPENED old/new values... or some other
changes)
Comment 7 Jaroslav Tulach 2002-01-29 12:30:37 UTC
TopComponent.getActivatedNodes ()[i].getCookie (DataObject.class) will
give you the top component.
Comment 8 Peter Zavadsky 2002-01-29 16:45:03 UTC
As I understood Hans the right way, he needs to take actions when TC's
are opened and closed, i.e. it isn't enough for him to listen just on
activated nodes, but rather on PROP_OPENED. And then somehow get the
related nodes(dataObjects) to the just opened/closed TC's, to do his work.
Comment 9 Jaroslav Tulach 2002-01-30 09:07:28 UTC
What is what I am talking about: Find the opened component and then
do: tc.getActivatedNodes ()[i].getCookie (DataObject.class) on the
component.
Comment 10 Marek Grummich 2002-07-22 11:25:13 UTC
Set target milestone to TBD
Comment 11 Marek Grummich 2002-07-22 11:27:51 UTC
Set target milestone to TBD
Comment 12 Peter Zavadsky 2002-07-25 16:01:07 UTC
I guess he is missing method like getOpenedNodes() (?? well sounds
missleading).
Comment 13 Marian Mirilovic 2002-12-06 17:17:58 UTC
reassigne to David K., new owner of editor
Comment 14 David Konecny 2003-02-27 16:27:54 UTC
Implemented.

*** This issue has been marked as a duplicate of 31101 ***
Comment 15 Marian Mirilovic 2003-07-21 16:18:46 UTC
verified - it's duplicate.