Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] Codegen for GridBagConstraint


Hi Janak,


"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

07/12/2005 12:35 AM

Please respond to
Discussions people developing code for the Visual Editor project

To
"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc
Subject
RE: [ve-dev] Codegen for GridBagConstraint






1. set components SF of GridBagLayoutPane with value label - this is done
with a ruled command)
2. set containment SF of label with a JavaInstance of GridBagConstraints
class (our own, not awt) - this is not done in a ruled command. I am not
sure if it should be.


--- RLK -- Switch the order of 1 and 2 above and it should work. I think what is happening
is that using the RuledCommand for (1) will use the preset command for label, but
at that time the "containment" feature on label was not yet set, so the preset
didn't walk down to find it. Then when you used the regular command to set constraint,
there was no ruled command so it didn't get added correctly.

If you switched it, then you don't need to do ruledcommand to set the constraint because
when you use the ruled command to set the components feature the preset command will
automatically walk down and set the location for any setting (recursively) that was not
already located.

-------

--- RLK --- The following annotation should of worked if you went through a
ruledcommand, but I suspect it didn't because of the same reason as I mentioned above.
The constraint setting wasn't applied through a ruled command, nor was it applied
BEFORE the label was added to components.

------

GridBagConstraints is our own class. And I would like to generate a local
variable always.

So this option is feasible.

Question is how and where do I set the instance location?

Is it to be done in the  GridBagConstraint.override? How?

I tried the following but it had no effect:

<?xml version="1.0" encoding="UTF-8"?>
<event:AddMany xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.e
core" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
 xmlns:codeGenHelpers="platform:/plugin/org.eclipse.ve.java.core/overrides/
codegenHelpers.ecore"
   xmlns:event="event.xmi"
   featureName="eAnnotations">

 <addedEObjects xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator"
beanLocation="LOCAL"/>

 <addedEObjects xsi:type="codeGenHelpers:CodeGenHelperClass"
source="codegen.CodeGenHelperClass"
    modelled="true"/>
</event:AddMany>

>Default it. In this case it will do property setting (i.e. new XYZ() right
in the set method), or make it a variable if there is at least one
sub-property setting on it.

If I understood correctly, this is what is happening in VE for Swing, isn't
it?

If I add child in bean tree then new GridBagConstraints() is generated. Then
if I set a property on GridBagConstraint a variable is generated.

For a setting some property on GridBagConstraint, RuledPropertysetCommands
are generated which then create the local var by creating ApplyAttrSettings
command to set SFs initializes,  members, and properties.

The problem with my code is even though the RuledCommands are generated they
in turn do not generate the commands to create local var. I am trying to
figure out why?

--------------

As an aside:

1. I looked up your container.override.

2. The "components" SF has "containment = true"

3. This seems to be playing some role in handleValue of VCEPreset command.


--- RLK --- "components" is containment = "true" because it is NOT a java object,
it is our intermediate object. Because of that it can't be shared. IJavaInstances
can be shared, so features of type IJavaInstances should never be containment = "true".
preset will walk through features that are containment = "true" because they are already
contained. The purpose of the preset is to contain objects that are not already contained, which
in our model should always be IJavaInstances. Non-IJavaInstances should be contained.

-------
In our container ULCContainer.override the "components" SF has "containment
= false" -
This was done after consultation with Joe. But I have not fully understood
the significance of this.

What is the significance of "containment" being true or false?

--------

Thanks and regards,

Janak




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


Back to the top