Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Remove Create and Link Button on Table Control
[EMF Forms] Remove Create and Link Button on Table Control [message #1747261] Fri, 11 November 2016 12:26 Go to next message
vikash singh is currently offline vikash singhFriend
Messages: 5
Registered: November 2016
Junior Member

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.

Re: [EMF Forms] Remove Create and Link Button on Table Control [message #1747501 is a reply to message #1747261] Tue, 15 November 2016 13:59 Go to previous message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 169
Registered: May 2015
Senior Member
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 .


Eugen Neufeld

Get professional Eclipse developer support:
Previous Topic:[EMF Forms] Save as XMI removes context menu commands
Next Topic:[EMF Forms] Custom Command in TreeViewer
Goto Forum:

Current Time: Sat May 28 14:07:48 GMT 2022

Powered by FUDForum. Page generated in 0.02098 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top