Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Ask for explanations VE
Ask for explanations VE [message #95764] Sat, 02 July 2005 11:50 Go to next message
Eclipse UserFriend
Originally posted by: dsf.sdf.net

Hello,

i would like to understand several things:
- why when i create a SWT or Swing label, the code is included in the
Shell/contentPane getter while for a combo box (for example), a new
getter is created. Is it possible to "force" the creation of a getter
for all the component? Why is it that way?

- for the same reason i guess, if i create a JPanel/Composite into the
JFrame/Shell, i can move (drag&drop) the combo box in the
JPanel/Composite but i can't do it for a label. Is it on purpose? Can it
be changed?

NB: for SWT, the same as labels applies to text fields, check boxes,
radio buttons, buttons, and may be others.

TIA
Re: Ask for explanations VE [message #96323 is a reply to message #95764] Wed, 06 July 2005 15:12 Go to previous messageGo to next message
Gili Mendel is currently offline Gili MendelFriend
Messages: 338
Registered: July 2009
Senior Member
name wrote:
> Hello,
>
> i would like to understand several things:
> - why when i create a SWT or Swing label, the code is included in the
> Shell/contentPane getter while for a combo box (for example), a new
> getter is created. Is it possible to "force" the creation of a getter
> for all the component? Why is it that way?
>
> - for the same reason i guess, if i create a JPanel/Composite into the
> JFrame/Shell, i can move (drag&drop) the combo box in the
> JPanel/Composite but i can't do it for a label. Is it on purpose? Can it
> be changed?
>
> NB: for SWT, the same as labels applies to text fields, check boxes,
> radio buttons, buttons, and may be others.
>
> TIA

The current pattern in VE is to create a SWT container (Composite and such) in a separate method, and for a regular
Control to reUse its Container method. Getters are not used in SWT, as the creation of a SWT control determine its Z order.

In Swing, the default is for every component to have its own getter method. Labels are the exception, as Labels usually
not have many settings. For a large class, the goal is to have compact code.


VE does not allow a user to configure scoping at time, but it is something that will come in the future.
The decision of if to generate a getter() in Swing, or a method call in SWT is determined by the VE override files.

see:
org.eclipse.ve.jfc\overrides\java\awt\Label.override:
<addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="GLOBAL_LOCAL"/>
GLOBAL_LOCAL implies an instance variable, reUsing its container's init method.

org.eclipse.ve.jfc\overrides\java\awt\Component.override
<addedEObjects xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator" beanLocation="GLOBAL_GLOBAL"
GLOBAL_GLOBAL implies an instance variable and a separate init method

org.eclipse.ve.swt\overrides\org\eclipse\swt\widgets\Item.ov erride
<addedEObjects xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator" beanLocation="LOCAL"/>
For Items, VE will reUse its parent's method and a local variable


If a variable is defined within its parent's method, we do not allow you to drag it from one container to another. This
is mainly because it can cause problems: VE will have to move the code initializing this component to the new
container's init method. In the SWT case, the parent must be created before you can create the child. Also, there may
be some code associated with the component that VE does not model (like for loops, reference to the component in events
and such) that will produce compile error if we move the component.

These are all solvable problems, but require some more time/effort.
Re: Ask for explanations VE [message #96809 is a reply to message #96323] Fri, 08 July 2005 07:49 Go to previous message
Eclipse UserFriend
Originally posted by: mr.smith.vous.etes.dans.la.matrice.com

On Wed, 06 Jul 2005 11:12:14 -0400
Gili Mendel <gmendel@us.ibm.com> wrote:

> > [...]

thx a lot for your explanations. I will try to modify the "override" files as soon as i have time.
Re: Ask for explanations VE [message #608971 is a reply to message #95764] Wed, 06 July 2005 15:12 Go to previous message
Gili Mendel is currently offline Gili MendelFriend
Messages: 338
Registered: July 2009
Senior Member
name wrote:
> Hello,
>
> i would like to understand several things:
> - why when i create a SWT or Swing label, the code is included in the
> Shell/contentPane getter while for a combo box (for example), a new
> getter is created. Is it possible to "force" the creation of a getter
> for all the component? Why is it that way?
>
> - for the same reason i guess, if i create a JPanel/Composite into the
> JFrame/Shell, i can move (drag&drop) the combo box in the
> JPanel/Composite but i can't do it for a label. Is it on purpose? Can it
> be changed?
>
> NB: for SWT, the same as labels applies to text fields, check boxes,
> radio buttons, buttons, and may be others.
>
> TIA

The current pattern in VE is to create a SWT container (Composite and such) in a separate method, and for a regular
Control to reUse its Container method. Getters are not used in SWT, as the creation of a SWT control determine its Z order.

In Swing, the default is for every component to have its own getter method. Labels are the exception, as Labels usually
not have many settings. For a large class, the goal is to have compact code.


VE does not allow a user to configure scoping at time, but it is something that will come in the future.
The decision of if to generate a getter() in Swing, or a method call in SWT is determined by the VE override files.

see:
org.eclipse.ve.jfc\overrides\java\awt\Label.override:
<addedEObjects xsi:type="jcm:BeanDecorator" beanLocation="GLOBAL_LOCAL"/>
GLOBAL_LOCAL implies an instance variable, reUsing its container's init method.

org.eclipse.ve.jfc\overrides\java\awt\Component.override
<addedEObjects xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator" beanLocation="GLOBAL_GLOBAL"
GLOBAL_GLOBAL implies an instance variable and a separate init method

org.eclipse.ve.swt\overrides\org\eclipse\swt\widgets\Item.ov erride
<addedEObjects xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator" beanLocation="LOCAL"/>
For Items, VE will reUse its parent's method and a local variable


If a variable is defined within its parent's method, we do not allow you to drag it from one container to another. This
is mainly because it can cause problems: VE will have to move the code initializing this component to the new
container's init method. In the SWT case, the parent must be created before you can create the child. Also, there may
be some code associated with the component that VE does not model (like for loops, reference to the component in events
and such) that will produce compile error if we move the component.

These are all solvable problems, but require some more time/effort.
Re: Ask for explanations VE [message #609004 is a reply to message #96323] Fri, 08 July 2005 07:49 Go to previous message
Eclipse UserFriend
Originally posted by: mr.smith.vous.etes.dans.la.matrice.com

On Wed, 06 Jul 2005 11:12:14 -0400
Gili Mendel <gmendel@us.ibm.com> wrote:

> > [...]

thx a lot for your explanations. I will try to modify the "override" files as soon as i have time.
Previous Topic:VE conflicts with WTP
Next Topic:Migrating Visual classes from Websphere to Eclipse
Goto Forum:
  


Current Time: Thu Apr 25 16:55:06 GMT 2024

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

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

Back to the top