Пример #1
0
 /**
  * Gets this tag if it is already mutable, or a mutable copy of this tag if it is immutable.
  *
  * @return This tag if it is already mutable, or a mutable copy of this tag if it is immutable.
  */
 public ComponentTag mutable() {
   if (xmlTag.isMutable()) {
     return this;
   } else {
     ComponentTag tag = new ComponentTag(xmlTag.mutable());
     copyPropertiesTo(tag);
     return tag;
   }
 }
Пример #2
0
  /**
   * Appends specified {@code value} to the attribute
   *
   * @param key The key
   * @param value The value
   * @param separator The separator used to append the value
   */
  public final void append(String key, CharSequence value, String separator) {
    String current = getAttribute(key);
    if (Strings.isEmpty(current)) {
      xmlTag.put(key, value);
    } else {
      xmlTag.put(key, current + separator + value);
    }

    setModified(true);
  }
Пример #3
0
 /**
  * @see org.apache.wicket.markup.parser.XmlTag#put(String, StringValue)
  * @param key The key
  * @param value The value
  */
 public final void put(String key, StringValue value) {
   xmlTag.put(key, value);
   setModified(true);
 }
Пример #4
0
 /**
  * THIS METHOD IS NOT PART OF THE PUBLIC API, DO NOT CALL IT
  *
  * @see org.apache.wicket.markup.parser.XmlTag#put(String, CharSequence)
  * @param key The key
  * @param value The value
  */
 public final void putInternal(String key, CharSequence value) {
   xmlTag.put(key, value);
   setModified(true);
 }
Пример #5
0
 /**
  * @see org.apache.wicket.markup.parser.XmlTag#put(String, int)
  * @param key The key
  * @param value The value
  */
 public final void put(final String key, final int value) {
   xmlTag.put(key, value);
   setModified(true);
 }
Пример #6
0
 /**
  * @see org.apache.wicket.markup.parser.XmlTag#getAttributes()
  * @return The tag#s attributes
  */
 public final IValueMap getAttributes() {
   return xmlTag.getAttributes();
 }
Пример #7
0
 /** @see org.apache.wicket.markup.MarkupElement#toCharSequence() */
 @Override
 public CharSequence toCharSequence() {
   return xmlTag.toCharSequence();
 }
Пример #8
0
 /**
  * @see org.apache.wicket.markup.parser.XmlTag#setNamespace(String)
  * @param namespace New tag name namespace
  */
 public final void setNamespace(String namespace) {
   xmlTag.setNamespace(namespace);
 }
Пример #9
0
 /**
  * @see org.apache.wicket.markup.parser.XmlTag#isOpenClose()
  * @return True if this tag is an open and a close tag
  */
 public final boolean isOpenClose() {
   return xmlTag.isOpenClose();
 }
Пример #10
0
 /** @return the tag type (OPEN, CLOSE or OPEN_CLOSE). */
 public final TagType getType() {
   return xmlTag.getType();
 }
Пример #11
0
 /**
  * @see org.apache.wicket.markup.parser.XmlTag#getPos()
  * @return Tag location (index in input string)
  */
 public final int getPos() {
   return xmlTag.getPos();
 }
Пример #12
0
 /** @return The tag's namespace */
 public final String getNamespace() {
   return xmlTag.getNamespace();
 }
Пример #13
0
 /**
  * Gets the length of the tag in characters.
  *
  * @return The tag's length
  */
 public final int getLength() {
   return xmlTag.getLength();
 }
Пример #14
0
 /**
  * A convenient method. The same as getAttributes().getString(name)
  *
  * @param name
  * @return The attributes value
  */
 public final String getAttribute(String name) {
   return xmlTag.getAttributes().getString(name);
 }
Пример #15
0
 /**
  * @see org.apache.wicket.markup.parser.XmlTag#putAll(Map)
  * @param map a key/value map
  */
 public final void putAll(final Map<String, Object> map) {
   xmlTag.putAll(map);
   setModified(true);
 }
Пример #16
0
 /**
  * @see org.apache.wicket.markup.parser.XmlTag#remove(String)
  * @param key The key to remove
  */
 public final void remove(String key) {
   xmlTag.remove(key);
   setModified(true);
 }
Пример #17
0
 /**
  * @param id Required component id
  * @return True if this tag is an openclose tag with the given component id
  * @see org.apache.wicket.markup.parser.XmlTag#isOpenClose()
  */
 public final boolean isOpenClose(String id) {
   return xmlTag.isOpenClose() && this.id.equals(id);
 }
Пример #18
0
 /**
  * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT.
  *
  * @param type The new type
  */
 public final void setType(final TagType type) {
   if (type != xmlTag.getType()) {
     xmlTag.setType(type);
     setModified(true);
   }
 }
Пример #19
0
 /**
  * Makes this tag object immutable by making the attribute map unmodifiable. Immutable tags cannot
  * be made mutable again. They can only be copied into new mutable tag objects.
  */
 public final void makeImmutable() {
   xmlTag.makeImmutable();
 }
Пример #20
0
 /**
  * Converts this object to a string representation including useful information for debugging
  *
  * @return String version of this object
  */
 @Override
 public final String toUserDebugString() {
   return xmlTag.toUserDebugString();
 }
Пример #21
0
 /**
  * Automatically create a XmlTag, assign the name and the type, and construct a ComponentTag based
  * on this XmlTag.
  *
  * @param name The name of html tag
  * @param type The type of tag
  */
 public ComponentTag(final String name, final XmlTag.TagType type) {
   final XmlTag tag = new XmlTag();
   tag.setName(name);
   tag.setType(type);
   xmlTag = tag;
 }