Interface TextPropertyProvider
-
- All Known Implementing Classes:
DefaultTextPropertyProviderImpl
public interface TextPropertyProviderA provider of aStringproperty displayed as the caption for allShape's handled by theBaseCanvasHandlerand edited "in-place" by theCanvasInPlaceTextEditorControl
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetPriority()Returns the priority of theTextPropertyProvider.StringgetText(org.kie.workbench.common.stunner.core.graph.Element<? extends org.kie.workbench.common.stunner.core.graph.content.definition.Definition> element)Gets the text on the initialisedElement.voidsetText(AbstractCanvasHandler canvasHandler, org.kie.workbench.common.stunner.core.client.command.CanvasCommandManager<AbstractCanvasHandler> commandManager, org.kie.workbench.common.stunner.core.graph.Element<? extends org.kie.workbench.common.stunner.core.graph.content.definition.Definition> element, String text)Sets the text on the initialisedElement.booleansupports(org.kie.workbench.common.stunner.core.graph.Element<? extends org.kie.workbench.common.stunner.core.graph.content.definition.Definition> element)Returns whether theTextPropertyProvidersupports a givenElement.
-
-
-
Method Detail
-
getPriority
int getPriority()
Returns the priority of theTextPropertyProvider.Integer.MIN_VALUEis considered the highest priority, whereasInteger.MAX_VALUEis considered the lowest priority and is used by the default implementation as a "catch all".- Returns:
-
supports
boolean supports(org.kie.workbench.common.stunner.core.graph.Element<? extends org.kie.workbench.common.stunner.core.graph.content.definition.Definition> element)
Returns whether theTextPropertyProvidersupports a givenElement.- Parameters:
element- The element to check.- Returns:
- true if supported otherwise false.
-
getText
String getText(org.kie.workbench.common.stunner.core.graph.Element<? extends org.kie.workbench.common.stunner.core.graph.content.definition.Definition> element)
Gets the text on the initialisedElement. {@see TextPropertyProvider.initialiseForReading} which should be called first.- Parameters:
element- The element for which to get the caption.- Returns:
- The text to be shown as the caption.
-
setText
void setText(AbstractCanvasHandler canvasHandler, org.kie.workbench.common.stunner.core.client.command.CanvasCommandManager<AbstractCanvasHandler> commandManager, org.kie.workbench.common.stunner.core.graph.Element<? extends org.kie.workbench.common.stunner.core.graph.content.definition.Definition> element, String text)
Sets the text on the initialisedElement. {@see TextPropertyProvider.initialiseForWriting} which should be called first.- Parameters:
canvasHandler- Required byCommandManagerwhen executingCommand's to update theElement's property.commandManager- ACommandManagerwith which to execute update commands.element- The element for which to update the property represented by the caption.text- The text shown as the caption.
-
-