@Override public IInformationControl createInformationControl(Shell parent) { if (BrowserInformationControl.isAvailable(parent)) { if (!enriched) { return new SpringPropertiesInformationControl( parent, PreferenceConstants.APPEARANCE_JAVADOC_FONT, statusText) { @Override public IInformationControlCreator getInformationPresenterControlCreator() { return new SpringPropertiesInformationControlCreator(true, null); } }; } else { ToolBarManager toolbar = new ToolBarManager(SWT.FLAT); BrowserInformationControl control = new SpringPropertiesInformationControl( parent, PreferenceConstants.APPEARANCE_JAVADOC_FONT, toolbar) { @Override public IInformationControlCreator getInformationPresenterControlCreator() { return new SpringPropertiesInformationControlCreator(true, null); } }; fillToolbar(toolbar, control); toolbar.update(true); return control; } } return new DefaultInformationControl(parent, true); }
/* * @see org.eclipse.jface.action.Action#run() */ @Override public void run() { try { BrowserInformationControlInput input = fInfoControl.getInput(); if (input instanceof HoverInfo) { HoverInfo infoInput = (HoverInfo) input; if (infoInput != null) { List<IJavaElement> elements = infoInput.getJavaElements(); // TODO: This only opens the first element, if there's more than one should offer a // choice/ if (!elements.isEmpty()) { IJavaElement je = elements.get(0); fInfoControl.notifyDelayedInputChange(null); fInfoControl.dispose(); // FIXME: should have protocol to hide, rather than dispose JavaUI.openInEditor(je); } } } } catch (Exception e) { SpringPropertiesEditorPlugin.log(e); } }