java.lang.Object
com.foreach.across.modules.web.ui.elements.ContainerViewElement
com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
com.foreach.across.modules.web.ui.elements.NodeViewElement
com.foreach.across.modules.bootstrapui.elements.tooltip.TooltipViewElement
All Implemented Interfaces:
com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement, com.foreach.across.modules.web.ui.elements.HtmlViewElement, com.foreach.across.modules.web.ui.MutableViewElement, com.foreach.across.modules.web.ui.ViewElement

public class TooltipViewElement extends com.foreach.across.modules.web.ui.elements.NodeViewElement implements com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement
Represents a default tooltip view element, rendered as a link with a question mark icon, where the tooltip text is shown when hovering.

Uses Bootstrap tooltip support. This is a convenience class as a tooltip can be pretty much any node with the right HTML attributes set.

Since:
2.0.0
Author:
Arne Vandamme
  • Constructor Details

    • TooltipViewElement

      public TooltipViewElement()
  • Method Details

    • isEscapeHtml

      public boolean isEscapeHtml()
    • setEscapeHtml

      public TooltipViewElement setEscapeHtml(boolean escapeHtml)
      Should HTML text be escaped. By default HTML is supported.
      Parameters:
      escapeHtml - should HTML text be escaped
    • setText

      public TooltipViewElement setText(String text)
      Set the tooltip text.
      Specified by:
      setText in interface com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement
      Parameters:
      text - to set
    • getText

      public String getText()
      Specified by:
      getText in interface com.foreach.across.modules.web.ui.elements.ConfigurableTextViewElement
    • getChildren

      public List<com.foreach.across.modules.web.ui.ViewElement> getChildren()
      Overrides:
      getChildren in class com.foreach.across.modules.web.ui.elements.ContainerViewElement
    • setTagName

      public TooltipViewElement setTagName(String tagName)
      Overrides:
      setTagName in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • setHtmlId

      public TooltipViewElement setHtmlId(String htmlId)
      Specified by:
      setHtmlId in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setHtmlId in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • addCssClass

      public TooltipViewElement addCssClass(String... cssClass)
      Specified by:
      addCssClass in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      addCssClass in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • removeCssClass

      public TooltipViewElement removeCssClass(String... cssClass)
      Specified by:
      removeCssClass in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      removeCssClass in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • setAttributes

      public TooltipViewElement setAttributes(Map<String,Object> attributes)
      Specified by:
      setAttributes in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setAttributes in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • setAttribute

      public TooltipViewElement setAttribute(String attributeName, Object attributeValue)
      Specified by:
      setAttribute in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      setAttribute in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • addAttributes

      public TooltipViewElement addAttributes(Map<String,Object> attributes)
      Specified by:
      addAttributes in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      addAttributes in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • removeAttribute

      public TooltipViewElement removeAttribute(String attributeName)
      Specified by:
      removeAttribute in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Overrides:
      removeAttribute in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • setName

      public TooltipViewElement setName(String name)
      Specified by:
      setName in interface com.foreach.across.modules.web.ui.MutableViewElement
      Overrides:
      setName in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • setCustomTemplate

      public TooltipViewElement setCustomTemplate(String customTemplate)
      Specified by:
      setCustomTemplate in interface com.foreach.across.modules.web.ui.MutableViewElement
      Overrides:
      setCustomTemplate in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • setElementType

      protected TooltipViewElement setElementType(String elementType)
      Overrides:
      setElementType in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • addChild

      public TooltipViewElement addChild(com.foreach.across.modules.web.ui.ViewElement element)
      Overrides:
      addChild in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • addChildren

      public TooltipViewElement addChildren(Collection<? extends com.foreach.across.modules.web.ui.ViewElement> elements)
      Overrides:
      addChildren in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • addFirstChild

      public TooltipViewElement addFirstChild(com.foreach.across.modules.web.ui.ViewElement element)
      Overrides:
      addFirstChild in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • clearChildren

      public TooltipViewElement clearChildren()
      Overrides:
      clearChildren in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • apply

      public TooltipViewElement apply(Consumer<com.foreach.across.modules.web.ui.elements.ContainerViewElement> consumer)
      Overrides:
      apply in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • applyUnsafe

      public <U extends com.foreach.across.modules.web.ui.ViewElement> TooltipViewElement applyUnsafe(Consumer<U> consumer)
      Overrides:
      applyUnsafe in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • set

      public TooltipViewElement set(com.foreach.across.modules.web.ui.ViewElement.WitherSetter... setters)
      Specified by:
      set in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Specified by:
      set in interface com.foreach.across.modules.web.ui.MutableViewElement
      Specified by:
      set in interface com.foreach.across.modules.web.ui.ViewElement
      Overrides:
      set in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • remove

      public TooltipViewElement remove(com.foreach.across.modules.web.ui.ViewElement.WitherRemover... functions)
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.MutableViewElement
      Specified by:
      remove in interface com.foreach.across.modules.web.ui.ViewElement
      Overrides:
      remove in class com.foreach.across.modules.web.ui.elements.NodeViewElement
    • getIcon

      public com.foreach.across.modules.web.ui.ViewElement getIcon()
    • setIcon

      public TooltipViewElement setIcon(com.foreach.across.modules.web.ui.ViewElement icon)
      Set the icon view element for this tooltip. This will always be the first child of the tooltip node.
      Returns:
      this.