/**
* Initializes the given line number ruler column from the preference store.
*/
private void initialize() {
if (fDelegate == null)
fDelegate= new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, new DefaultMarkerAnnotationAccess());
IPreferenceStore store= getPreferenceStore();
if (store != null && fDelegate instanceof AnnotationRulerColumn) {
final AnnotationRulerColumn column= (AnnotationRulerColumn) fDelegate;
// initial set up
for (Iterator iter2= fAnnotationPreferences.getAnnotationPreferences().iterator(); iter2.hasNext();) {
AnnotationPreference preference= (AnnotationPreference)iter2.next();
String key= preference.getVerticalRulerPreferenceKey();
boolean showAnnotation= true;
if (key != null && store.contains(key))
showAnnotation= store.getBoolean(key);
if (showAnnotation)
column.addAnnotationType(preference.getAnnotationType());
}
column.addAnnotationType(Annotation.TYPE_UNKNOWN);
// link to preference store
fPropertyListener= new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
String property= event.getProperty();
AnnotationPreference annotationPreference= getVerticalRulerAnnotationPreference(property);
if (annotationPreference != null && event.getNewValue() instanceof Boolean) {
Object type= annotationPreference.getAnnotationType();
if (((Boolean)event.getNewValue()).booleanValue())
column.addAnnotationType(type);
else
column.removeAnnotationType(type);
column.redraw();
}
}
};
store.addPropertyChangeListener(fPropertyListener);
}