Skip to main content



      Home
Home » Archived » Visual Editor (VE) » setting name automatically
setting name automatically [message #111290] Mon, 21 November 2005 12:09 Go to next message
Eclipse UserFriend
Originally posted by: gioacchinomauri.libero.it

hi all,
When i add a JComponent in a container i need that the setName method of
the JComponent is automatically generated with as argument the member name.

Example:
If i add a JTextField textfield, i need that
textfield.setName("textfield") will generate in getJTextfield method.

Anyone can help me ?
Thanks
--gm
Re: setting name automatically [message #111338 is a reply to message #111290] Tue, 22 November 2005 16:50 Go to previous message
Eclipse UserFriend
Hello,
Since this is not default behavior, you can create your own custom
component (MyJTextField) which does this when dropped. Basically it
would involve having EditPolicies which generate the extra command to
set the name property on MyJTextField. You can use this tutorial as a
reference :
http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E /org.eclipse.ve.examples/org.eclipse.ve.example.customwidget /WebContent/index.html
Regards,
Sri.


gioacchino mauri wrote:
> hi all,
> When i add a JComponent in a container i need that the setName method of
> the JComponent is automatically generated with as argument the member name.
>
> Example:
> If i add a JTextField textfield, i need that
> textfield.setName("textfield") will generate in getJTextfield method.
>
> Anyone can help me ?
> Thanks
> --gm
>
Re: setting name automatically [message #611356 is a reply to message #111290] Tue, 22 November 2005 16:50 Go to previous message
Eclipse UserFriend
Hello,
Since this is not default behavior, you can create your own custom
component (MyJTextField) which does this when dropped. Basically it
would involve having EditPolicies which generate the extra command to
set the name property on MyJTextField. You can use this tutorial as a
reference :
http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E /org.eclipse.ve.examples/org.eclipse.ve.example.customwidget /WebContent/index.html
Regards,
Sri.


gioacchino mauri wrote:
> hi all,
> When i add a JComponent in a container i need that the setName method of
> the JComponent is automatically generated with as argument the member name.
>
> Example:
> If i add a JTextField textfield, i need that
> textfield.setName("textfield") will generate in getJTextfield method.
>
> Anyone can help me ?
> Thanks
> --gm
>
Previous Topic:Failed to execute runnable-java.lang.NoSuchMethodError...
Next Topic:Redistributing the VE as a product
Goto Forum:
  


Current Time: Tue Jul 22 08:38:14 EDT 2025

Powered by FUDForum. Page generated in 0.04806 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top