@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI .getTooltipAffordanceString(); if (BrowserInformationControl.isAvailable(parent)) { String font = "org.eclipse.jdt.ui.javadocfont"; BrowserInformationControl iControl = new BrowserInformationControl( parent, font, false) { @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
@Override public IInformationControlCreator getInformationPresenterControlCreator() { /* * Its necessary to implement this - otherwise leaving the origin * tooltip area, which does not contain the browser control, will hide * the control. It would be nicer if eclipse would have an easier * mechanism to reuse the origin control! */ return new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell parent) { SimpleBrowserInformationControl newControl = new SimpleBrowserInformationControl(parent, 20); newControl.setBrowserEGradleLinkListener(browserEGradleLinkListener); return newControl; } }; }
private void showQuickAnnotations(final JavaEditor editor) { InformationPresenter presenter = new InformationPresenter(new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { int shellStyle = SWT.RESIZE; int treeStyle = SWT.V_SCROLL | SWT.H_SCROLL; return new QuickAnnotationInformationControl(parent, shellStyle, treeStyle, editor); } }); IInformationProvider provider = new JavaElementProvider(editor, false); presenter.setInformationProvider(provider, IDocument.DEFAULT_CONTENT_TYPE); presenter.install(editor.getViewer()); presenter.install(editor.getViewer().getTextWidget()); presenter.showInformation(); }
@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = "Press F2 for focus"; if (BrowserInformationControl.isAvailable(parent)) { String font = JFaceResources.DIALOG_FONT; BrowserInformationControl iControl = new BrowserInformationControl( parent, font, tooltipAffordanceString) { /* * @see org.eclipse.jface.text.IInformationControlExtension5# * getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
/** * Install everything necessary to get document folding working and enable * document folding * * @param sourceViewer */ private void installProjectionSupport() { ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer(); fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors()); fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$ fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$ fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent); } }); fProjectionSupport.install(); if (isFoldingEnabled()) { projectionViewer.doOperation(ProjectionViewer.TOGGLE); } }
@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = ""; //"Press 'F2' for focus";//EditorsUI.getTooltipAffordanceString(); if (BrowserInformationControl.isAvailable(parent)) { String font = "org.eclipse.jdt.ui.javadocfont"; // FIXME: PreferenceConstants.APPEARANCE_JAVADOC_FONT; IXtextBrowserInformationControl iControl = new XtextBrowserInformationControl(parent, font, tooltipAffordanceString) { /* * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = "Press F2 for focus"; if (BrowserInformationControl.isAvailable(parent)) { String font = JFaceResources.DIALOG_FONT; BrowserInformationControl iControl = new BrowserInformationControl( parent, font, tooltipAffordanceString) { /* * @see org.eclipse.jface.text.IInformationControlExtension5# * getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; // addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
/** * Creates a new additional information controller. * * @param creator * the information control creator to be used by this controller * @param delay * time in milliseconds after which additional info should be displayed */ AdditionalInfoController(IInformationControlCreator creator, int delay) { super(creator); setCloser(new Closer()); fDelay = delay; setAnchor(ANCHOR_RIGHT); setFallbackAnchors(new Anchor[] { ANCHOR_RIGHT, ANCHOR_LEFT, ANCHOR_BOTTOM }); /* * Adjust the location by one pixel towards the proposal popup, so that the single pixel border of the * additional info popup overlays with the border of the popup. This avoids having a double black line. */ int spacing = -1; setMargins(spacing, spacing); // see also adjustment in #computeLocation InformationControlReplacer replacer = new InformationControlReplacer(new DefaultPresenterControlCreator()); getInternalAccessor().setInformationControlReplacer(replacer); }
public IInformationControl doCreateInformationControl(Shell parent) { if (CustomBrowserInformationControl.isAvailable(parent)) { CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null, EditorsUI.getTooltipAffordanceString()) { public IInformationControlCreator getInformationPresenterControlCreator() { return informationPresenterControlCreator; } }; iControl.setBackgroundColor(getBackgroundColor()); iControl.setForegroundColor(getForegroundColor()); return iControl; } else { // return new ThemedInformationControl(parent, null, EditorsUI.getTooltipAffordanceString()); return new DefaultInformationControl(parent, true); } }
@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString= fAdditionalInfoAffordance ? JavaPlugin.getAdditionalInfoAffordanceString() : EditorsUI.getTooltipAffordanceString(); if (BrowserInformationControl.isAvailable(parent)) { String font= PreferenceConstants.APPEARANCE_JAVADOC_FONT; BrowserInformationControl iControl= new BrowserInformationControl(parent, font, tooltipAffordanceString) { /* * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
@Override public IInformationControlCreator getHoverControlCreator() { if (creator == null) { creator = new GradleTextHoverControlCreator(); } return creator; }
@Override public IInformationControlCreator getInformationPresenterControlCreator() { return new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell parent) { ReducedBrowserInformationControl newControl = new ReducedBrowserInformationControl(parent); return newControl; } }; }
@Override public IInformationControlCreator getHoverControlCreator() { return new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString()); } }; }
@Override public IInformationControlCreator getInformationControlCreator() { if (informationControlCreator == null) { informationControlCreator=new EGradleInformationControlCreator(); } return informationControlCreator; }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl.isAvailable(parent)) { de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl iControl = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl.isAvailable(parent)) { eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl iControl = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl.isAvailable(parent)) { eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl iControl = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl.isAvailable(parent)) { eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl iControl = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl.isAvailable(parent)) { eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl iControl = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl.isAvailable(parent)) { eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl iControl = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl.isAvailable(parent)) { eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl iControl = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
/** * @Override */ public IInformationControlCreator getInformationControlCreator( ISourceViewer sourceViewer){ return new IInformationControlCreator() { public IInformationControl createInformationControl( Shell parent){ return new DefaultInformationControl(parent, getInformationPresenter()); } }; }
public IInformationControlCreator getInformationControlCreator (ISourceViewer sourceViewer) { return new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, presenter); } }; }
public IInformationControlCreator getInformationPresenterControlCreator() { return new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { return new NCLInformationControl(parent, true); } }; }
/** * TODO: This function must be reimplemented to return a * NCLHoverInformationControl */ public IInformationControlCreator getInformationControlCreator( ISourceViewer sourceViewer) { return new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { // return new DefaultInformationControl(parent); return new return new NCLInformationControl(parent, false); } }; }
public IInformationControlCreator getInformationPresenterControlCreator() { return new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell parent) { return new FluentMkSourceViewerInfoControl(parent, true, orientation, null); } }; }
@Override public IInformationControlCreator getInformationControlCreator() { Shell shell = getActiveWorkbenchShell(); if (shell == null || !BrowserInformationControl.isAvailable(shell)) return null; if (tsControlCreator == null) { PresenterControlCreator presenterControlCreator = new PresenterControlCreator(); tsControlCreator = new HoverControlCreator(presenterControlCreator, true); } return tsControlCreator; }
@Override public IInformationControlCreator getInformationPresenterControlCreator() { // Hack: We don't wan't to have auto-enrichment when the mouse moves // into the hover, // but we do want F2 to persist the hover. The framework has no way to // distinguish the // two requests, so we have to implement this aspect. for (StackTraceElement element : Thread.currentThread().getStackTrace()) { if ("canMoveIntoInformationControl".equals(element.getMethodName()) //$NON-NLS-1$ && "org.eclipse.jface.text.AbstractHoverInformationControlManager".equals(element.getClassName())) //$NON-NLS-1$ return null; // do not enrich bracket hover } return super.getInformationPresenterControlCreator(); }
@Override public IInformationControlCreator getInformationPresenterControlCreator() { return new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell shell) { return new DefaultInformationControl(shell, true); } }; }
@Override public IInformationControl doCreateInformationControl(Shell parent) { return new AnnotationInformationControl(parent, EditorsUI.getTooltipAffordanceString()) { /* * @see org.eclipse.jface.text.IInformationControlExtension5# * getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fPresenterControlCreator; } }; }
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { IPreferenceStore store= JavaScriptPlugin.getDefault().getPreferenceStore(); JavaScriptTextTools textTools= JavaScriptPlugin.getDefault().getJavaTextTools(); IColorManager manager= textTools.getColorManager(); ContentAssistant assistant= new ContentAssistant(); assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE); // Register the same processor for strings and single line comments to get code completion at the start of those partitions. assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_STRING); assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_CHARACTER); assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT); assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT); assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVASCRIPT_TEMPLATE_LITERAL); assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_DOC); assistant.enableAutoInsert(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOINSERT)); assistant.enableAutoActivation(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION)); assistant.setAutoActivationDelay(store.getInt(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY)); assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY); assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); assistant.setInformationControlCreator(new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true)); } }); Color background= getColor(store, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, manager); assistant.setContextInformationPopupBackground(background); assistant.setContextSelectorBackground(background); assistant.setProposalSelectorBackground(background); Color foreground= getColor(store, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, manager); assistant.setContextInformationPopupForeground(foreground); assistant.setContextSelectorForeground(foreground); assistant.setProposalSelectorForeground(foreground); return assistant; }
/** * Returns the outline presenter control creator. The creator is a factory * creating outline presenter controls for the given source viewer. This * implementation always returns a creator for * <code>JavaOutlineInformationControl</code> instances. * * @param sourceViewer * the source viewer to be configured by this configuration * @param commandId * the ID of the command that opens this control * @return an information control creator * */ private IInformationControlCreator getOutlinePresenterControlCreator(final ISourceViewer sourceViewer, final String commandId) { return new IInformationControlCreator() { public IInformationControl createInformationControl(final Shell parent) { int shellStyle = SWT.RESIZE; try { return new TypeScriptQuickOutlineDialog(parent, shellStyle, getTypeScriptFile()); } catch (Exception e) { return null; } } }; }
/** * Returns the implementation presenter control creator. The creator is a * factory creating implementation presenter controls for the given source * viewer. * * @param sourceViewer * the source viewer to be configured by this configuration * @param commandId * the ID of the command that opens this control * @return an information control creator * */ private IInformationControlCreator getImplementationPresenterControlCreator(final ISourceViewer sourceViewer) { return new IInformationControlCreator() { public IInformationControl createInformationControl(final Shell parent) { try { int shellStyle = SWT.RESIZE; return new TypeScriptImplementationDialog(parent, shellStyle, getTypeScriptFile()); } catch (Exception e) { return null; } } }; }
@Override public IInformationControl doCreateInformationControl(Shell parent) { // String str = EditorsUI.getTooltipAffordanceString(); // System.out.println(str); return new AnnotationInformationControl(parent, "Tooltip"){ //EditorsUI.getTooltipAffordanceString()) { // XXX cp uncommented @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fPresenterControlCreator; } }; }