Search in sources :

Example 1 with IInformationControl

use of org.eclipse.jface.text.IInformationControl 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 2 with IInformationControl

use of org.eclipse.jface.text.IInformationControl in project cubrid-manager by CUBRID.

the class SQLViewerConfiguration method getRecentlyUsedContentAssistant.

/**
	 * get recently used content assistant
	 *
	 * @param sourceViewer the source viewer to be configured by this
	 *        configuration
	 * @return a content assistant
	 */
public IContentAssistant getRecentlyUsedContentAssistant(ISourceViewer sourceViewer) {
    ContentAssistant assistant = new ContentAssistant();
    assistant.setInformationControlCreator(new IInformationControlCreator() {

        public IInformationControl createInformationControl(Shell parent) {
            DefaultInformationControl control = new DefaultInformationControl(parent);
            return control;
        }
    });
    recentlyUsedSQLContentAssistProcessor = new RecentSQLContentAssistProcessor(databaseProvider);
    assistant.setContentAssistProcessor(recentlyUsedSQLContentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
    return assistant;
}
Also used : IInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator) Shell(org.eclipse.swt.widgets.Shell) IInformationControl(org.eclipse.jface.text.IInformationControl) DefaultInformationControl(org.eclipse.jface.text.DefaultInformationControl) IContentAssistant(com.cubrid.common.ui.query.control.jface.text.contentassist.IContentAssistant) ContentAssistant(com.cubrid.common.ui.query.control.jface.text.contentassist.ContentAssistant)

Aggregations

IInformationControl (org.eclipse.jface.text.IInformationControl)2 IInformationControlCreator (org.eclipse.jface.text.IInformationControlCreator)2 Shell (org.eclipse.swt.widgets.Shell)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 SourceViewerInformationControl (org.eclipse.jdt.internal.ui.text.java.hover.SourceViewerInformationControl)1 DefaultInformationControl (org.eclipse.jface.text.DefaultInformationControl)1 ProjectionSupport (org.eclipse.jface.text.source.projection.ProjectionSupport)1