Search in sources :

Example 1 with IContentAssistant

use of com.cubrid.common.ui.query.control.jface.text.contentassist.IContentAssistant in project cubrid-manager by CUBRID.

the class SQLViewerConfiguration method getContentAssistant.

/**
	 * Get content assistant
	 *
	 * @param sourceViewer the source viewer to be configured by this
	 *        configuration
	 * @return a content assistant
	 */
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    ContentAssistant assistant = new ContentAssistant();
    //		assistant.setInformationControlCreator(new IInformationControlCreator() {
    //			public IInformationControl createInformationControl(Shell parent) {
    //				DefaultInformationControl control = new DefaultInformationControl(
    //						parent);
    //				return control;
    //			}
    //		});
    assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
    final WordTracker tracker = WordTracker.getWordTracker();
    contentAssistProcessor = new SQLContentAssistProcessor(tracker, databaseProvider);
    assistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
    return assistant;
}
Also used : IContentAssistant(com.cubrid.common.ui.query.control.jface.text.contentassist.IContentAssistant) ContentAssistant(com.cubrid.common.ui.query.control.jface.text.contentassist.ContentAssistant)

Example 2 with IContentAssistant

use of com.cubrid.common.ui.query.control.jface.text.contentassist.IContentAssistant 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

ContentAssistant (com.cubrid.common.ui.query.control.jface.text.contentassist.ContentAssistant)2 IContentAssistant (com.cubrid.common.ui.query.control.jface.text.contentassist.IContentAssistant)2 DefaultInformationControl (org.eclipse.jface.text.DefaultInformationControl)1 IInformationControl (org.eclipse.jface.text.IInformationControl)1 IInformationControlCreator (org.eclipse.jface.text.IInformationControlCreator)1 Shell (org.eclipse.swt.widgets.Shell)1