/** * Returns the layer of the given annotation type. * * @param annotationType the annotation type * @return the layer */ private int getAnnotationTypeLayer(Object annotationType) { AnnotationPreference info= fAnnotationTypeKeyMap.get(annotationType); if (info != null) return info.getPresentationLayer(); return 0; }
/** * Returns the layer of the given annotation type. * * @param annotationType the annotation type * @return the layer */ private int getAnnotationTypeLayer(Object annotationType) { AnnotationPreference info= fAnnotationTypeKeyMap.get(annotationType); if (info != null) return info.getPresentationLayer(); return 0; }
/** * Returns the layer of the given annotation type. * * @param annotationType the annotation type * @return the layer */ private int getAnnotationTypeLayer(Object annotationType) { AnnotationPreference info= (AnnotationPreference) fAnnotationTypeKeyMap.get(annotationType); if (info != null) return info.getPresentationLayer(); return 0; }
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; }
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; }
public int getLayer(Annotation annotation) { if (annotation instanceof IAnnotationPresentation) { IAnnotationPresentation presentation= (IAnnotationPresentation) annotation; return presentation.getLayer(); } AnnotationPreference preference= getAnnotationPreference(annotation); if (preference != null) return preference.getPresentationLayer(); // backward compatibility, ignore exceptions, just return default layer try { Method method= annotation.getClass().getMethod("getLayer", null); //$NON-NLS-1$ Integer result= (Integer) method.invoke(annotation, null); return result.intValue(); } catch (SecurityException x) { } catch (IllegalArgumentException x) { } catch (NoSuchMethodException x) { } catch (IllegalAccessException x) { } catch (InvocationTargetException x) { } return IAnnotationAccessExtension.DEFAULT_LAYER; }
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; }
@Override public int getLayer(Annotation annotation) { if (annotation instanceof IAnnotationPresentation) { IAnnotationPresentation presentation= (IAnnotationPresentation) annotation; return presentation.getLayer(); } AnnotationPreference preference= getAnnotationPreference(annotation); if (preference != null) return preference.getPresentationLayer(); // backward compatibility, ignore exceptions, just return default layer try { Method method= annotation.getClass().getMethod("getLayer"); //$NON-NLS-1$ Integer result= (Integer) method.invoke(annotation); return result.intValue(); } catch (SecurityException x) { } catch (IllegalArgumentException x) { } catch (NoSuchMethodException x) { } catch (IllegalAccessException x) { } catch (InvocationTargetException x) { } return IAnnotationAccessExtension.DEFAULT_LAYER; }
/** * Returns the annotations drawing layer. * <p> * Note: This is only for backward compatibility. * </p> * @return the annotations drawing layer * @deprecated As of 3.0, replaced by {@link org.eclipse.jface.text.source.IAnnotationAccessExtension#getLayer(org.eclipse.jface.text.source.Annotation)} * @since 3.0 */ @Deprecated public int getLayer() { if (fPresentationLayer != -1) // Backward compatibility return fPresentationLayer; AnnotationPreference preference= EditorsPlugin.getDefault().getAnnotationPreferenceLookup().getAnnotationPreference(this); if (preference != null) return preference.getPresentationLayer(); return IAnnotationAccessExtension.DEFAULT_LAYER; }
/** * Returns the annotations drawing layer. * <p> * Note: This is only for backward compatibility. * </p> * @return the annotations drawing layer * @deprecated As of 3.0, replaced by {@link org.eclipse.jface.text.source.IAnnotationAccessExtension#getLayer(org.eclipse.jface.text.source.Annotation)} * @since 3.0 */ public int getLayer() { if (fPresentationLayer != -1) // Backward compatibility return fPresentationLayer; AnnotationPreference preference= EditorsPlugin.getDefault().getAnnotationPreferenceLookup().getAnnotationPreference(this); if (preference != null) return preference.getPresentationLayer(); return IAnnotationAccessExtension.DEFAULT_LAYER; }