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()); } }
/* * @see AbstractInfoView#computeInput(Object) */ protected Object computeInput(Object input) { if (getControl() != null) { if (input instanceof String) { return getScriptdocHtml((String) input); } else if (input instanceof ModelElementArray) { final ModelElementArray array = (ModelElementArray) input; return getScriptdocHtmlDetailed(array.getElements()); } else if (input instanceof IModelElement) { final IModelElement je = (IModelElement) input; switch (je.getElementType()) { case IModelElement.SOURCE_MODULE: try { final ISourceModule module = (ISourceModule) je; return getScriptdocHtmlList(module.getTypes()); } catch (ModelException ex) { return null; } default: return getScriptdocHtml(je); } } } return null; }