/** * Returns the annotation decoration style used for the show in text preference for * a given annotation type. * * @param annotationType the annotation type being looked up * @return the decoration style for <code>type</code> * @since 3.0 */ private Object getAnnotationDecorationType(Object annotationType) { if (areAnnotationsShown(annotationType) && fPreferenceStore != null) { AnnotationPreference info= (AnnotationPreference) fAnnotationTypeKeyMap.get(annotationType); if (info != null) { String key= info.getTextStylePreferenceKey(); if (key != null) return fPreferenceStore.getString(key); // legacy return AnnotationPreference.STYLE_SQUIGGLES; } } return AnnotationPreference.STYLE_NONE; }
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; }
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; }
/** * Returns the annotation decoration style used for the show in text preference for * a given annotation type. * * @param annotationType the annotation type being looked up * @return the decoration style for <code>type</code> or <code>null</code> if highlighting * @since 3.0 */ private Object getAnnotationDecorationType(Object annotationType) { if (areAnnotationsHighlighted(annotationType)) return null; if (areAnnotationsShown(annotationType) && fPreferenceStore != null) { AnnotationPreference info= fAnnotationTypeKeyMap.get(annotationType); if (info != null) { String key= info.getTextStylePreferenceKey(); if (key != null) return fPreferenceStore.getString(key); // legacy return AnnotationPreference.STYLE_SQUIGGLES; } } return AnnotationPreference.STYLE_NONE; }
/** * Returns the annotation decoration style used for the show in text preference for * a given annotation type. * * @param annotationType the annotation type being looked up * @return the decoration style for <code>type</code> or <code>null</code> if highlighting * @since 3.0 */ private Object getAnnotationDecorationType(Object annotationType) { if (areAnnotationsHighlighted(annotationType)) return null; if (areAnnotationsShown(annotationType) && fPreferenceStore != null) { AnnotationPreference info= fAnnotationTypeKeyMap.get(annotationType); if (info != null) { String key= info.getTextStylePreferenceKey(); if (key != null) return fPreferenceStore.getString(key); // legacy return AnnotationPreference.STYLE_SQUIGGLES; } } return AnnotationPreference.STYLE_NONE; }
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<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; }
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; }
listModelItems.add(new ListItem(label, image, info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey(), info.getVerticalRulerPreferenceKey(), info.getTextStylePreferenceKey()));
if (info.getHighlightPreferenceKey() != null) store.setToDefault(info.getHighlightPreferenceKey()); if (info.getTextStylePreferenceKey() != null) store.setToDefault(info.getTextStylePreferenceKey());
if (info.getHighlightPreferenceKey() != null) store.setToDefault(info.getHighlightPreferenceKey()); if (info.getTextStylePreferenceKey() != null) store.setToDefault(info.getTextStylePreferenceKey());
if (info.getHighlightPreferenceKey() != null) store.setToDefault(info.getHighlightPreferenceKey()); if (info.getTextStylePreferenceKey() != null) store.setToDefault(info.getTextStylePreferenceKey());
if (info.getHighlightPreferenceKey() != null) store.setToDefault(info.getHighlightPreferenceKey()); if (info.getTextStylePreferenceKey() != null) store.setToDefault(info.getTextStylePreferenceKey());
if ((info.getTextPreferenceKey().equals(p) || info.getTextStylePreferenceKey() != null && info.getTextStylePreferenceKey().equals(p)) || (info.getHighlightPreferenceKey() != null && info.getHighlightPreferenceKey().equals(p))) { if (areAnnotationsHighlighted(type) || areAnnotationsShown(type))
if (info.getHighlightPreferenceKey() != null) store.setDefault(info.getHighlightPreferenceKey(), info.getHighlightPreferenceValue()); if (info.getTextStylePreferenceKey() != null) store.setDefault(info.getTextStylePreferenceKey(), info.getTextStyleValue());
if ((info.getTextPreferenceKey().equals(p) || info.getTextStylePreferenceKey() != null && info.getTextStylePreferenceKey().equals(p)) || (info.getHighlightPreferenceKey() != null && info.getHighlightPreferenceKey().equals(p))) { if (areAnnotationsHighlighted(type) || areAnnotationsShown(type))
if (info.getHighlightPreferenceKey() != null) store.setDefault(info.getHighlightPreferenceKey(), info.getHighlightPreferenceValue()); if (info.getTextStylePreferenceKey() != null) store.setDefault(info.getTextStylePreferenceKey(), info.getTextStyleValue());
if (info.getTextPreferenceKey().equals(p) || info.getTextStylePreferenceKey() != null && info.getTextStylePreferenceKey().equals(p)) { Object style= getAnnotationDecorationType(info.getAnnotationType()); if (AnnotationPreference.STYLE_NONE != style)