Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » setting name automatically
setting name automatically [message #111290] Mon, 21 November 2005 17: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 21:50 Go to previous message
Srimanth  is currently offline Srimanth Friend
Messages: 225
Registered: July 2009
Senior Member
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 21:50 Go to previous message
Srimanth  is currently offline Srimanth Friend
Messages: 225
Registered: July 2009
Senior Member
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: Fri Apr 26 05:54:26 GMT 2024

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

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

Back to the top