Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ve-dev] Adding Code for setting a property programatically

Hi All,
I am trying to add  code using the context menu programatically. I
have defined a context menu using
'objectClass="org.eclipse.ve.internal.java.core.IJavaBeanContextMenuContributor"
'.
I was successful in adding the code for setting a property if it is a
text property . For example,


EStructuralFeature esf = model.eClass().getEStructuralFeature("name");
ResourceSet rs = model.eResource().getResourceSet();
IJavaObjectInstance ijoi = BeanUtilities.createString(rs,"Field1");
RuledCommandBuilder cb = new
RuledCommandBuilder(EditDomain.getEditDomain(editpart));
cb.applyAttributeSetting((EObject) model, esf, ijoi);
Command command = cb.getCommand();
command.execute();

I also want to add code for setting a property that has a method call
to a object creation method as the attribute. For Example

field.setProperty(getField2());

Any help in this regards is greatly appreciated.
Thank You and Regards,
SOLOMON


Back to the top