Class DefaultTextPropertyProviderImpl

    • 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

      • 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: TextPropertyProvider
        Returns whether the TextPropertyProvider supports a given Element.
        Specified by:
        supports in interface TextPropertyProvider
        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: TextPropertyProvider
        Gets the text on the initialised Element. {@see TextPropertyProvider.initialiseForReading} which should be called first.
        Specified by:
        getText in interface TextPropertyProvider
        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: TextPropertyProvider
        Sets the text on the initialised Element. {@see TextPropertyProvider.initialiseForWriting} which should be called first.
        Specified by:
        setText in interface TextPropertyProvider
        Parameters:
        canvasHandler - Required by CommandManager when executing Command's to update the Element's property.
        commandManager - A CommandManager with 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.