Guest User

Untitled

a guest
Apr 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public Object execute(ExecutionEvent event) throws ExecutionException {
  2. IWorkbenchPart part = HandlerUtil.getActivePart(event);
  3. ISelection selection = part.getSite().getSelectionProvider().getSelection();
  4. if (selection instanceof ITextSelection) {
  5. ITextSelection s = (ITextSelection) selection;
  6. if (s.getLength() > 0)
  7. MessageDialog.openInformation(new Shell(), "Selected SNippet", s.getText());
  8. }
  9. return null;
  10. }
Add Comment
Please, Sign In to add comment