@Override
  public void dispose() {
    super.dispose();

    if (this.nodeTemplateVisibilityListener != null) {
      for (DiagramNodeTemplate nodeTemplate :
          ((SapphireDiagramEditorPagePart) getPart()).getNodeTemplates()) {
        nodeTemplate.detach(this.nodeTemplateVisibilityListener);
      }
    }
  }
  @Override
  public List<SapphireActionHandler> create() {
    final ListFactory<SapphireActionHandler> handlers = ListFactory.start();

    for (DiagramNodeTemplate nodeTemplate :
        ((SapphireDiagramEditorPagePart) getPart()).getNodeTemplates()) {
      if (nodeTemplate.visible()) {
        final DiagramNodeAddActionHandler addNodeHandler =
            new DiagramNodeAddActionHandler(nodeTemplate);
        handlers.add(addNodeHandler);
      }
    }

    return handlers.result();
  }
  @Override
  public void init(final SapphireAction action, final ActionHandlerFactoryDef def) {
    super.init(action, def);

    this.nodeTemplateVisibilityListener =
        new FilteredListener<PartVisibilityEvent>() {
          @Override
          protected void handleTypedEvent(final PartVisibilityEvent event) {
            broadcast(new Event());
          }
        };

    for (DiagramNodeTemplate nodeTemplate :
        ((SapphireDiagramEditorPagePart) getPart()).getNodeTemplates()) {
      nodeTemplate.attach(this.nodeTemplateVisibilityListener);
    }
  }