Open TopComponent with MultiViewElements programmatically

"pacobm" <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
Birdasaur wrote:
> 
> pacobm wrote:
> > 
> > > Nothing is impossible in this world if there is effort and God wants it all can certainly happen.
> > 
> > 
> > Yeah sure... but can you help me with this, guide me with some tip to focus my effort?
> 
> 
> Ha! God doesn't use stackoverflow like the rest of us?
> 


 .....oooh, really?!! :? ...welll I hope this  [Wink] 



> 
> Let's see if we can help you. Ok so when you say 3 MultiViewElement, you are referring to a multi view which provides source/visual/history a la the standard tutorials, but each of your views provides an alternative Visual tab?
> 


Yes, each of my MVE are custom, any of the standard provided by Netbeans. It matters in this case?


> 
> 
> >  but I don't know how to reference the TopComponent class
> 
> Are you defining this TopComponent class yourself?  Do you not have scope to it?  Is the TopComponent defined in a different module?  
> 


No, I don't have any reference because in any moment I declare a TopComponent class, only for the MVE and register they for the mime-type of the DataObject they open.


> 
> 
> >  in all 3 MultiViewElement's I have initialization code that I would to centralize in the TopComponent
> 
> You could create a TopComponent class and either extend it for each DataObject type, or maybe have a static block that does the initiatlization.
> Or...
> Make a base MultiViewElement class, centralize the initialization code there and extend that instead.  That might be cleaner.


Could I create a TopComponent and then inside its declaration, create the MVE? In this case, how I register the TopComponent with the required mimne-type?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.