Package com.nomagic.magicdraw.uml
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
-
Field Summary
Fields inherited from interface com.nomagic.utils.PriorityProvider
HIGH_PRIORITY, LOW_PRIORITY, MEDIUM_PRIORITY
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(BaseElement element) Checks if this provider should be used to create a representation text for the given elementdefault Map<Class<? extends Element>,
SmartListenerConfig> ReturnedSmartListenerConfig
describes on what model changes this representation text provider can be started/stopped using as text provider (seeaccept(BaseElement)
).Map<Class<? extends Element>,
SmartListenerConfig> ReturnsSmartListenerConfig
for the provider.default int
Returns a priority of text creator.getRepresentedText
(BaseElement element, RepresentationTextParams textParams) Returns representation text for a given Element.default boolean
Checks if human type may be used in representation text.
-
Method Details
-
accept
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
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()ReturnsSmartListenerConfig
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()ReturnedSmartListenerConfig
describes on what model changes this representation text provider can be started/stopped using as text provider (seeaccept(BaseElement)
). Usually it is simple thanSmartListenerConfig
created bycreateSmartListenerConfig()
.- 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 interfacePriorityProvider
- Returns:
- MEDIUM_PRIORITY be default
- See Also:
-