Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] GetterStyle /Template for BeanName/


In your example, the new JLable() is not fully qualified.  Is this a requirement too?

In the future you should post these kind of question on the news group...  

In any case, you do not change the codegen template to achieve the name property settings, but rather, you want to set this property on a drop.  This will require you to:
        1. know what to name your component in advance
        2. set the name property on the drop.

A simple way to achive this is to introduce a new "My Label" entry on the palette that will automatically set the name property.

For 1.  you can either maintain the naming yourself, or use the default naming.
For 2. see the manner that we drop a JTable on a Scroll pane from the palette....   org.eclipse.ve.jfc\palette\JTableWithScrollPane.xmi
        This is where a JTableWithScrollPane is defined to be a JScrollPane with the viewportView property set to a JTable.  The annotation reflects the default naming for each.
        Look also on the jfc plugin palette contribution org.eclipse.ve.jfc\palette\javavisualbeanscats.xmi

      <cmpEntries xsi:type="palette:EMFPrototypeToolEntry"  
                      icon16Name="platform:/plugin/org.eclipse.ve.jfc/icons/full/clcl16/tableonscrollpane_obj.gif"
          prototypeURI="platform:/plugin/org.eclipse.ve.jfc/palette/JTableWithScrollPane.xmi#JScrollPane_1">
        <entryLabel xsi:type="utility:TranslatableString" key="Palette.Entry.JTableOnJScrollPane" bundle="bundle"/>
      </cmpEntries>  



------------
Dr. Gili Mendel
IBM
Software Development
RTP Raleigh, NC
(919)543 6408, tie: 441 6408



Extern.Balazs.Endredi@xxxxxxx
Sent by: ve-dev-admin@xxxxxxxxxxx

05/11/2004 07:23 AM

Please respond to
ve-dev

To
ve-dev@xxxxxxxxxxx
cc
Subject
[ve-dev] GetterStyle /Template for BeanName/





Hi,

I have a small problem with the Eclipse visual editor:
The name property of the beans is necessary for our applications. It will be
used as a translation key.
We need the following style:

                private JLabel jLabelFirstName = null;

                private JLabel getJLabelFirstName() {
                                 if(jLabelFirstName == null) {
                                                  jLabelFirstName = new JLabel();
                                                  jLabelFirstName.setName("FirstName");
                                                  ...
                                 }
                                 return jLabelFirstName;
                }
}
Is it possible to set this template?
Thanks!
Best regards,

Balázs Endrédi

_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top