/** * Creates the annotation access for this editor. * * @return the created annotation access */ protected IAnnotationAccess createAnnotationAccess() { return new DefaultMarkerAnnotationAccess(); }
@Override public int getLayer(Annotation annotation) { if (annotation.isMarkedDeleted()) { return IAnnotationAccessExtension.DEFAULT_LAYER; } return super.getLayer(annotation); } };
public boolean isPaintable(Annotation annotation) { if (annotation instanceof IAnnotationPresentation) return true; AnnotationPreference preference= getAnnotationPreference(annotation); if (preference == null) return false; Object type= getType(annotation); String annotationType= (type == null ? null : type.toString()); Image image= getImage(annotation, preference, annotationType); return image != null; }
public void paintControl(PaintEvent e) { e.gc.setFont(null); fMarkerAnnotationAccess.paint(annotation, e.gc, canvas, new Rectangle(0, 0, 16, 16)); } });
@Override public boolean isSubtype(Object annotationType, Object potentialSupertype) { AnnotationTypeHierarchy hierarchy= getAnnotationTypeHierarchy(); return hierarchy.isSubtype(potentialSupertype.toString(), annotationType.toString()); }
@Override public String getTypeLabel(Annotation annotation) { AnnotationPreference preference= getAnnotationPreference(annotation); return preference != null ? preference.getPreferenceLabel() : 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; }
@Override public void paintControl(PaintEvent e) { e.gc.setFont(null); fMarkerAnnotationAccess.paint(annotation, e.gc, canvas, new Rectangle(0, 0, 16, 16)); } });
public boolean isSubtype(Object annotationType, Object potentialSupertype) { AnnotationTypeHierarchy hierarchy= getAnnotationTypeHierarchy(); return hierarchy.isSubtype(potentialSupertype.toString(), annotationType.toString()); }
public String getTypeLabel(Annotation annotation) { AnnotationPreference preference= getAnnotationPreference(annotation); return preference != null ? preference.getPreferenceLabel() : 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; }
/** * Creates the annotation access for this editor. * * @return the created annotation access */ protected IAnnotationAccess createAnnotationAccess() { return new DefaultMarkerAnnotationAccess(); }
@Override public boolean isPaintable(Annotation annotation) { if (annotation instanceof IAnnotationPresentation) return true; AnnotationPreference preference= getAnnotationPreference(annotation); if (preference == null) return false; Object type= getType(annotation); String annotationType= (type == null ? null : type.toString()); Image image= getImage(annotation, preference, annotationType); return image != null; }
@Override public int getLayer(Annotation annotation) { if (annotation.isMarkedDeleted()) { return IAnnotationAccessExtension.DEFAULT_LAYER; } return super.getLayer(annotation); } },
@Override public void paintControl(PaintEvent e) { e.gc.setFont(null); fMarkerAnnotationAccess.paint(annotation, e.gc, canvas, new Rectangle(0, 0, 16, 16)); } });
@Override public Object[] getSupertypes(Object annotationType) { AnnotationTypeHierarchy hierarchy= getAnnotationTypeHierarchy(); AnnotationType type= hierarchy.getAnnotationType(annotationType.toString()); return type.getSuperTypes(); }
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; }
public AnnotationInformationControl(Shell parentShell, String statusFieldText) { super(parentShell, statusFieldText); fMarkerAnnotationAccess= new DefaultMarkerAnnotationAccess(); create(); }
public void paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds) { if (annotation instanceof IAnnotationPresentation) { IAnnotationPresentation presentation= (IAnnotationPresentation) annotation; presentation.paint(gc, canvas, bounds); return; } AnnotationPreference preference= getAnnotationPreference(annotation); if (preference != null) { Object type= getType(annotation); String annotationType= (type == null ? null : type.toString()); Image image= getImage(annotation, preference, annotationType); if (image != null) { ImageUtilities.drawImage(image, gc, canvas, bounds, SWT.CENTER, SWT.TOP); return; } } // backward compatibility, ignore exceptions, just don't paint try { Method method= annotation.getClass().getMethod("paint", new Class[] { GC.class, Canvas.class, Rectangle.class }); //$NON-NLS-1$ method.invoke(annotation, new Object[] {gc, canvas, bounds }); } catch (SecurityException x) { } catch (IllegalArgumentException x) { } catch (NoSuchMethodException x) { } catch (IllegalAccessException x) { } catch (InvocationTargetException x) { } }
@Override public int getLayer(Annotation annotation) { if (annotation.isMarkedDeleted()) { return IAnnotationAccessExtension.DEFAULT_LAYER; } return super.getLayer(annotation); } });