Interface RepresentationTextCreator.RepresentationTextProvider

All Superinterfaces:
PriorityProvider, PriorityProvider
Enclosing class:
RepresentationTextCreator

public static interface RepresentationTextCreator.RepresentationTextProvider extends PriorityProvider
Representation text provider extension point.

Plugins may register these providers and override default element's representation text displayed in MagicDraw

  • Method Details

    • accept

      boolean accept(BaseElement element)
      Checks if this provider should be used to create a representation text for the given element
      Parameters:
      element - given element
      Returns:
      true if this provider should be used to create representation text for the given element
    • getRepresentedText

      String getRepresentedText(BaseElement element, RepresentationTextParams textParams)
      Returns representation text for a given Element.
      Parameters:
      element - element for which representation text has to be created.
      textParams - parameters describing how to construct the text, what to include
      Returns:
      representation text for the given element.
    • createSmartListenerConfig

      Map<Class<? extends Element>,SmartListenerConfig> createSmartListenerConfig()
      Returns SmartListenerConfig for the provider. It describes on what model changes the representation texts should be recalculated by explicitly calling RepresentationTextProvider#getRepresentedText(BaseElement, RepresentationTextParams) instead of returning a cached value that was calculated earlier.
      Returns:
      map of configs for this provider or an empty map
      See Also:
    • createAcceptableElementSmartListenerConfig

      default Map<Class<? extends Element>,SmartListenerConfig> createAcceptableElementSmartListenerConfig()
      Returned SmartListenerConfig describes on what model changes this representation text provider can be started/stopped using as text provider (see accept(BaseElement)). Usually it is simple than SmartListenerConfig created by createSmartListenerConfig().
      Returns:
      map of configs or an empty map
      See Also:
    • isHumanTypeUsed

      default boolean isHumanTypeUsed()
      Checks if human type may be used in representation text.
      Returns:
      true human type is used in representation text, otherwise - false
    • getPriority

      default int getPriority()
      Returns a priority of text creator. The creator with bigger priority will be chosen for representation text creation if several creators accept the same Element.
      Specified by:
      getPriority in interface PriorityProvider
      Returns:
      MEDIUM_PRIORITY be default
      See Also: