Skip to content

Instantly share code, notes, and snippets.

@JanKoehnlein
Last active August 29, 2015 14:05
Show Gist options
  • Save JanKoehnlein/7b35aecde807eb317fcc to your computer and use it in GitHub Desktop.
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
@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