Last active
August 29, 2015 14:05
-
-
Save JanKoehnlein/7b35aecde807eb317fcc to your computer and use it in GitHub Desktop.
An example selection listener to open an Xtext element in the editor given its URI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject IURIEditorOpener editorOpener | |
... | |
selectionListener = [ event | | |
val selection = event.selection as IStructuredSelection | |
if(selection.size == 1) { | |
val selectedElement = selection.firstElement | |
if(selectedElement instanceof URI) | |
editorOpener.open(selectedElement, true) | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment