Hi Lars,
I am not able to get the instance of IObservableValue" when running
the below code for EMF DataBinding.
I have used these plug-ins for databinding purpose:
- "org.eclipse.core.databinding" ,"org.eclipse.emf.databinding" and
"org.eclipse.emf.databinding.edit".
IObservableValue is available in "org.eclipse.core.databinding".
CO_Person is an interface that is extending EObject interface and
there is CO_PersonImpl class that is implementing CO_Person and
extending EObjectImpl class.
I have created a EMFDataBindingView as per your example and using
CO_Person. I am getting error in "createPartControl()" method when
tring to bind values using bindingContext.bindValue().
public void createPartControl(Composite parent) {
// Lets put thing to order
Layout layout = new GridLayout(2, false);
parent.setLayout(layout);
private CO_Person coPerson;
// Initialize the model
PersonPackage.eINSTANCE.eClass();
// Retrieve the default factory singleton
PersonFactory factory = PersonFactory.eINSTANCE;
coPerson = factory.createCO_Person();
GenericName fname = new GenericNameImpl();
fname.setValue("Ajay");
coPerson.setFirstName(fname);
GenericName lname = new GenericNameImpl();
lname.setValue("Chauhan");
coPerson.setLastName(lname);
EmailAddress email = new EmailAddressImpl();
email.setValue("
ajay.c...@ps.net");
coPerson.getEmailAddresses().add(email);
Label firstLabel = new Label(parent, SWT.NONE);
firstLabel.setText("FirstName: ");
// New text element
Text firstName = new Text(parent, SWT.BORDER);
firstName.setText("");
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
firstName.setLayoutData(gridData);
DataBindingContext bindingContext = new DataBindingContext();
bindingContext.bindValue(SWTObservables.observeText(firstName,
SWT.Modify), EMFObservables.observeValue
(coPerson,PersonPackage.Literals.CO_PERSON__FIRST_NAME), null, null);
Exception details:
java.lang.NoClassDefFoundError: org/eclipse/core/databinding/
observable/value/IObservableValue
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension
(RegistryStrategyOSGI.java:170)
at
Please let me know the reasons why it is not being available as I have
used "org.eclipse.core.databinding" plug-in in my application
Thanks & Regards,
Ajay Chauhan