[EMF Forms] Remove Create and Link Button on Table Control [message #1747261] |
Fri, 11 November 2016 07:26  |
Eclipse User |
|
|
|
Hi
We are showing a Reference with Containment : False using a Table Control using ViewModel. As the containment is sent to False, I dnt expect the user click on Creak and Link, he should only be allowed to Link as its an Association.
Coz currently I am able to click on Create and Link and it gets created as a new Element outside the actual Parent.
For Example.
Lets Say my model has School which contains Class and Student. Class has a EReference with Containment False to Student.
Problem 1:
Now when i open my Class Object in EMF Forms, i want to show list of Students in a Tabular Format without the Create and Link button coz an existing student in the school can only be attached to a Class.
Therefore i want to remove the Create and Link button.
Problem 2:
Lets say I want to keep the Create and Link button, in this case if i create a Student then i expect it to get attached to the School. But the Student object is created outside the school inside the ECP Project. Again the relationship is wrong. As in my model, School should contain the Student and Class refers to it.
Looking forward in support to solve this.
Regards
Vikash
|
|
|
Re: [EMF Forms] Remove Create and Link Button on Table Control [message #1747501 is a reply to message #1747261] |
Tue, 15 November 2016 08:59  |
Eclipse User |
|
|
|
Hi Vikash,
you have two possibilities.
You can either subclass the table or you can provide your own referenceservice which behaves as you want.
You must override the org.eclipse.emf.ecp.view.spi.table.swt.TableControlService#createNewElement(EClass, EObject, EStructuralFeature) for customizing the the creation of new model elements.
On how to register your reference service take a look at org.eclipse.emf.ecp.ui.view.swt.DefaultReferenceService and org.eclipse.emf.ecp.ui.view.swt.DefaultReferenceServiceFactory .
Cheers,
Eugen
|
|
|
Powered by
FUDForum. Page generated in 0.30487 seconds