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

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

Introduction

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

Prototype

public final void setId(final String id) 

Source Link

Document

Set the component's id.

Usage

From source file:net.jawr.web.wicket.JawrWicketLinkTagHandler.java

License:Apache License

@Override
protected MarkupElement onComponentTag(ComponentTag tag) throws ParseException {
    if (tag == null) {
        return tag;
    }/*from w w  w  .  j  a v  a 2s.  c  o  m*/

    // Only xml tags not already identified as Wicket components will be
    // considered for autolinking. This is because it is assumed that Wicket
    // components like images or all other kind of Wicket Links will handle
    // it themselves.
    // Subclass analyzeAutolinkCondition() to implement you own
    // implementation and register the new tag handler with the markup
    // parser through Application.newMarkupParser().
    if (analyzeAutolinkCondition(tag) == true) {
        // Just a dummy name. The ComponentTag will not be forwarded.
        tag.setId(AUTOLINK_ID);
        tag.setAutoComponentTag(true);
        tag.setModified(true);
        return tag;
    }

    return tag;
}

From source file:org.apache.openmeetings.web.app.MessageTagHandler.java

License:Apache License

@Override
protected final MarkupElement onComponentTag(ComponentTag tag) throws ParseException {
    if (tag.isClose()) {
        return tag;
    }// w  w w  .j a  v a  2  s  .c  o  m

    final String wicketMessageAttribute = tag.getAttributes().getString(getWicketMessageAttrName());

    if (Strings.isEmpty(wicketMessageAttribute) == false) {
        // check if this tag is raw markup
        if (tag.getId() == null) {
            // if this is a raw tag we need to set the id to something so
            // that wicket will not merge this as raw markup and instead
            // pass it on to a resolver
            tag.setId(getWicketMessageIdPrefix());
            tag.setAutoComponentTag(true);
            tag.setModified(true);
        }
        tag.addBehavior(new AttributeLocalizer(getWicketMessageAttrName()));
    }

    return tag;
}

From source file:org.madogiwa.wicket.altmark.HtmlTagIdentifier.java

License:Apache License

public MarkupElement nextTag() throws ParseException {
    ComponentTag tag = (ComponentTag) getParent().nextTag();
    if (tag == null) {
        return tag;
    }/*  ww  w . j  a va  2  s  .c om*/

    String id = tag.getAttributes().getString("id");
    String clazz = tag.getAttributes().getString("class");
    if (id != null && id.startsWith(prefix)) {
        tag.setId(convertToWicketId(id));
    } else if (clazz != null) {
        Matcher matcher = pattern.matcher(clazz);
        if (matcher.find()) {
            tag.setId(convertToWicketId(matcher.group(1)));
        }
    }
    return tag;
}

From source file:sf.wicklet.wicketext.markup.impl.WicketWriter.java

License:Apache License

private WicketWriter start(final ComponentTag open, final String id, final String wicketid,
        final ComponentTag close, final String... attrs) {
    raw(xhtml);//w  ww.  ja v a  2  s  . co  m
    if (id != null) {
        open.setId(id);
    }
    addAttributes(open.getAttributes(), wicketid, attrs);
    pushClose(open, close);
    open.makeImmutable();
    markups.add(open);
    return this;
}

From source file:sf.wicklet.wicketext.markup.impl.WicketWriter.java

License:Apache License

private WicketWriter start(final ComponentTag open, final String id, final String wicketid,
        final ComponentTag close, final Iterable<IAttribute> attrs) {
    raw(xhtml);/*w  w  w  .ja  v  a 2  s . c o  m*/
    if (id != null) {
        open.setId(id);
    }
    addAttributes(open.getAttributes(), wicketid, attrs);
    pushClose(open, close);
    open.makeImmutable();
    markups.add(open);
    return this;
}