Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] No Wirte JCMMethod found warning




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

01/23/2006 10:47 PM

Please respond to
Discussions people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>

To
"ve-Dev@Eclipse. Org" <ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] No Wirte JCMMethod found warning






Hi,

Issues:

1 Where can I find XMLViewPart class? Which jar?


--RLK -- It is in org.eclipse.ve.java.core plugin.

2. Our Model:
On a ULCComponent we have SF "containment" which holds attributes of the
layout when a component is contained in a container:

<event:Add featureName="eStructuralFeatures">
 <addedEObjects xsi:type="ecore:EReference" name="containment"
  eType="ecore:EClass java:/java.lang#Object"
  upperBound="1" changeable="true" unsettable="false"
  containment="true">
 </addedEObjects>
</event:Add>


-- RLK -- I don't know if this is the problem but you shouldn't have containment="true". ALL of our code expects all java instances to be contained as either "members" or "properties" in a MemberContainer. If a property setting is not contained by a member (which is what JCMMethod is), then I think it will fail.

On a ULCContainer we have SF "components" which holds contained components:

 <event:Add featureName="eStructuralFeatures">
  <addedEObjects xsi:type="ecore:EReference" name="components"
   eType="ecore:EClass java:/com.ulcjava.base.application#ULCComponent"
   upperBound="-1" changeable="true" unsettable="false"
   containment="false">
   <eAnnotations
xsi:type="org.eclipse.ve.internal.cde.decorators:PropertyDescriptorDecorator
" hidden="true"/>
   <eAnnotations
xsi:type="org.eclipse.ve.internal.jcm:BeanFeatureDecorator"
linkType="CHILD"/>
   <eAnnotations
xsi:type="org.eclipse.jem.internal.beaninfo.beaninfo:PropertyDecorator"
mergeIntrospection="false"/>
 </addedEObjects>
 </event:Add>

When a ULCComponent is added to a ULCContainer, we create a IJavaInstance
that has the layout properties of the component in the container. We set
this IJavaInstance as value of the SF "containment" on ULCComponent followed
by setting the ULCComponent as value of the SF "components" on ULCContainer.

For instance take ULCCardPane.
When we add ULCButton to ULCCardPane we create an IJavaInstance for

class CardPaneContainment {
    private String name:
    public String getName() { ... }
    public SetName(String s) {... }
 }

The value of ULCButton's "containment" SF is set to an instance of
CardPaneContainment which has some "name".
Then, ULCCardPane's "component" SF is set to ULCButton.

The genearted code is as follows:
  private ULCCardPane ulcCardPane = null; //
@jve:decl-index=0:visual-constraint="75,6"
  private ULCButton ulcButton = null;

private ULCCardPane getUlcCardPane() {
  if (ulcCardPane == null) {
     ulcCardPane = new ULCCardPane();
     ulcCardPane.setPreferredSize(new
com.ulcjava.base.application.util.Dimension(265,97));
     ulcCardPane.addCard("ulcButton", getUlcButton());
     // The first arg corresponds to "name" which is stored in the model as
feature
     // of CardPaneContainment instance which is set as value of SF
"containment" on ULCButton
  }
return ulcCardPane;
}

private ULCButton getUlcButton() {
  if (ulcButton == null) {
     ulcButton = new ULCButton();
  }
return ulcButton;
}


The problem:


At the time of adding ULCButton to ULCCardPane in the above example, I get a
warning "No Write JCMMethod found for EReferenceImpl (name : containment
...)"

The Commands I generate are as follows:


--- RLK-- Are you generating these directly, or are you using a RuledCommandBuilder? You should be using a RuledCommandBuilder.

ApplyAttributeSettingsCommand - sets "containment" SF on ULCButton
VCEPresetCommand - SF "component" on target ULCCardPane with value ULCButton
ApplyAttributeSettingsCommand - SF "component" on target ULCCardPane with
value ULCButton

It is during the last ApplyAttrSettingsCommnad that the above warning is
generated. Following is the stack trace:

SimpleAttributeDecoderHelper.generate(Object[]) line: 339
ObjectDecoder(AbstractExpressionDecoder).generate(EStructuralFeature,
Object[]) line: 210
CodeExpressionRef.generateSource(EStructuralFeature) line: 359
ExpressionRefFactory.createFromJVEModel(Object[]) line: 102
DefaultMethodTextGenerator(AbstractMethodTextGenerator).primGenerateAttribut
e(EStructuralFeature, BeanPart, Object[]) line: 218
DefaultMethodTextGenerator(AbstractMethodTextGenerator).generateAttribute(ES
tructuralFeature, BeanPart) line: 231
AbstractMethodTextGenerator$2.isSet(EStructuralFeature, Object) line: 262
JavaObjectInstance(JavaInstance).visitSetFeatures(FeatureValueProvider$Visit
or) line: 61
FeatureValueProvider$FeatureValueProviderHelper.visitSetFeatures(EObject,
FeatureValueProvider$Visitor) line: 53
AbstractMethodTextGenerator$1.generateFromFeatures(BeanPart) line: 253
DefaultMethodTextGenerator(AbstractMethodTextGenerator).generateForSetFeatur
es(BeanPart) line: 278
DefaultMethodTextGenerator(AbstractMethodTextGenerator).generateExpressionsC
ontent() line: 287
BeanPartFactory.generateInitMethod(BeanPart, IJavaObjectInstance,
CodeMethodRef, String, ICompilationUnit) line: 274
BeanPartFactory.createFromJVEModel(IJavaObjectInstance, ICompilationUnit)
line: 603
BeanDeclModel.lazyCreateBeanInstance(EObject) line: 279
BeanDeclModel.getABean(EObject) line: 298
BeanDecoderAdapter.addElement(Notification) line: 379
BeanDecoderAdapter.notifyChanged(Notification) line: 455
JavaObjectInstance(BasicNotifierImpl).eNotify(Notification) line: 229
EcoreEList$Dynamic(EcoreEList).dispatchNotification(Notification) line: 211
EcoreEList$Dynamic(NotifyingListImpl).addAllUnique(int, Collection) line:
423
EcoreEList$Dynamic(NotifyingListImpl).addAllUnique(Collection) line: 367
EcoreEList$Dynamic(BasicEList).addAll(Collection) line: 686
ApplyAttributeSettingCommand.execute() line: 92

Questions:

Why does this warning occur?
How serious is it?
Can it be ignored? If not how to avoid it (should I specify SF "containemt"
in ignoreSF of DefaultMethodTextGenerator? If so how?
How do I set the log level for JVEPlugin? IS it done through tracing in
Debug options?

Thanks and regards,

Janak

-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On
Behalf Of Srimanth Gunturi
Sent: Tuesday, December 27, 2005 9:49 PM
To: Discussions people developing code for the Visual Editor project
Subject: RE: [ve-dev] Model does not change on property set



Hi Janak,
       A good place to test whats going on is where the XMI viewer
refreshes its text.
XMLViewPart.XMLViewTextPage.refreshJob.run() gets the model and serializes
it out.
This is kicked into action everytime a transaction finishes (top-down or
bottom-up) on the
ModelChangeController. It could be that the commands being run on the
graphical view
are not going through the ModelChangeController, and hence the XML viewer
has no clue
something has changed. On the other hand, the PS and the source-refresh are
doing it
through the ModelChangeContoller and their changes are being shown up in the
XMLviewer.
It would be great if you could keep a breakpoint in that method and see if
you are actually
getting a notification from the ModelChangeController. Also you can check if
the model has
the correct settings in it there. Hope this helps.
Regards,
Sri.

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


Back to the top