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 184254

Summary: [69cat] EditorCookie.Observable in ConeableEditorSupport has incoherent (unfinished?) implementation
Product: platform Reporter: jmborer <jmborer>
Component: TextAssignee: issues@editor <issues>
Status: NEW ---    
Severity: normal CC: vv159170
Priority: P3 Keywords: API
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description jmborer 2010-04-15 10:39:45 UTC
EditorCookie.Observable has three problems:

1) EditorCookie.Observable notifies you for "openedPanes", but the new and old values are null.

2) It is therefore (see 1) impossible to distinguish open and close events: both trigger "openedPanes" and both have null values for old and new

3) The "openedPanes" event is triggered before any panes are available: the EditorCookie.getOpenPanes return null. Very annoying.

It seems I am still blocked with the current implementation of EditorCookie.Observable: I cannot register my listeners (Caret) to the opened panes since the event is triggered before they actually exist.

Any idea about a workaround?
Comment 1 jmborer 2010-04-15 11:00:28 UTC
It is apparently related to bug #23491. The latter shouldn't be closed since it seems not to be fixed...
Comment 2 jmborer 2010-04-15 11:17:38 UTC
Found a work around:

openedPanes is fire twice when opening:

1) from CloneableEditor.componentOpened() where the panes are still null
2) a bit latter CloneableEditor.$DoInitialize.initVisual() where the panes are not null this time.

I use the second one and it is OK. However I have two remarks:

1) Why is this event trigger twice? Especially from CloneableEditor.componentOpened() where the panes are not opened at all. It should be a "openTopComponent" event instead
2) When closing the editor, trigerring a "openedPanes" with the same arguments as when actually opening it is not nice at all. Whether another event like "closedPanes" should be triggered or use the arguments better: old!=null, new==null
Comment 3 Jiri Kovalsky 2010-05-27 08:01:19 UTC
Reported by NetCAT 6.9 participant.