NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

[platform-dev] Question about non-singleton TopComponent

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Hermann Matthes
Posted via mailing list.





PostPosted: Fri Jul 13, 2012 2:11 pm    Post subject: [platform-dev] Question about non-singleton TopComponent Reply with quote

Hello,
I have a non-singleton TopComponent which displays items in an outline
view. The users enters query criteria in a query dialog and when the
result is received from the server, a fresh TopComponent is created and
opened.

The OutlineView is filled using the following statement:
explorerManager.setRootContext(new AbstractNode(Children.create(new
ItemChildFactory(items), true)));

I create a child factory (ItemChildFactory), which automatically
registers itself at an EventNotifier (The EventNotifier uses
WeakReferences for the listenerList).

When the user closes the TopComponent,
explorerManager.setRootContext(Node.EMPTY);
is called in TopComponent.componentClosed()

I thought, that this causes the garbage collector to remove the child
factory. But a trace shows, that the EventNotifier still informs the
child factory about new events.

Can anybody tell me what to do to destroy the child factory ?

Thanks in advance
Hermann
Back to top
Jockey10



Joined: 06 Nov 2009
Posts: 10

PostPosted: Sat Jul 14, 2012 6:21 am    Post subject: Reply with quote

Could you just recreate the ExplorerManager instance instead of emptying the children? ie;

Code:
 explorerManager = new ExplorerManager();


Or is that going to create more issues?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo