/** * Tells whether annotations are shown in the source viewer for the given type. * * @param annotationType the annotation type * @return <code>true</code> if the annotations are shown */ private boolean areAnnotationsShown(Object annotationType) { if (fPreferenceStore != null) { AnnotationPreference info= fAnnotationTypeKeyMap.get(annotationType); if (info != null) { String key= info.getTextPreferenceKey(); return key != null && fPreferenceStore.getBoolean(key); } } return false; }
/** * Tells whether annotations are shown in the source viewer for the given type. * * @param annotationType the annotation type * @return <code>true</code> if the annotations are shown */ private boolean areAnnotationsShown(Object annotationType) { if (fPreferenceStore != null) { AnnotationPreference info= (AnnotationPreference) fAnnotationTypeKeyMap.get(annotationType); if (info != null) { String key= info.getTextPreferenceKey(); return key != null && fPreferenceStore.getBoolean(key); } } return false; }
/** * Tells whether annotations are shown in the source viewer for the given type. * * @param annotationType the annotation type * @return <code>true</code> if the annotations are shown */ private boolean areAnnotationsShown(Object annotationType) { if (fPreferenceStore != null) { AnnotationPreference info= fAnnotationTypeKeyMap.get(annotationType); if (info != null) { String key= info.getTextPreferenceKey(); return key != null && fPreferenceStore.getBoolean(key); } } return false; }
private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) { ArrayList overlayKeys= new ArrayList(); Iterator e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= (AnnotationPreference) 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; }
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; }
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; }
/** * Determines whether the preference change encoded by the given event * changes the override indication. * * @param event the event to be investigated * @return <code>true</code> if event causes a change * @since 3.0 */ protected boolean affectsOverrideIndicatorAnnotations(PropertyChangeEvent event) { String key= event.getProperty(); AnnotationPreference preference= getAnnotationPreferenceLookup().getAnnotationPreference(OverrideIndicatorManager.ANNOTATION_TYPE); if (key == null || preference == null) return false; return key.equals(preference.getHighlightPreferenceKey()) || key.equals(preference.getVerticalRulerPreferenceKey()) || key.equals(preference.getOverviewRulerPreferenceKey()) || key.equals(preference.getTextPreferenceKey()); }
/** * Determines whether the preference change encoded by the given event * changes the override indication. * * @param event the event to be investigated * @return <code>true</code> if event causes a change * @since 3.0 */ protected boolean affectsOverrideIndicatorAnnotations(PropertyChangeEvent event) { String key= event.getProperty(); AnnotationPreference preference= getAnnotationPreferenceLookup().getAnnotationPreference(OverrideIndicatorManager.ANNOTATION_TYPE); if (key == null || preference == null) return false; return key.equals(preference.getHighlightPreferenceKey()) || key.equals(preference.getVerticalRulerPreferenceKey()) || key.equals(preference.getOverviewRulerPreferenceKey()) || key.equals(preference.getTextPreferenceKey()); }
/** * Determines whether the preference change encoded by the given event * changes the override indication. * * @param event the event to be investigated * @return <code>true</code> if event causes a change * @since 3.0 */ protected boolean affectsOverrideIndicatorAnnotations(PropertyChangeEvent event) { String key= event.getProperty(); AnnotationPreference preference= getAnnotationPreferenceLookup().getAnnotationPreference(OverrideIndicatorManager.ANNOTATION_TYPE); if (key == null || preference == null) return false; return key.equals(preference.getHighlightPreferenceKey()) || key.equals(preference.getVerticalRulerPreferenceKey()) || key.equals(preference.getOverviewRulerPreferenceKey()) || key.equals(preference.getTextPreferenceKey()); }
/** * Checks if <code>spec</code> has all the attributes previously required * by the marker annotation preference extension point. These are: color, text * and overview ruler preference keys. * * @param spec the <code>AnnotationPreference</code> to check * @return <code>true</code> if <code>spec</code> is complete, <code>false</code> otherwise * @since 3.0 */ private static boolean isComplete(AnnotationPreference spec) { return spec.getColorPreferenceKey() != null && spec.getColorPreferenceValue() != null && spec.getTextPreferenceKey() != null && spec.getOverviewRulerPreferenceKey() != null; }
/** * Checks if <code>spec</code> has all the attributes previously required * by the marker annotation preference extension point. These are: color, text * and overview ruler preference keys. * * @param spec the <code>AnnotationPreference</code> to check * @return <code>true</code> if <code>spec</code> is complete, <code>false</code> otherwise * @since 3.0 */ private static boolean isComplete(AnnotationPreference spec) { return spec.getColorPreferenceKey() != null && spec.getColorPreferenceValue() != null && spec.getTextPreferenceKey() != null && spec.getOverviewRulerPreferenceKey() != null; }
private ListItem[] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) { ArrayList listModelItems= new ArrayList(); Iterator e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= (AnnotationPreference) e.next(); if (isLinkedModeAnnotation(info)) { String label= info.getPreferenceLabel(); List styles= getStyles(info.getAnnotationType()); listModelItems.add(new ListItem(label, null, info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey(), info.getVerticalRulerPreferenceKey(), info.getTextStylePreferenceKey(), styles)); } } ListItem[] items= new ListItem[listModelItems.size()]; listModelItems.toArray(items); return items; }
private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) { ArrayList overlayKeys= new ArrayList(); Iterator e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= (AnnotationPreference) 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())); } OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()]; overlayKeys.toArray(keys); return keys; }
protected boolean isShownInText(Annotation annotation) { AnnotationPreference preference= getAnnotationPreference(annotation); if (preference == null) return false; String key= preference.getTextPreferenceKey(); if (key != null) { if (!fPreferenceStore.getBoolean(key)) return false; } else { key= preference.getHighlightPreferenceKey(); if (key == null || !fPreferenceStore.getBoolean(key)) return false; } return true; }
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; }
protected boolean isShownInText(Annotation annotation) { AnnotationPreference preference= getAnnotationPreference(annotation); if (preference == null) return false; String key= preference.getTextPreferenceKey(); if (key != null) { if (!fPreferenceStore.getBoolean(key)) return false; } else { key= preference.getHighlightPreferenceKey(); if (key == null || !fPreferenceStore.getBoolean(key)) return false; } return true; }
private ListItem[] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) { ArrayList<ListItem> listModelItems= new ArrayList<>(); Iterator<AnnotationPreference> e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= e.next(); if (info.isIncludeOnPreferencePage()) { String label= info.getPreferenceLabel(); if (containsMoreThanOne(preferences.getAnnotationPreferences().iterator(), label)) label += " (" + info.getAnnotationType() + ")"; //$NON-NLS-1$//$NON-NLS-2$ Image image= getImage(info); listModelItems.add(new ListItem(label, image, info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey(), info .getVerticalRulerPreferenceKey(), info.getTextStylePreferenceKey(), info.getIsGoToNextNavigationTargetKey())); } } Comparator<ListItem> comparator= new Comparator<ListItem>() { @Override public int compare(ListItem o1, ListItem o2) { String label1= o1.label; String label2= o2.label; return Collator.getInstance().compare(label1, label2); } }; Collections.sort(listModelItems, comparator); ListItem[] items= new ListItem[listModelItems.size()]; listModelItems.toArray(items); return items; }
/** * Tells whether override indicators are shown. * * @return <code>true</code> if the override indicators are shown * @since 3.0 */ protected boolean isShowingOverrideIndicators() { AnnotationPreference preference= getAnnotationPreferenceLookup().getAnnotationPreference(OverrideIndicatorManager.ANNOTATION_TYPE); IPreferenceStore store= getPreferenceStore(); return getBoolean(store, preference.getHighlightPreferenceKey()) || getBoolean(store, preference.getVerticalRulerPreferenceKey()) || getBoolean(store, preference.getOverviewRulerPreferenceKey()) || getBoolean(store, preference.getTextPreferenceKey()); }
/** * Tells whether override indicators are shown. * * @return <code>true</code> if the override indicators are shown * @since 3.0 */ protected boolean isShowingOverrideIndicators() { AnnotationPreference preference= getAnnotationPreferenceLookup().getAnnotationPreference(OverrideIndicatorManager.ANNOTATION_TYPE); IPreferenceStore store= getPreferenceStore(); return getBoolean(store, preference.getHighlightPreferenceKey()) || getBoolean(store, preference.getVerticalRulerPreferenceKey()) || getBoolean(store, preference.getOverviewRulerPreferenceKey()) || getBoolean(store, preference.getTextPreferenceKey()); }
/** * Tells whether override indicators are shown. * * @return <code>true</code> if the override indicators are shown * @since 3.0 */ protected boolean isShowingOverrideIndicators() { AnnotationPreference preference= getAnnotationPreferenceLookup().getAnnotationPreference(OverrideIndicatorManager.ANNOTATION_TYPE); IPreferenceStore store= getPreferenceStore(); return getBoolean(store, preference.getHighlightPreferenceKey()) || getBoolean(store, preference.getVerticalRulerPreferenceKey()) || getBoolean(store, preference.getOverviewRulerPreferenceKey()) || getBoolean(store, preference.getTextPreferenceKey()); }