Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Create a dynamic custom control(ECP 1.2)
Create a dynamic custom control [message #1263292] Tue, 04 March 2014 10:48 Go to next message
Bryan Beck is currently offline Bryan BeckFriend
Messages: 1
Registered: March 2014
Junior Member
Hi,

i want to create a custom control, without specificing a "hardcoded" references within the getNeededDomainModelReferences() as it is documented in the CustomControls Tutorial Section.
In the tutorial, a VFeaturePathDomainModelReference is created for "User_LastName" and "User_Gender".

For my custom control, i want to set this VFeaturePathDomainModelReference's based on the current selection within the TreeNavigator.
So is there any api in ECP 1.2 where i can get the currently selected DomainObject?

The API from ECP 1.1 org.eclipse.emf.ecp.edit.spi.ECPAbstractControl#ECPControlContext getModelElementContext().getModelElement() was removed in ECP 1.2, as i can see here.
Also, ECPAbsractControl.getViewModelContext().getDomainModel() is not initialized at this point


Thanks in advance Smile
Re: Create a dynamic custom control [message #1264817 is a reply to message #1263292] Wed, 05 March 2014 14:29 Go to previous message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 63
Registered: March 2012
Member
Hi Bryan,

Thank you for your message.

A custom control based on the current selection will most probably be implemented without any dependencies on the actual selection. This would be something like the BooleanControl. It just doesn't care what you select, the tester provided by the control just ensures, that the attribute which is about to be shown is of a specific type.

If you want to create a custom control which has domain specific behavior, then you will need to know the actual selected object which was selected. This is ensured by the tester of the custom control.

I might be wrong Wink, but are you maybe trying to implement some kind of a master detail view, you might want to look at the TreeMasterDetail model.

Maybe you could provide some more detail to your usecase, so I can give you better advice.

Cheers,
Eugen

--
Eugen Neufeld

Get Professional Eclipse Support: http://eclipsesource.com/munich
Previous Topic:ECP API not available - HTTP Error 404
Next Topic:[Texo] Ordered bidirecional relationship, join colums and mapped by
Goto Forum:
  


Current Time: Tue Mar 19 05:00:59 GMT 2024

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

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

Back to the top