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.
dev build from Jun16. Every form file that is opened in editor is scaned during start and ASTree are created for it. There are more problems with the form loading. The use of source hierarchy should be avoided and information can be obtained directly from MDR bypassing the bridge that may perform more work than neceseary. Do we really need to load the form completely during IDE even if the component is not active? Cf. Java editor that does not do this and load the source lazily.
Created attachment 15781 [details] stack trace from AST building
This is a multiview issue - MultiviewTopComponent asks for the form designer element when opened, so form must be loaded. Could MVTC defer element creation until activated?
i'm not sure it's possible to do that..when you split the editor and put 2 forms next to each other, only one will be activated and the other will be only visible. with the change you propose, the one that is not activated will not show anything, until activated. BTW you can try to do it yourself. you get the showing/activated/deactivated callbacks in your element, so you can have only skeleton visual component on open, and later on componentActivated() callback do the loading of the form.
If the MultiViewTopComponent is not able to recognize whether it is visible, how can know it an element inside it?? Does anybody know how this is done in editor? I.e. how does it know when to load the document - if TopComponent.activated is not usable?
> when you split the editor and put 2 forms next to each other, only > one will be activated and the other will be only visible. But you can actually check for selected component (instead of activated), can't you?
CloneableEditor class (the Source element component) does use the componentShowing() for initialization of the document. Why cannot you do it the same way for formdesigner? I'd rather have everyhting setup and delegating correctly once the MVTC is thrown into the winsys and everyone can access it. eg. projects when closing a project iterate all the opened editor documents and check if the dataobject belongs to the project or not. without proper delegation at this point, the MVTC won't get closed. Most probably more usecases like that.
Ok, in such case we can do it on our side.
We postponed the form loading into the componentShowing() method (as suggested by mkleint). Unfortunately this doesn't solve this issue because multiview invokes componentShowing() from MultiViewCloneableTopComponent.componentOpened(). Multiview should invoke this method only if it is showing. Problematic stack trace: MultiViewPeer.showCurrentElement:228 MultiViewPeer.peerComponentOpened:178 MultiViewCloneableTopComponent.componentOpened:127
ok, I've fixed the MultiViewPeer stuff not to call componentShowing on elements when the multiview component itself is only opened. thanks for catching it.
Closed