Search in sources :

Example 11 with ValueMap

use of org.apache.wicket.util.value.ValueMap in project wicket by apache.

the class Component method getMarkupAttributes.

/**
 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT USE IT!
 *
 * Get a copy of the markup's attributes which are associated with the component.
 * <p>
 * Modifications to the map returned don't change the tags attributes. It is just a copy.
 * <p>
 * Note: The component must have been added (directly or indirectly) to a container with an
 * associated markup file (Page, Panel or Border).
 *
 * @return markup attributes
 */
public final ValueMap getMarkupAttributes() {
    ComponentTag tag = getMarkupTag();
    if (tag != null) {
        ValueMap attrs = new ValueMap(tag.getAttributes());
        attrs.makeImmutable();
        return attrs;
    }
    return ValueMap.EMPTY_MAP;
}
Also used : ComponentTag(org.apache.wicket.markup.ComponentTag) ValueMap(org.apache.wicket.util.value.ValueMap)

Aggregations

ValueMap (org.apache.wicket.util.value.ValueMap)11 Test (org.junit.Test)7 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 BufferedInputStream (java.io.BufferedInputStream)1 IOException (java.io.IOException)1 NotSerializableException (java.io.NotSerializableException)1 CheckingObjectOutputStream (org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream)1 ObjectSerializationChecker (org.apache.wicket.core.util.objects.checker.ObjectSerializationChecker)1 ComponentTag (org.apache.wicket.markup.ComponentTag)1 Label (org.apache.wicket.markup.html.basic.Label)1 Border (org.apache.wicket.markup.html.border.Border)1 Panel (org.apache.wicket.markup.html.panel.Panel)1 IModel (org.apache.wicket.model.IModel)1 Model (org.apache.wicket.model.Model)1 PropertyModel (org.apache.wicket.model.PropertyModel)1 IResourceStream (org.apache.wicket.util.resource.IResourceStream)1 ResourceStreamNotFoundException (org.apache.wicket.util.resource.ResourceStreamNotFoundException)1 IValueMap (org.apache.wicket.util.value.IValueMap)1 IModificationWatcher (org.apache.wicket.util.watch.IModificationWatcher)1