Search in sources :

Example 1 with RulerColumnRegistry

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

the class AbstractTextEditor method updateContributedRulerColumns.

/**
 * Adds enabled ruler contributions to the vertical ruler.
 * <p>
 * Clients may extend or replace.</p>
 *
 * @param ruler the composite ruler to add contributions to
 * @since 3.3
 */
protected void updateContributedRulerColumns(CompositeRuler ruler) {
    IColumnSupport support = getAdapter(IColumnSupport.class);
    if (support == null)
        return;
    RulerColumnPreferenceAdapter adapter = null;
    if (fPreferenceStore != null)
        adapter = new RulerColumnPreferenceAdapter(getPreferenceStore(), PREFERENCE_RULER_CONTRIBUTIONS);
    RulerColumnRegistry registry = RulerColumnRegistry.getDefault();
    List<RulerColumnDescriptor> descriptors = registry.getColumnDescriptors();
    for (Iterator<RulerColumnDescriptor> it = descriptors.iterator(); it.hasNext(); ) {
        final RulerColumnDescriptor descriptor = it.next();
        support.setColumnVisible(descriptor, adapter == null || adapter.isEnabled(descriptor));
    }
}
Also used : RulerColumnDescriptor(org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor) RulerColumnRegistry(org.eclipse.ui.texteditor.rulers.RulerColumnRegistry) IColumnSupport(org.eclipse.ui.texteditor.rulers.IColumnSupport) RulerColumnPreferenceAdapter(org.eclipse.ui.texteditor.rulers.RulerColumnPreferenceAdapter)

Aggregations

IColumnSupport (org.eclipse.ui.texteditor.rulers.IColumnSupport)1 RulerColumnDescriptor (org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor)1 RulerColumnPreferenceAdapter (org.eclipse.ui.texteditor.rulers.RulerColumnPreferenceAdapter)1 RulerColumnRegistry (org.eclipse.ui.texteditor.rulers.RulerColumnRegistry)1