Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Acces of node element from outside
Acces of node element from outside [message #1060672] Mon, 27 May 2013 16:08 Go to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hi,

I'm using Xtext and GMF and therefor I would like to acces the current selected node in my xtext project in order to get the child of this node exported.

index.php/fa/15066/0/

For exampple if Super Class 1 is selected, I want to acces this class in my xtext project to get the childs B and C. Is there a way to do this?
Re: Acces of node element from outside [message #1061090 is a reply to message #1060672] Wed, 29 May 2013 21:04 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
No ideas or is my question not clear enough?
Re: Acces of node element from outside [message #1061355 is a reply to message #1061090] Fri, 31 May 2013 10:16 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

try the selection service of Eclipse http://www.eclipse.org/articles/Article-WorkbenchSelections/article.html

Ralph
Re: Acces of node element from outside [message #1061873 is a reply to message #1060672] Tue, 04 June 2013 13:03 Go to previous message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hi,

thanks for the hint. I tried to implement the selection service, but it didn't seems to acces the GMF related node. Rather that I get an xtext class object, because I implmented an IXtextAwareEditPart in GMF. Is there a way to acces the active GMF node?
This code hasn't work for me so far:

ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
if (selection instanceof IStructuredSelection) {
	IStructuredSelection iStructuredSelection = (IStructuredSelection) selection;
	if (iStructuredSelection.getFirstElement() instanceof PartImpl) {
		PartImpl partImpl = (PartImpl) iStructuredSelection;  // <------ The xtext class
	}
}
Previous Topic:Property Selection Filter on Property Section
Next Topic:Multipage Editor: Page for certain nodes
Goto Forum:
  


Current Time: Thu Apr 25 05:59:01 GMT 2024

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

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

Back to the top