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.
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.
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
??? 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.
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.
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.
Thanks, I will try it.
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)
TopComponent.getActivatedNodes ()[i].getCookie (DataObject.class) will give you the top component.
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.
What is what I am talking about: Find the opened component and then do: tc.getActivatedNodes ()[i].getCookie (DataObject.class) on the component.
Set target milestone to TBD
I guess he is missing method like getOpenedNodes() (?? well sounds missleading).
reassigne to David K., new owner of editor
Implemented. *** This issue has been marked as a duplicate of 31101 ***
verified - it's duplicate.