/**
   * Creates the content.
   *
   * @param parent the parent
   * @param factory the factory
   * @return the composite
   */
  @Override
  public Composite createContent(Composite parent, TabbedPropertySheetWidgetFactory factory) {
    super.createContent(parent, factory);

    // Replace label and content providers in treeViewers
    treeViewer.setContentProvider(new ProfileElementWithDisplayContentProvider(diagramElement));
    treeViewer.setLabelProvider(new ProfileElementWithDisplayLabelProvider());

    refresh();
    return this;
  }
  /**
   * Display the stereotype once it is applied
   *
   * @param st the stereotype to add
   */
  @Override
  public void applyStereotype(final Element elt, final Stereotype st) {
    super.applyStereotype(elt, st);
    // bugfix: a selected element is not necessary a diagram element (ex: selection in the outline)
    if (diagramElement == null) {
      return;
    }
    try {

      getDomain()
          .runExclusive(
              new Runnable() {

                public void run() {

                  Display.getCurrent()
                      .asyncExec(
                          new Runnable() {

                            public void run() {

                              String presentationKind =
                                  AppliedStereotypeHelper.getAppliedStereotypePresentationKind(
                                      diagramElement);
                              RecordingCommand command =
                                  AppliedStereotypeHelper.getAddAppliedStereotypeCommand(
                                      getDomain(),
                                      diagramElement,
                                      st.getQualifiedName(),
                                      presentationKind);
                              getDomain().getCommandStack().execute(command);
                            }
                          });
                }
              });

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 /** Calls super method */
 private void superRemoveButton() {
   super.removeButtonPressed();
 }
 /** Adds the button pressed. */
 @Override
 public void addButtonPressed() {
   super.addButtonPressed();
 }