Esempio n. 1
0
 /** Creates the actions and action groups for this view. */
 protected void createActions() {
   fGotoInputAction = new GotoInputAction(this);
   fGotoInputAction.setEnabled(false);
   fCopyToClipboardAction = new CopyToClipboardAction(getViewSite());
   ISelectionProvider provider = getSelectionProvider();
   if (provider != null) provider.addSelectionChangedListener(fCopyToClipboardAction);
 }
Esempio n. 2
0
 private void doSetInput(Object input) {
   setInput(input);
   Object in = getInput();
   fGotoInputAction.setEnabled(in instanceof IModelElement);
   if (in instanceof IModelElement) {
     IModelElement me = (IModelElement) in;
     setContentDescription(ScriptElementLabels.getDefault().getElementLabel(me, TITLE_FLAGS));
     setTitleToolTip(ScriptElementLabels.getDefault().getElementLabel(me, TOOLTIP_LABEL_FLAGS));
   } else if (in instanceof ModelElementArray) {
     final ModelElementArray array = (ModelElementArray) in;
     setContentDescription(array.getContentDescription());
     setTitleToolTip(array.getTitleTooltip());
   } else if (in instanceof KeywordInput) {
     final KeywordInput keyword = (KeywordInput) in;
     setContentDescription(keyword.getValue());
     setTitleToolTip(keyword.getValue());
   } else {
     setContentDescription(in.toString());
     setTitleToolTip(in.toString());
   }
 }