Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Showing Properties of EObjects without Selection(Populating Properties View without explicitly selecting an EMF Object )
Showing Properties of EObjects without Selection [message #1805411] Sun, 14 April 2019 16:08 Go to next message
Muti Ur Rehman is currently offline Muti Ur RehmanFriend
Messages: 1
Registered: March 2019
Junior Member
Hello Everyone,

I am working with Nebula NatTables and EMF , and I would like to implement a Table Based Editor.
I am Displaying EMF Objects in Table but the SelectionEvent on Table Cell returns the Selected Cell instead of underlying Eobject.

However it gives a possibility to get the underlying object by a method such as:

if (event instanceof CellSelectionEvent) {
CellSelectionEvent cellEvent = (CellSelectionEvent) event;


Object input =
natTable.getDataValueByPosition(cellEvent.getColumnPosition(),
cellEvent.getRowPosition());

if (input instanceof EObject)
{
EObject selectedObject = (EObject)input;
}

At this point , I wish to trigger the properties View to display the properties of this EObject in Properties View.

Could someone please help me with how can I display this EObject in the Properties View.

Many Thanks!
Re: Showing Properties of EObjects without Selection [message #1805528 is a reply to message #1805411] Tue, 16 April 2019 18:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30461
Registered: July 2009
Senior Member
The entry point for updating a property sheet page is org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(IWorkbenchPart, ISelection) so you must present a selection containing EObjects. You'll find an example in around this line:

https://git.eclipse.org/c/emf/org.eclipse.emf.git/tree/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/util/FindAndReplaceTarget.java#n1155

This code is used to support the find dialog and has logic for searching the contents of the property sheet page and logic for showing the property sheet page and setting the selection of that page.

In the generated editors you'll find UnwrappingSelectionProvider is used. Somehow you should ensure that the editor's selection isn't just a cell selection but something more general that the properties vie will recognize.
Previous Topic:How to generate model from meta-model?
Next Topic:[XCore] Javadoc style comments?
Goto Forum:
  


Current Time: Sun Sep 22 10:31:39 GMT 2019

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

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

Back to the top