Package org.apache.wicket.markup
Class TagUtils
- java.lang.Object
-
- org.apache.wicket.markup.TagUtils
-
public class TagUtils extends java.lang.ObjectSome utils to handle tags which otherwise would bloat the Tag API.- Author:
- Juergen Donnerstag
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.wicket.util.value.IValueMapATTRIBUTES_SEPARATORSA map that keeps the separators which should be used for the different HTML element attributes.
-
Constructor Summary
Constructors Constructor Description TagUtils()Constructor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopyAttributes(MarkupContainer component, ComponentTag tag)Copy attributes from e.g.static IMarkupFragmentfindTagMarkup(IMarkupFragment fragment, java.lang.String id, java.lang.String tagName, int streamOffset)Find the markup fragment of a tag with wicket:id equal toidstarting at offsetstreamOffset.static booleanisBodyTag(ComponentTag tag)static booleanisExtendTag(IMarkupFragment markup, int i)static booleanisHeadTag(MarkupElement elem)static booleanisWicketBodyTag(MarkupElement elem)static booleanisWicketBorderTag(MarkupElement elem)static booleanisWicketHeaderItemsTag(MarkupElement elem)static booleanisWicketHeadTag(MarkupElement elem)static booleanisWicketTag(IMarkupFragment markup, int i)
-
-
-
Method Detail
-
isBodyTag
public static boolean isBodyTag(ComponentTag tag)
- Parameters:
tag-- Returns:
- True, if tag name equals '<body ...>'
-
isHeadTag
public static boolean isHeadTag(MarkupElement elem)
- Parameters:
elem-- Returns:
- True, if tag name equals '<head ...>'
-
isWicketTag
public static boolean isWicketTag(IMarkupFragment markup, int i)
- Parameters:
markup-i-- Returns:
- True if the markup element at index 'i' is a WicketTag
-
isExtendTag
public static boolean isExtendTag(IMarkupFragment markup, int i)
- Parameters:
markup-i-- Returns:
- True if the markup element at index 'i' is a <wicket:extend> tag
-
isWicketHeadTag
public static boolean isWicketHeadTag(MarkupElement elem)
- Parameters:
elem-- Returns:
- True if the current markup element is a <wicket:head> tag
-
isWicketHeaderItemsTag
public static boolean isWicketHeaderItemsTag(MarkupElement elem)
- Parameters:
elem-- Returns:
- True if the current markup element is a <wicket:header-items> tag
-
isWicketBodyTag
public static boolean isWicketBodyTag(MarkupElement elem)
- Parameters:
elem-- Returns:
- True if the current markup element is a <wicket:body> tag
-
isWicketBorderTag
public static boolean isWicketBorderTag(MarkupElement elem)
- Parameters:
elem-- Returns:
- True if the current markup element is a <wicket:border> tag
-
copyAttributes
public static void copyAttributes(MarkupContainer component, ComponentTag tag)
Copy attributes from e.g. <wicket:panel> (or border) to the "calling" tag.- Parameters:
component- the markup container which attributes will be copiedtag- the component tag where the attributes will be applied- See Also:
- WICKET-2874, WICKET-3812
-
findTagMarkup
public static final IMarkupFragment findTagMarkup(IMarkupFragment fragment, java.lang.String id, java.lang.String tagName, int streamOffset)
Find the markup fragment of a tag with wicket:id equal toidstarting at offsetstreamOffset.- Parameters:
id- The wicket:id of the tag being searched for.tagName- The tag name of the tag being searched for.streamOffset- The offset in the markup stream from which to start searching.- Returns:
- the
IMarkupFragmentof the component tag if found,nullis not found.
-
-