/** * Extracts the color preference for the given preference from the given store. * If the given store indicates that the default value is to be used, or * the value stored in the preferences store is <code>null</code>, * the value is taken from the <code>AnnotationPreference</code>'s default * color value. * <p> * The return value is * </p> * * @param store the preference store * @param pref the annotation preference * @return the RGB color preference, not <code>null</code> */ private static RGB getColorFromAnnotationPreference(IPreferenceStore store, AnnotationPreference pref) { String key= pref.getColorPreferenceKey(); RGB rgb= null; if (store.contains(key)) { if (store.isDefault(key)) rgb= pref.getColorPreferenceValue(); else rgb= PreferenceConverter.getColor(store, key); } if (rgb == null) rgb= pref.getColorPreferenceValue(); return rgb; }
/** * Extracts the color preference for the given preference from the given store. * If the given store indicates that the default value is to be used, or * the value stored in the preferences store is <code>null</code>, * the value is taken from the <code>AnnotationPreference</code>'s default * color value. * <p> * The return value is * </p> * * @param store the preference store * @param pref the annotation preference * @return the RGB color preference, not <code>null</code> */ private static RGB getColorFromAnnotationPreference(IPreferenceStore store, AnnotationPreference pref) { String key= pref.getColorPreferenceKey(); RGB rgb= null; if (store.contains(key)) { if (store.isDefault(key)) rgb= pref.getColorPreferenceValue(); else rgb= PreferenceConverter.getColor(store, key); } if (rgb == null) rgb= pref.getColorPreferenceValue(); return rgb; }
/** * 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; }
if (info.getVerticalRulerPreferenceKey() != null) store.setDefault(info.getVerticalRulerPreferenceKey(), info.getVerticalRulerPreferenceValue()); PreferenceConverter.setDefault(store, info.getColorPreferenceKey(), info.getColorPreferenceValue()); if (info.getShowInNextPrevDropdownToolbarActionKey() != null) store.setDefault(info.getShowInNextPrevDropdownToolbarActionKey(), info.isShowInNextPrevDropdownToolbarAction());
if (info.getVerticalRulerPreferenceKey() != null) store.setDefault(info.getVerticalRulerPreferenceKey(), info.getVerticalRulerPreferenceValue()); PreferenceConverter.setDefault(store, info.getColorPreferenceKey(), info.getColorPreferenceValue()); if (info.getShowInNextPrevDropdownToolbarActionKey() != null) store.setDefault(info.getShowInNextPrevDropdownToolbarActionKey(), info.isShowInNextPrevDropdownToolbarAction());