Esempio n. 1
0
 /** Register the context menu for the viewer so that commands may be added to it. */
 private void registerContextMenu() {
   MenuManager contextMenu = new MenuManager();
   contextMenu.setRemoveAllWhenShown(true);
   getSite().registerContextMenu(contextMenu, mViewer);
   Control control = mViewer.getControl();
   Menu menu = contextMenu.createContextMenu(control);
   control.setMenu(menu);
 }
Esempio n. 2
0
 /**
  * Returns the clipboard for this view.
  *
  * @return the clipboard for this view
  */
 public Clipboard getClipboard() {
   if (mClipboard == null) {
     mClipboard = new Clipboard(mViewer.getControl().getDisplay());
   }
   return mClipboard;
 }