Search in sources :

Example 1 with DefaultRangeIndicator

use of org.eclipse.ui.texteditor.DefaultRangeIndicator in project dbeaver by serge-rider.

the class SQLEditor method createPartControl.

@Override
public void createPartControl(Composite parent) {
    setRangeIndicator(new DefaultRangeIndicator());
    sashForm = UIUtils.createPartDivider(this, parent, SWT.VERTICAL | SWT.SMOOTH);
    sashForm.setSashWidth(5);
    UIUtils.setHelp(sashForm, IHelpContextIds.CTX_SQL_EDITOR);
    super.createPartControl(sashForm);
    editorControl = sashForm.getChildren()[0];
    getSite().setSelectionProvider(new DynamicSelectionProvider());
    createResultTabs();
    // Update controls
    onDataSourceChange();
    setAction(ITextEditorActionConstants.SHOW_INFORMATION, null);
    //toolTipAction.setEnabled(false);
    CoreFeatures.SQL_EDITOR_OPEN.use();
}
Also used : DefaultRangeIndicator(org.eclipse.ui.texteditor.DefaultRangeIndicator)

Example 2 with DefaultRangeIndicator

use of org.eclipse.ui.texteditor.DefaultRangeIndicator in project tdi-studio-se by Talend.

the class TalendJavaSourceViewer method initializeModel.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.core.ui.viewer.ReconcilerViewer#initializeModel(IDocument document)
     */
@Override
protected void initializeModel() {
    getSourceViewerDecorationSupport().install(JavaPlugin.getDefault().getCombinedPreferenceStore());
    this.setRangeIndicator(new DefaultRangeIndicator());
    IAnnotationModel model;
    IDocument document;
    if (checkCode) {
        IDocumentProvider provider = JavaPlugin.getDefault().getCompilationUnitDocumentProvider();
        IEditorInput ei = new FileEditorInput(file);
        try {
            provider.connect(ei);
        } catch (CoreException e) {
            ExceptionHandler.process(e);
        }
        document = provider.getDocument(ei);
        model = provider.getAnnotationModel(ei);
    } else {
        model = new AnnotationModel();
        document = getDocument();
        model.connect(document);
    }
    if (document != null) {
        setDocument(document, model);
        showAnnotations(model != null && checkCode);
    }
    super.initializeModel();
}
Also used : DefaultRangeIndicator(org.eclipse.ui.texteditor.DefaultRangeIndicator) IDocumentProvider(org.eclipse.ui.texteditor.IDocumentProvider) CoreException(org.eclipse.core.runtime.CoreException) FileEditorInput(org.eclipse.ui.part.FileEditorInput) IAnnotationModel(org.eclipse.jface.text.source.IAnnotationModel) AnnotationModel(org.eclipse.jface.text.source.AnnotationModel) IAnnotationModel(org.eclipse.jface.text.source.IAnnotationModel) IDocument(org.eclipse.jface.text.IDocument) IEditorInput(org.eclipse.ui.IEditorInput)

Aggregations

DefaultRangeIndicator (org.eclipse.ui.texteditor.DefaultRangeIndicator)2 CoreException (org.eclipse.core.runtime.CoreException)1 IDocument (org.eclipse.jface.text.IDocument)1 AnnotationModel (org.eclipse.jface.text.source.AnnotationModel)1 IAnnotationModel (org.eclipse.jface.text.source.IAnnotationModel)1 IEditorInput (org.eclipse.ui.IEditorInput)1 FileEditorInput (org.eclipse.ui.part.FileEditorInput)1 IDocumentProvider (org.eclipse.ui.texteditor.IDocumentProvider)1