[nbdev] Annotation-driven top component

  • From: Peter Blemel < >
  • To: NetBeans Mailing list < >
  • Subject: [nbdev] Annotation-driven top component
  • Date: Thu, 31 Jan 2013 14:09:45 -0700
  • Importance: Normal

Hello World,

I am working my way through the New File Type tutorial again, after having created several multi view editors in the past by rolling my own classes.  The annotation based approach is certainly quicker and less confusing.

My question is : What's the correct way to set the TopComponent's display name  (the file name in the tab at the top of the TC)?

In my new project I do not need a text editor view/element, which is generated by default in the DataObject class's annotations.  It was easy enough to remove the generated @MultiViewElement.Registration.   It appears, however, as though the text editor element was responsible for setting the TC's display name.

After looking around the web, I see others are setting the display name in each additional view/element's setMultiViewCallback() method :

    @Override
    public void setMultiViewCallback(MultiViewElementCallback callback) {
        this.callback = callback;
        callback.getTopComponent().setDisplayName(dobj.getName());        
    }

It seems a little odd to delegate setting the TC's display name to a MultiViewElement.  Is there a more correct way to do it? 

Thanks,
Peter


[nbdev] Annotation-driven top component

Peter Blemel 01/31/2013

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close