public void init(IWorkbench workbench, IStructuredSelection selection) {
   this.selection = selection;
   IWorkingSet workingSet = SelectionUtil.getSelectedWorkingSet(selection);
   if (workingSet != null) {
     this.workingSets.add(workingSet);
   }
 }
예제 #2
0
  protected void copySelection(final Point selectionStart, final Point selectionEnd) {
    if (selectionStart == null || selectionEnd == null) {
      return;
    }

    final String selectionText =
        SelectionUtil.getSelectionText(selectionStart, selectionEnd, myTerminalTextBuffer);

    if (selectionText.length() != 0) {
      try {
        setCopyContents(new StringSelection(selectionText));
      } catch (final IllegalStateException e) {
        LOG.error("Could not set clipboard:", e);
      }
    }
  }