Class DefaultTextPropertyProviderImpl
- java.lang.Object
-
- org.kie.workbench.common.stunner.core.client.canvas.controls.actions.DefaultTextPropertyProviderImpl
-
- All Implemented Interfaces:
TextPropertyProvider
@ApplicationScoped public class DefaultTextPropertyProviderImpl extends Object implements TextPropertyProvider
-
-
Constructor Summary
Constructors Constructor Description DefaultTextPropertyProviderImpl()DefaultTextPropertyProviderImpl(org.kie.workbench.common.stunner.core.util.DefinitionUtils definitionUtils, org.kie.workbench.common.stunner.core.client.command.CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory)
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
DefaultTextPropertyProviderImpl
public DefaultTextPropertyProviderImpl()
-
DefaultTextPropertyProviderImpl
@Inject public DefaultTextPropertyProviderImpl(org.kie.workbench.common.stunner.core.util.DefinitionUtils definitionUtils, org.kie.workbench.common.stunner.core.client.command.CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory)
-
-
Method Detail
-
getPriority
public int getPriority()
Description copied from interface:TextPropertyProviderReturns 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".- Specified by:
getPriorityin interfaceTextPropertyProvider- Returns:
-
supports
public boolean supports(org.kie.workbench.common.stunner.core.graph.Element<? extends org.kie.workbench.common.stunner.core.graph.content.definition.Definition> element)
Description copied from interface:TextPropertyProviderReturns whether theTextPropertyProvidersupports a givenElement.- Specified by:
supportsin interfaceTextPropertyProvider- Parameters:
element- The element to check.- Returns:
- true if supported otherwise false.
-
getText
public String getText(org.kie.workbench.common.stunner.core.graph.Element<? extends org.kie.workbench.common.stunner.core.graph.content.definition.Definition> element)
Description copied from interface:TextPropertyProviderGets the text on the initialisedElement. {@see TextPropertyProvider.initialiseForReading} which should be called first.- Specified by:
getTextin interfaceTextPropertyProvider- Parameters:
element- The element for which to get the caption.- Returns:
- The text to be shown as the caption.
-
setText
public 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)
Description copied from interface:TextPropertyProviderSets the text on the initialisedElement. {@see TextPropertyProvider.initialiseForWriting} which should be called first.- Specified by:
setTextin interfaceTextPropertyProvider- 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.
-
-