Class AttributeAppender

    • Constructor Detail

      • AttributeAppender

        public AttributeAppender​(String attribute,
                                 IModel<?> replaceModel)
        Creates an attribute modifier that concatenates the replaceModel to the attribute's current value, optionally separated by the separator.
        Parameters:
        attribute -
        replaceModel -
      • AttributeAppender

        public AttributeAppender​(String attribute,
                                 Serializable value)
        Creates an attribute modifier that appends the value to the attribute's current value, optionally separated by the separator.
        Parameters:
        attribute -
        value -
      • AttributeAppender

        public AttributeAppender​(String attribute,
                                 Serializable value,
                                 String separator)
        Creates an AttributeModifier that appends the value to the current value of the attribute, and will add the attribute when it is not there already.
        Parameters:
        attribute - the attribute to append the appendModels value to
        value - the value to append
        separator - the separator string, comes between the original value and the append value
      • AttributeAppender

        public AttributeAppender​(String attribute,
                                 IModel<?> appendModel,
                                 String separator)
        Creates an AttributeModifier that appends the appendModel's value to the current value of the attribute, and will add the attribute when it is not there already.
        Parameters:
        attribute - the attribute to append the appendModels value to
        appendModel - the model supplying the value to append
        separator - the separator string, comes between the original value and the append value
    • Method Detail

      • getSeparator

        public String getSeparator()
        Gets the separator used by attribute appenders and prependers.
        Returns:
        the separator used by attribute appenders and prependers.
      • setSeparator

        public AttributeAppender setSeparator​(String separator)
        Sets the separator used by attribute appenders and prependers.
        Parameters:
        separator - a space, semicolon or other character used to separate the current value and the appended/prepended value.
        Returns:
        this
      • newValue

        protected Serializable newValue​(String currentValue,
                                        String appendValue)
        Description copied from class: AttributeModifier
        Gets the value that should replace the current attribute value. This gives users the ultimate means to customize what will be used as the attribute value. For instance, you might decide to append the replacement value to the current instead of just replacing it as is Wicket's default.
        Overrides:
        newValue in class AttributeModifier
        Parameters:
        currentValue - The current attribute value. This value might be null!
        appendValue - The replacement value. This value might be null!
        Returns:
        The value that should replace the current attribute value