public void createLinks() {
   // create new link to object
   String linkType = type.getReferencedCnaLinkType();
   String referencedEntityType = type.getReferencedEntityTypeId();
   type.getReferenceResolver().createLinks(referencedEntityType, linkType, entity.getUuid());
   writeLinkedObjectsToTextField();
 }
 /**
  * Get all linked objects for linktype and write their names to the text field. Uses a runtime
  * callback (reference resolver) to do this.
  */
 private void writeLinkedObjectsToTextField() {
   String referencedCnaLinkType = type.getReferencedCnaLinkType();
   String names =
       type.getReferenceResolver()
           .getTitlesOfLinkedObjects(referencedCnaLinkType, entity.getUuid());
   text.setText(names);
 }
  /** This is currently only implemented for "roles" in Configuration objects as a special case. */
  void showAddDialog() {
    InputDialog dialog =
        new InputDialog(
            Display.getCurrent().getActiveShell(),
            Messages.MultiSelectionControl_3,
            Messages.MultiSelectionControl_4,
            "",
            new IInputValidator() {
              public String isValid(String newText) {
                if (newText.length() < 1) {
                  return Messages.MultiSelectionControl_5;
                }
                return null;
              }
            });

    if (dialog.open() == Window.OK) {
      type.getReferenceResolver().addNewEntity(this.entity, dialog.getValue());
    }

    writeToTextField();
  }