Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

Howto: Register Annotation EditPart Providers

< To: Tigerstripe_APIs

Annotation Framework provides own edit parts to show annotations on the GMF diagram. This parts can be customized by user. It can be done with the annotation edit part provider which map annotations to the specified edit parts:

 public interface IAnnotationEditPartProvider {
   public Class<? extends AnnotationEditPart> getAnnotationEditPartClass(Annotation annotation);

This provider should be registered using org.eclipse.tigerstripe.annotation.ui.diagrams.annotationEditpartProviders extension point:


All annotation edit parts should extend class and will be automatically refreshed when annotation changed and so on. The simple example of the annotation edit part is following:

 public class SimpleAnnotationEditPart extends AnnotationEditPart {
   public SimpleAnnotationEditPart (View view) {
   protected NodeFigure createNodeFigure() {
     BorderedNodeFigure figure = new BorderedNodeFigure(new Label());
     return figure;
   protected void refreshVisuals() {
     BorderedNodeFigure figure = (BorderedNodeFigure)getFigure();
     Label label = (Label)figure.getMainFigure();
     Annotation annotation = getAnnotation();

Annotation edit part can use getAnnotation() method to get annotation represented by this part. This part also free to use custom edit policies and other edit part features.

Back to the top