Example usage for org.apache.wicket.markup ComponentTag getType

List of usage examples for org.apache.wicket.markup ComponentTag getType

Introduction

In this page you can find the example usage for org.apache.wicket.markup ComponentTag getType.

Prototype

public final TagType getType() 

Source Link

Usage

From source file:com.conwax.ajax.SimpleAjaxEventBehavior.java

License:Apache License

@Override
protected void onComponentTag(ComponentTag tag) {
    if (tag.getType() != TagType.CLOSE) {
        final IValueMap attributes = tag.getAttributes();
        attributes.put(DATA_AJAX_URL, getCallbackUrl());
    }//from w  w  w.  j a  va  2s . c om
}

From source file:eu.uqasar.web.components.behaviour.user.UserProfilePictureBackgroundBehaviour.java

License:Apache License

@Override
public final void onComponentTag(Component component, ComponentTag tag) {
    if (tag.getType() != XmlTag.TagType.CLOSE) {
        replaceAttributeValue(component, tag);
    }/*  www .j a  v a 2s . c o  m*/
}

From source file:fiftyfive.wicket.css.CssClassModifier.java

License:Apache License

/**
 * Parse any existing classes declared in the markup for this component and then delegate
 * to {@link #modifyClasses modifyClasses()}. Set resulting set of classes on the component
 * tag to render its {@code class} attribute with the desired values.
 *//*from  ww  w  .j a va2s. com*/
@Override
public void onComponentTag(Component component, ComponentTag tag) {
    if (tag.getType() != TagType.CLOSE) {
        Set<String> values = new LinkedHashSet<String>();
        String existing = tag.getAttribute("class");
        if (existing != null) {
            values.addAll(Arrays.asList(existing.split("\\s+")));
        }
        modifyClasses(component, values);
        tag.put("class", Strings.join(" ", values.toArray(new String[0])));
    }
}

From source file:org.wicketstuff.dojo11.dojodnd.DojoDraggableBehavior.java

License:Apache License

/**
 * @see org.apache.wicket.behavior.IBehavior#onComponentTag(org.apache.wicket.Component,
 *      org.apache.wicket.markup.ComponentTag)
 *///from   ww w  . j  a  v  a2 s.c o m
public final void onComponentTag(Component component, ComponentTag tag) {
    if (tag.getType() != XmlTag.CLOSE) {
        final IValueMap attributes = tag.getAttributes();
        attributes.put("dndType", dndTypeModel.getObject());
        String cls = (String) attributes.get("class");
        if (Strings.isEmpty(cls)) {
            cls = DOJO_DND_ITEM_CLASS;
        } else {
            cls = cls + " " + DOJO_DND_ITEM_CLASS;
        }
        attributes.put("class", cls);
    }
}