Selection Listeners [message #756707] |
Mon, 14 November 2011 13:18  |
Eclipse User |
|
|
|
Hello together,
Simple Scenario: I have a RCP Application with a Graphiti-Editor-View and a TableView.
To react on selection changes within the GraphitiEditor I use the selection listener provided by the ToolBehaviorProvider.
When I select a shape within the diagram I get the corresponding business object in this way:
public PictogramElement getSelection(PictogramElement originalPE, PictogramElement[] oldSelection) { IFeatureProvider featureProvider = getFeatureProvider();
Object businessObject = featureProvider.getBusinessObjectForPictogramElement(PictogramElement);
if (businessObject instanceof Process) {
System.out.println("It is a process");
}
...
Now I want to display some properties of the selected (shape) business object in the table view.
As it seems to me, the Eclipse-way to do this is by adding a selection listener to the tableViewer.
But the problem with this is that I only get internal Graphiti objects from the selection listener e.g. Type: org.eclipse.graphiti.ui.internal.parts.ContainerShapeEditPart
I think I can't use these internal Graphiti objects to get the underlying business object as it was possible in the ToolBehaviorProvider.
Does anyone has an Idea how to solve this issue elegantly in the model view controller way? I am a liitle bit lost at the moment. In fact I don't know how to handover the business object to the tableView without violating the MVC paradigm.
I hint or explanation would make me very happy.
Best regards
Bjoern
[Updated on: Mon, 14 November 2011 13:20] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.26231 seconds