Search in sources :

Example 1 with IInformationControlCreator

use of org.eclipse.jface.text.IInformationControlCreator in project tdi-studio-se by Talend.

the class SQLSourceViewerConfiguration method getInformationPresenter.

/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer)
	 */
public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
    if (iPresenter == null) {
        IInformationControlCreator informationControlCreator = new IInformationControlCreator() {

            public IInformationControl createInformationControl(Shell parent) {
                // SWT.H_SCROLL);
                return new DefaultInformationControl(parent);
            // SWT.RESIZE,,
            // style,
            // new
            // HTMLTextPresenter(cutDown));
            }
        };
        iPresenter = new InformationPresenter(informationControlCreator);
        iPresenter.setSizeConstraints(60, 10, true, true);
    }
    return iPresenter;
}
Also used : IInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator) Shell(org.eclipse.swt.widgets.Shell) DefaultInformationControl(org.eclipse.jface.text.DefaultInformationControl) InformationPresenter(org.eclipse.jface.text.information.InformationPresenter) IInformationPresenter(org.eclipse.jface.text.information.IInformationPresenter)

Example 2 with IInformationControlCreator

use of org.eclipse.jface.text.IInformationControlCreator in project tdi-studio-se by Talend.

the class ReconcilerViewer method initializeModel.

protected void initializeModel() {
    ProjectionSupport projectionSupport = new ProjectionSupport(this, annotationAccess, sharedColors);
    //$NON-NLS-1$
    projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
    //$NON-NLS-1$
    projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
    projectionSupport.setHoverControlCreator(new IInformationControlCreator() {

        @Override
        public IInformationControl createInformationControl(Shell shell) {
            return new SourceViewerInformationControl(shell, false, SWT.LEFT_TO_RIGHT, EditorsUI.getTooltipAffordanceString());
        }
    });
    projectionSupport.setInformationPresenterControlCreator(new IInformationControlCreator() {

        @Override
        public IInformationControl createInformationControl(Shell shell) {
            int shellStyle = SWT.RESIZE | SWT.TOOL | SWT.LEFT_TO_RIGHT;
            int style = SWT.V_SCROLL | SWT.H_SCROLL;
            return new SourceViewerInformationControl(shell, true, SWT.LEFT_TO_RIGHT, null);
        }
    });
    projectionSupport.install();
}
Also used : ProjectionSupport(org.eclipse.jface.text.source.projection.ProjectionSupport) IInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator) Shell(org.eclipse.swt.widgets.Shell) IInformationControl(org.eclipse.jface.text.IInformationControl) SourceViewerInformationControl(org.eclipse.jdt.internal.ui.text.java.hover.SourceViewerInformationControl)

Example 3 with IInformationControlCreator

use of org.eclipse.jface.text.IInformationControlCreator in project KaiZen-OpenAPI-Editor by RepreZen.

the class JsonSourceViewerConfiguration method getOutlinePresenter.

public IInformationPresenter getOutlinePresenter(ISourceViewer sourceViewer) {
    if (informationPresenter == null) {
        IInformationControlCreator controlCreator = getOutlineInformationControlCreator();
        informationPresenter = new InformationPresenter(controlCreator);
        informationPresenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
        // Register information provider
        IInformationProvider provider = new InformationProvider(controlCreator);
        String[] contentTypes = getConfiguredContentTypes(sourceViewer);
        for (String contentType : contentTypes) {
            informationPresenter.setInformationProvider(provider, contentType);
        }
        informationPresenter.setSizeConstraints(60, 20, true, true);
    }
    return informationPresenter;
}
Also used : IInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator) IInformationProvider(org.eclipse.jface.text.information.IInformationProvider) IInformationProvider(org.eclipse.jface.text.information.IInformationProvider) IInformationPresenter(org.eclipse.jface.text.information.IInformationPresenter) InformationPresenter(org.eclipse.jface.text.information.InformationPresenter)

Example 4 with IInformationControlCreator

use of org.eclipse.jface.text.IInformationControlCreator in project erlide_eclipse by erlang.

the class AbstractErlangEditor method createPartControl.

@Override
public void createPartControl(final Composite parent) {
    super.createPartControl(parent);
    final IInformationControlCreator informationControlCreator = getSourceViewerConfiguration().getInformationControlCreator(getSourceViewer());
    fInformationPresenter = new InformationPresenter(informationControlCreator);
    // sizes: see org.eclipse.jface.text.TextViewer.TEXT_HOVER_*_CHARS
    fInformationPresenter.setSizeConstraints(100, 12, true, true);
    fInformationPresenter.install(getSourceViewer());
    fInformationPresenter.setDocumentPartitioning(getSourceViewerConfiguration().getConfiguredDocumentPartitioning(getSourceViewer()));
}
Also used : IInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator) InformationPresenter(org.eclipse.jface.text.information.InformationPresenter)

Example 5 with IInformationControlCreator

use of org.eclipse.jface.text.IInformationControlCreator in project mylyn.docs by eclipse.

the class MarkupSourceViewerConfiguration method getOutlineInformationPresenter.

/**
 * provide access to an information presenter that can be used to pop-up a quick outline. Source viewers should
 * configure as follows:
 *
 * <pre>
 * public void configure(SourceViewerConfiguration configuration) {
 * 	super.configure(configuration);
 * 	if (configuration instanceof MarkupSourceViewerConfiguration) {
 * 		outlinePresenter = ((MarkupSourceViewerConfiguration) configuration)
 * 				.getOutlineInformationPresenter(this);
 * 		outlinePresenter.install(this);
 * 	}
 * }
 * </pre>
 *
 * @param sourceViewer
 *            the source viewer for which the presenter should be created
 * @return the presenter
 */
public IInformationPresenter getOutlineInformationPresenter(ISourceViewer sourceViewer) {
    if (informationPresenter == null) {
        IInformationControlCreator controlCreator = getOutlineInformationControlCreator();
        informationPresenter = new InformationPresenter(controlCreator);
        informationPresenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
        // Register information provider
        IInformationProvider provider = new InformationProvider(controlCreator);
        String[] contentTypes = getConfiguredContentTypes(sourceViewer);
        for (String contentType : contentTypes) {
            informationPresenter.setInformationProvider(provider, contentType);
        }
        informationPresenter.setSizeConstraints(60, 20, true, true);
    }
    return informationPresenter;
}
Also used : IInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator) IInformationProvider(org.eclipse.jface.text.information.IInformationProvider) IInformationProvider(org.eclipse.jface.text.information.IInformationProvider) IInformationPresenter(org.eclipse.jface.text.information.IInformationPresenter) InformationPresenter(org.eclipse.jface.text.information.InformationPresenter)

Aggregations

IInformationControlCreator (org.eclipse.jface.text.IInformationControlCreator)29 Shell (org.eclipse.swt.widgets.Shell)17 DefaultInformationControl (org.eclipse.jface.text.DefaultInformationControl)14 IInformationControl (org.eclipse.jface.text.IInformationControl)12 InformationPresenter (org.eclipse.jface.text.information.InformationPresenter)7 IContentAssistProcessor (org.eclipse.jface.text.contentassist.IContentAssistProcessor)5 IInformationPresenter (org.eclipse.jface.text.information.IInformationPresenter)5 SubjectControlContentAssistant (org.eclipse.jface.contentassist.SubjectControlContentAssistant)4 IInformationProvider (org.eclipse.jface.text.information.IInformationProvider)4 Point (org.eclipse.swt.graphics.Point)4 RegExContentAssistProcessor (net.sf.eclipsecs.ui.util.regex.RegExContentAssistProcessor)2 ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)2 ProjectionSupport (org.eclipse.jface.text.source.projection.ProjectionSupport)2 HtmlTextPresenter (org.eclipse.mylyn.wikitext.ui.viewer.HtmlTextPresenter)2 Control (org.eclipse.swt.widgets.Control)2 HTMLTextPresenter (org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter)2 ContentAssistant (com.cubrid.common.ui.query.control.jface.text.contentassist.ContentAssistant)1 IContentAssistant (com.cubrid.common.ui.query.control.jface.text.contentassist.IContentAssistant)1 GroovyASTCompletionProcessor (eu.esdihumboldt.hale.ui.util.groovy.internal.contentassist.GroovyASTCompletionProcessor)1 PropertiesContentAssistProcessor (net.sf.eclipsecs.ui.config.PropertiesContentAssistProcessor)1