Class ElementReferencingInTexts

java.lang.Object
com.nomagic.magicdraw.elementreferenceintext.ElementReferencingInTexts

@OpenApiAll public class ElementReferencingInTexts extends Object
Class responsible for creating rich texts(with references to other elements). For more information on usage refer to the examples.
  • Constructor Details

    • ElementReferencingInTexts

      public ElementReferencingInTexts()
  • Method Details

    • createReferencingText

      public static String createReferencingText(BaseElement referencedElement, String text)
      Creates text referencing an element using default settings(DisplayMode.CUSTOM_TEXT, UpdateMode.AUTOMATIC_UPDATE)
      Parameters:
      referencedElement - element referenced in text
      text - text to display
      Returns:
      text that refers provided element
    • createReferencingText

      public static String createReferencingText(BaseElement referencedElement, String text, DisplayMode displayMode)
      Creates text referencing an element using provided display mode and UpdateMode.AUTOMATIC_UPDATE mode
      Parameters:
      referencedElement - element referenced by text
      text - text to display(only affective if display mode is DisplayMode.CUSTOM_TEXT)
      displayMode - the reference display mode. Must not be null.
      Returns:
      text referring provided element
    • createReferencingText

      public static String createReferencingText(BaseElement referencedElement, String text, DisplayMode display, UpdateMode update)
      Creates text referencing an element using provided display mode and update mode
      Parameters:
      referencedElement - element referenced by text
      text - text to display
      display - the reference display mode. Must not be null.
      update - the reference update mode. Must not be null.
      Returns:
      text referring provided element
    • getReferredElements

      public static Collection<Element> getReferredElements(Element referringElement)
      Parameters:
      referringElement - the element that is referring to other elements
      Returns:
      a collection of elements that are referred by provided element