/** * Returns the annotation preference of a given annotation. * * @param annotation the annotation * @return the annotation preference for the given annotation or <code>null</code> */ public AnnotationPreference getAnnotationPreference(Annotation annotation) { return getAnnotationPreference(annotation.getType()); }
/** * Returns the annotation preference for the given annotation. * * @param annotation the annotation * @return the annotation preference for the given annotation or <code>null</code> */ private AnnotationPreference getAnnotationPreference(Annotation annotation) { AnnotationPreferenceLookup lookup= getAnnotationPreferenceLookup(); if (lookup != null) return lookup.getAnnotationPreference(annotation); return null; }
/** * Returns the annotation preference for the given annotation. * * @param annotation the annotation * @return the annotation preference for the given annotation or <code>null</code> */ private AnnotationPreference getAnnotationPreference(Annotation annotation) { AnnotationPreferenceLookup lookup= getAnnotationPreferenceLookup(); if (lookup != null) return lookup.getAnnotationPreference(annotation); return null; }
/** * Returns the annotation preference for the given annotation. * * @param annotation the annotation * @return the annotation preference or <code>null</code> if none * @since 3.2 */ private AnnotationPreference getAnnotationPreference(Annotation annotation) { if (annotation == null || fPreferenceStore == null) return null; return EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation); }
/** * Returns the annotation preference of a given annotation. * * @param annotation the annotation * @return the annotation preference for the given annotation or <code>null</code> */ public AnnotationPreference getAnnotationPreference(Annotation annotation) { return getAnnotationPreference(annotation.getType()); }
/** * Returns the annotation preference for the given annotation. * * @param annotation the annotation * @return the annotation preference or <code>null</code> if none * @since 3.2 */ private AnnotationPreference getAnnotationPreference(Annotation annotation) { if (annotation == null || fPreferenceStore == null) return null; return EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation); }
public XtextAnnotation(String type, boolean isPersistent, IXtextDocument document, Issue issue, boolean isQuickfixable) { super(type, isPersistent, issue.getMessage()); AnnotationPreference preference= lookup.getAnnotationPreference(this); if (preference != null) this.layer = preference.getPresentationLayer() + 1; else this.layer = IAnnotationAccessExtension.DEFAULT_LAYER + 1; this.document = document; this.issue = issue; this.isQuickfixable = isQuickfixable; }
/** * Returns the annotation preference for the given annotation. * * @param annotation the annotation * @return the annotation preference or <code>null</code> if none */ private static AnnotationPreference getAnnotationPreference(Annotation annotation) { if (annotation.isMarkedDeleted()) return null; return EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation); } }
private static int computeLayer(String annotationType, AnnotationPreferenceLookup lookup) { Annotation annotation= new Annotation(annotationType, false, null); AnnotationPreference preference= lookup.getAnnotationPreference(annotation); if (preference != null) return preference.getPresentationLayer() + 1; else return IAnnotationAccessExtension.DEFAULT_LAYER + 1; }
private static int computeLayer(String annotationType, AnnotationPreferenceLookup lookup) { Annotation annotation= new Annotation(annotationType, false, null); AnnotationPreference preference= lookup.getAnnotationPreference(annotation); if (preference != null) return preference.getPresentationLayer() + 1; else return IAnnotationAccessExtension.DEFAULT_LAYER + 1; }
private static int computeLayer(String annotationType, AnnotationPreferenceLookup lookup) { Annotation annotation= new Annotation(annotationType, false, null); AnnotationPreference preference= lookup.getAnnotationPreference(annotation); if (preference != null) return preference.getPresentationLayer() + 1; else return IAnnotationAccessExtension.DEFAULT_LAYER + 1; }
/** * Returns the annotation preference for the given annotation. * * @param annotation the annotation * @return the annotation preference or <code>null</code> if none */ private AnnotationPreference getAnnotationPreference(Annotation annotation) { if (annotation.isMarkedDeleted()) return null; return EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation); } }
/** * Returns the annotation preference for the given annotation. * * @param annotation the annotation * @return the annotation preference or <code>null</code> if none */ private static AnnotationPreference getAnnotationPreference(Annotation annotation) { if (annotation.isMarkedDeleted()) return null; return EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation); } }
@Override public void widgetSelected(SelectionEvent e) { String data= null; AnnotationPreference preference= EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference("org.eclipse.jdt.ui.occurrences"); //$NON-NLS-1$ if (preference != null) data= preference.getPreferenceLabel(); PreferencesUtil.createPreferenceDialogOn(parent.getShell(), e.text, null, data); } });
@Override public void widgetSelected(SelectionEvent e) { String data= null; AnnotationPreference preference= EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference("org.eclipse.jdt.ui.occurrences"); //$NON-NLS-1$ if (preference != null) data= preference.getPreferenceLabel(); PreferencesUtil.createPreferenceDialogOn(parent.getShell(), e.text, null, data); } });
private String findSelectedOverviewRulerAnnotationLabel() { Point selection= getSourceViewer().getSelectedRange(); IAnnotationModel model= getSourceViewer().getAnnotationModel(); Annotation annotation= null; Iterator<Annotation> iter= model.getAnnotationIterator(); while (iter.hasNext()) { annotation= iter.next(); Position p= model.getPosition(annotation); if (p.getOffset() == selection.x && p.getLength() == selection.y) break; } if (annotation != null) { AnnotationPreference ap= getAnnotationPreferenceLookup().getAnnotationPreference(annotation); if (ap != null) return ap.getPreferenceLabel(); } return null; }
public static boolean isChangedAdviceAnnotationActive() { AnnotationPreferenceLookup lookup = EditorsPlugin.getDefault() .getAnnotationPreferenceLookup(); AnnotationPreference preference = lookup .getAnnotationPreference(CHANGED_ADVICE_ANNOTATION_TYPE); IPreferenceStore store = EditorsPlugin.getDefault() .getPreferenceStore(); String key = preference.getVerticalRulerPreferenceKey(); if (key != null && store.getBoolean(key)) { return true; } return false; }
/** * 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()); }