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 - [69cat] EditorCookie.Observable in ConeableEditorSupport has incoherent (unfinished?) implementation
Summary: [69cat] EditorCookie.Observable in ConeableEditorSupport has incoherent (unfi...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: issues@editor
Keywords: API
Depends on:
Reported: 2010-04-15 10:39 UTC by jmborer
Modified: 2012-10-16 08:11 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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.