/** * Tells whether annotation overview is enabled for the given type. * * @param annotationType the annotation type * @return <code>true</code> if the annotation overview is shown */ private boolean isAnnotationOverviewShown(Object annotationType) { if (fPreferenceStore != null && fOverviewRuler != null) { AnnotationPreference info= fAnnotationTypeKeyMap.get(annotationType); if (info != null) return fPreferenceStore.getBoolean(info.getOverviewRulerPreferenceKey()); } return false; }
/** * Tells whether annotation overview is enabled for the given type. * * @param annotationType the annotation type * @return <code>true</code> if the annotation overview is shown */ private boolean isAnnotationOverviewShown(Object annotationType) { if (fPreferenceStore != null && fOverviewRuler != null) { AnnotationPreference info= (AnnotationPreference) fAnnotationTypeKeyMap.get(annotationType); if (info != null) return fPreferenceStore.getBoolean(info.getOverviewRulerPreferenceKey()); } return false; }
/** * Tells whether annotation overview is enabled for the given type. * * @param annotationType the annotation type * @return <code>true</code> if the annotation overview is shown */ private boolean isAnnotationOverviewShown(Object annotationType) { if (fPreferenceStore != null && fOverviewRuler != null) { AnnotationPreference info= fAnnotationTypeKeyMap.get(annotationType); if (info != null) return fPreferenceStore.getBoolean(info.getOverviewRulerPreferenceKey()); } return false; }
protected boolean isShowInOverviewRuler(Annotation annotation) { AnnotationPreference preference= getAnnotationPreference(annotation); if (preference == null) return true; String key= preference.getOverviewRulerPreferenceKey(); if (key == null || !fPreferenceStore.getBoolean(key)) return false; return true; }
private String[][] createQuickDiffModel(MarkerAnnotationPreferences preferences) { String[][] items= new String[3][]; Iterator e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= (AnnotationPreference) e.next(); if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange")) //$NON-NLS-1$ items[0]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_changeColor }; else if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$ items[1]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_additionColor }; else if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$ items[2]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_deletionColor }; } return items; }
private String[][] createQuickDiffModel(MarkerAnnotationPreferences preferences) { String[][] items= new String[3][]; Iterator<AnnotationPreference> e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= e.next(); if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange")) //$NON-NLS-1$ items[0]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_changeColor }; else if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$ items[1]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_additionColor }; else if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$ items[2]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_deletionColor }; } return items; }
protected boolean isShowInOverviewRuler(Annotation annotation) { AnnotationPreference preference= getAnnotationPreference(annotation); if (preference == null) return true; String key= preference.getOverviewRulerPreferenceKey(); if (key == null || !fPreferenceStore.getBoolean(key)) return false; return true; }
private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) { ArrayList overlayKeys= new ArrayList(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER)); Iterator e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= (AnnotationPreference) e.next(); if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange") //$NON-NLS-1$ || (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$ || (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$ ) { overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey())); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey())); } } OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()]; overlayKeys.toArray(keys); return keys; }
private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) { ArrayList<OverlayKey> overlayKeys= new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER)); Iterator<AnnotationPreference> e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= e.next(); if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange") //$NON-NLS-1$ || (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$ || (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$ ) { overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey())); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey())); } } OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()]; overlayKeys.toArray(keys); return keys; }
/** * 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; }
/** * 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; }
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; }
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; }
/** * 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()); }