Skip to content

Adding Required UI Elements

Stephan Seifermann edited this page Sep 4, 2018 · 2 revisions

In order to be able to use your newly created diagram type, you have to add several elements to the UI. This guide will show you which elements are required.

New Diagram Wizard

Users use the new diagram wizard to create new diagrams. Creating such a wizard is straight-forward:

  • Add a dependency to de.cooperateproject.ui.
  • Create a new class that extends de.cooperateproject.ui.wizards.modelnew.AbstractNewDiagramWizard.
  • In the constructor, pass the IDiagramType of your diagram type to the super class.

In order to display your wizard, you have to add an extension to Eclipse:

  • Create a new extension for org.eclipse.ui.newWizards
  • Create a new entry for wizard
    • You can choose the ID freely, but using the fully qualified name of your class is best practice.
    • The name should be "DiagramType Diagram"
    • Choose your created class as class.
    • The icon should be platform:/plugin/de.cooperateproject.ui/icons/16/cooperate_16.png
    • The category should be de.cooperateproject.ui.wizards.cooperateWizards
    • The final perspective should be de.cooperateproject.ui.perspective

After these steps, you wizard should be available from the new menu of Eclipse and it should be located in the Cooperate category.

Wizard Accessbility

When creating wizards we need to ensure the accessibility of textboxes.

To link a label "label" with a textbox "text" you can use the following:

Accessible accLabel = label.getAccessible();
Accessible accText = text.getAccessible();
accLabel.addRelation(ACC.RELATION_LABEL_FOR, accText);
accText.addRelation(ACC.RELATION_LABELLED_BY, accLabel);

This way a screenreader reads the corresponding label when hovering over a textbox.

Clone this wiki locally