use of org.eclipse.ui.texteditor.AnnotationPreference in project eclipse.platform.text by eclipse.
the class LineNumberColumn method getAnnotationPreferenceMap.
private Map<Object, AnnotationPreference> getAnnotationPreferenceMap() {
Map<Object, AnnotationPreference> annotationPrefs = new HashMap<>();
Iterator<AnnotationPreference> iter = fAnnotationPreferences.getAnnotationPreferences().iterator();
while (iter.hasNext()) {
AnnotationPreference pref = iter.next();
Object type = pref.getAnnotationType();
annotationPrefs.put(type, pref);
}
return annotationPrefs;
}
use of org.eclipse.ui.texteditor.AnnotationPreference in project eclipse.platform.text by eclipse.
the class TextSourceViewerConfiguration method isShowInVerticalRuler.
/*
* @see DefaultAnnotationHover#isIncluded(Annotation)
* @since 3.2
*/
protected boolean isShowInVerticalRuler(Annotation annotation) {
AnnotationPreference preference = getAnnotationPreference(annotation);
if (preference == null)
return true;
String key = preference.getVerticalRulerPreferenceKey();
// backward compatibility
if (key != null && !fPreferenceStore.getBoolean(key))
return false;
return true;
}
use of org.eclipse.ui.texteditor.AnnotationPreference in project eclipse.platform.text by eclipse.
the class AnnotationsConfigurationBlock method createOverlayStoreKeys.
private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) {
ArrayList<OverlayKey> overlayKeys = new ArrayList<>();
Iterator<AnnotationPreference> e = preferences.getAnnotationPreferences().iterator();
while (e.hasNext()) {
AnnotationPreference info = e.next();
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey()));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey()));
if (info.getHighlightPreferenceKey() != null)
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getHighlightPreferenceKey()));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey()));
if (info.getVerticalRulerPreferenceKey() != null)
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getVerticalRulerPreferenceKey()));
if (info.getTextStylePreferenceKey() != null)
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getTextStylePreferenceKey()));
if (info.getIsGoToNextNavigationTargetKey() != null)
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getIsGoToNextNavigationTargetKey()));
}
OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
overlayKeys.toArray(keys);
return keys;
}
use of org.eclipse.ui.texteditor.AnnotationPreference in project eclipse.platform.text by eclipse.
the class LinkedModeConfigurationBlock method createOverlayStoreKeys.
private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) {
ArrayList<OverlayKey> overlayKeys = new ArrayList<>();
Iterator<AnnotationPreference> e = preferences.getAnnotationPreferences().iterator();
while (e.hasNext()) {
AnnotationPreference info = e.next();
if (isLinkedModeAnnotation(info)) {
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey()));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey()));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getTextStylePreferenceKey()));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getHighlightPreferenceKey()));
}
}
OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
overlayKeys.toArray(keys);
return keys;
}
use of org.eclipse.ui.texteditor.AnnotationPreference in project eclipse.platform.text by eclipse.
the class LinkedModeConfigurationBlock method createAnnotationTypeListModel.
private ListItem[] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) {
ArrayList<ListItem> listModelItems = new ArrayList<>();
Iterator<AnnotationPreference> e = preferences.getAnnotationPreferences().iterator();
while (e.hasNext()) {
AnnotationPreference info = e.next();
if (isLinkedModeAnnotation(info)) {
String label = info.getPreferenceLabel();
List<String[]> styles = getStyles(info.getAnnotationType());
listModelItems.add(new ListItem(label, info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getHighlightPreferenceKey(), info.getTextStylePreferenceKey(), styles));
}
}
ListItem[] items = new ListItem[listModelItems.size()];
listModelItems.toArray(items);
return items;
}
Aggregations