Search in sources :

Example 1 with IContributedRulerColumn

use of org.eclipse.ui.texteditor.rulers.IContributedRulerColumn in project eclipse.platform.text by eclipse.

the class AbstractDecoratedTextEditor method createColumnSupport.

@Override
protected final IColumnSupport createColumnSupport() {
    return new ColumnSupport(this, RulerColumnRegistry.getDefault()) {

        @Override
        protected void initializeColumn(IContributedRulerColumn column) {
            super.initializeColumn(column);
            RulerColumnDescriptor descriptor = column.getDescriptor();
            IVerticalRuler ruler = internalGetVerticalRuler();
            if (ruler instanceof CompositeRuler) {
                if (AnnotationColumn.ID.equals(descriptor.getId())) {
                    ((AnnotationColumn) column).setDelegate(createAnnotationRulerColumn((CompositeRuler) ruler));
                } else if (LineNumberColumn.ID.equals(descriptor.getId())) {
                    fLineColumn = ((LineNumberColumn) column);
                    fLineColumn.setForwarder(new LineNumberColumn.ICompatibilityForwarder() {

                        @Override
                        public IVerticalRulerColumn createLineNumberRulerColumn() {
                            return AbstractDecoratedTextEditor.this.createLineNumberRulerColumn();
                        }

                        @Override
                        public boolean isQuickDiffEnabled() {
                            return AbstractDecoratedTextEditor.this.isPrefQuickDiffAlwaysOn();
                        }

                        @Override
                        public boolean isLineNumberRulerVisible() {
                            return AbstractDecoratedTextEditor.this.isLineNumberRulerVisible();
                        }
                    });
                }
            }
        }

        @Override
        public void dispose() {
            fLineColumn = null;
            super.dispose();
        }
    };
}
Also used : IContributedRulerColumn(org.eclipse.ui.texteditor.rulers.IContributedRulerColumn) IColumnSupport(org.eclipse.ui.texteditor.rulers.IColumnSupport) AnnotationColumn(org.eclipse.ui.internal.texteditor.AnnotationColumn) RulerColumnDescriptor(org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor) IVerticalRuler(org.eclipse.jface.text.source.IVerticalRuler) CompositeRuler(org.eclipse.jface.text.source.CompositeRuler)

Aggregations

CompositeRuler (org.eclipse.jface.text.source.CompositeRuler)1 IVerticalRuler (org.eclipse.jface.text.source.IVerticalRuler)1 AnnotationColumn (org.eclipse.ui.internal.texteditor.AnnotationColumn)1 IColumnSupport (org.eclipse.ui.texteditor.rulers.IColumnSupport)1 IContributedRulerColumn (org.eclipse.ui.texteditor.rulers.IContributedRulerColumn)1 RulerColumnDescriptor (org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor)1