Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] RE: Need Help


In general every feature will have a decoder and _expression_ associated with it.  The question is not just on the top/down generation side, but what should be done bottom up... i.e.,
if you have no code associated with the feature, will you need to reCreate it  when you parse the code in and it that case how?

An example of this will be in the SWT case, where we have two features:   controls, allocation.

allocation, the feature that denotes how to instantiate the object and is related to the Constructor _expression_ for all JavaBeans

        MyControl = new MyControl(myShell, SWT.NONE);

The controls feature is the SWT feature that designate the container/child relationship (e.g., a button inside a composite), and will determine, within others, the z order of the child.

In some cases, if the Control is a composite we create an init method for the Control, so the control feature will be associated with the following _expression_:

private void createMyShell() {
       myShell = new Shell();        
         createMyControl() <------------------------  controls _expression_ will determine the z order
       

}


private void createMyControl() {
        .....
                MyControl = new MyControl(myShell, SWT.NONE);                        <--------------allocation _expression_ ... constructor feature and will be used by the target VM

}


In other cases, when the Control is not a composite, we will reUse the container's init method:


private void createMyShell() {
       myShell = new Shell();        
         MyControl = new MyControl(myShell, SWT.NONE);                        <--------------allocation _expression_
       

}


.... here we get a case where there is NO code associated with the controls feature, but we need to create it during parsing.... in the later case the allocation _expression_ drives the z order on behalf of the controls feature.


CodeGen does create a CodeExpressionRef for the control feature in the last case, but it marks it with the STATE_NO_SRC flag.

... this area is changing with https://bugs.eclipse.org/bugs/show_bug.cgi?id=72561 ... but check out the CompositeAddDecoderHelper.





The isChildValue() is being used to determine if the feature refers to a value that potentially have a instance variable or a local variable associated with it.






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



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

09/01/2004 04:46 PM

Please respond to
ve-dev

To
Dr Gili Mendel/Raleigh/IBM@IBMUS
cc
"Sibylle. Peter@Canoo. Com" <sibylle.peter@xxxxxxxxx>, "Joe Winchester" <WINCHEST@xxxxxxxxxx>, Srimanth Gunturi/Raleigh/IBM@IBMUS, Rich Kulp/Raleigh/IBM@IBMUS, <ve-dev@xxxxxxxxxxx>
Subject
[ve-dev] RE: Need Help





Dear VE Team:

We have a Structural feature setting on a bean for which No Source should be
generated.

Please refer to the "containment" SF in the attached override file.

1. How should we handle this?

2. In the following method of ObjectDecoder, for the above SF we get
isChildValue = true. What does this mean?

protected boolean isChildValue(EStructuralFeature sf, IJavaInstance val,
boolean checkAttributes) {
   if (sf == null || val == null || !(val instanceof IJavaObjectInstance))
return false ;
   // Known SF to be ignored
   if (MethodTextGenerator.isNotToBeCodedAttribute(sf,(EObject)val)) return
false ;
   // Known Instances to be ignored
   if (isSimpleObject((IJavaObjectInstance)val)) return false ;
   if (checkAttributes)
     if (! isAnyAttributeSet((IJavaObjectInstance)val)) return false ;

   return true ;

3. For the above SF we would like the
MethodTextGenerator.isNotToBeCodedAttribute(sf,(EObject)val) to return true
because we donot want any source generated while setting a value on the SF.

I hope I have provided sufficient info for you to answer the questions.

Thanks and regards,

Janak

Attachment: ULCComponent.override
Description: Binary data


Back to the top