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));
}
}
Aggregations