NetBeans Forums

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

Bug? componentShowing() before componentOpened()

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Mvek



Joined: 31 Oct 2011
Posts: 43
Location: Prague, Czech Republic

PostPosted: Fri Apr 06, 2012 6:02 pm    Post subject: Bug? componentShowing() before componentOpened() Reply with quote

Hi, can someone confirm, if it is bug? If I put a TopComponent into mode Explorer and then open from there new window via:

Code:
 DocEditTopComponent tc = new DocEditTopComponent();
tc.open();
tc.requestActive();


So without specifying the mode, then in the DocEditTopComponent class the method componentShowing() is called before the componentOpened().

If I moved the same opened window from explorer to editor mode and called this same action again, it worked correctly!

(NetBeans Platform Application, NB IDE 7.1.1)
Back to top
NeilCSmith



Joined: 08 Aug 2011
Posts: 19

PostPosted: Sat Apr 07, 2012 8:21 am    Post subject: [platform-dev] Re: Bug? componentShowing() before componentOpened() Reply with quote

Hi,
Not a bug, at least according to this page - http://wiki.netbeans.org/DevFaqAppLifecycleHooks
The order of the various hooks is not guaranteed or consistent. Personally, I wish it was, as it caused me a headache too!
Best wishes,
Neil
--
Neil C Smith
Artist : Technologist : Adviser
address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi, can someone confirm, if it is bug? If I put a TopComponent into mode Explorer and then open from there new window via:


Code:
Back to top
Mvek



Joined: 31 Oct 2011
Posts: 43
Location: Prague, Czech Republic

PostPosted: Tue Apr 10, 2012 7:16 pm    Post subject: Re: [platform-dev] Re: Bug? componentShowing() before componentOpened() Reply with quote

NeilCSmith wrote:
Hi,
Not a bug, at least according to this page - http://wiki.netbeans.org/DevFaqAppLifecycleHooks
The order of the various hooks is not guaranteed or consistent. Personally, I wish it was, as it caused me a headache too!
Best wishes,
Neil


Thx, it is really "great"...
But ok, I don't need it, I just have a feeling, I had a problem with componentOpened when needed to get the active TC, which opened this TC. It at some point worked badly, so I moved it to componentActivated(), but then sometime get another problem and moved part back. And found this "problem".

Luckily it seems, returning all code to componentActivated() works well, so OK.
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