Package com.nomagic.magicdraw.uml
Interface RepresentationTextCreator.RepresentationTextProvider
-
- All Superinterfaces:
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.magicdraw.utils.PriorityProvider
HIGH_PRIORITY, LOW_PRIORITY, MEDIUM_PRIORITY
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
accept(BaseElement element)
Checks if this provider should be used to create a representation text for the given elementdefault java.util.Map<java.lang.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)
).java.util.Map<java.lang.Class<? extends Element>,SmartListenerConfig>
createSmartListenerConfig()
ReturnsSmartListenerConfig
for the provider.default int
getPriority()
Returns a priority of text creator.java.lang.String
getRepresentedText(BaseElement element, RepresentationTextParams textParams)
Returns representation text for a given Element.default boolean
isHumanTypeUsed()
Checks if human type may be used in representation text.private static void
warnToOverrideMethod(java.lang.String methodName, java.lang.Class aClass)
-
-
-
Method Detail
-
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
java.lang.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
java.util.Map<java.lang.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:
SmartListenerConfig
-
createAcceptableElementSmartListenerConfig
default java.util.Map<java.lang.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:
SmartListenerConfig
,accept(BaseElement)
-
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:
PriorityProvider.MEDIUM_PRIORITY
-
warnToOverrideMethod
private static void warnToOverrideMethod(java.lang.String methodName, java.lang.Class aClass)
-
-