java.lang.Object
org.apache.wicket.markup.TagUtils
Some utils to handle tags which otherwise would bloat the Tag API.
- Author:
- Juergen Donnerstag
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IValueMap
A map that keeps the separators which should be used for the different HTML element attributes. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyAttributes
(MarkupContainer component, ComponentTag tag) Copy attributes from e.g.static final IMarkupFragment
findTagMarkup
(IMarkupFragment fragment, String id, String tagName, int streamOffset) Find the markup fragment of a tag with wicket:id equal toid
starting at offsetstreamOffset
.static boolean
isBodyTag
(ComponentTag tag) static boolean
isExtendTag
(IMarkupFragment markup, int i) static boolean
isHeadTag
(MarkupElement elem) static boolean
isWicketBodyTag
(MarkupElement elem) static boolean
static boolean
static boolean
isWicketHeadTag
(MarkupElement elem) static boolean
isWicketTag
(IMarkupFragment markup, int i)
-
Field Details
-
ATTRIBUTES_SEPARATORS
A map that keeps the separators which should be used for the different HTML element attributes.
-
-
Constructor Details
-
TagUtils
public TagUtils()Constructor
-
-
Method Details
-
isBodyTag
- Parameters:
tag
-- Returns:
- True, if tag name equals '<body ...>'
-
isHeadTag
- Parameters:
elem
-- Returns:
- True, if tag name equals '<head ...>'
-
isWicketTag
- Parameters:
markup
-i
-- Returns:
- True if the markup element at index 'i' is a WicketTag
-
isExtendTag
- Parameters:
markup
-i
-- Returns:
- True if the markup element at index 'i' is a <wicket:extend> tag
-
isWicketHeadTag
- Parameters:
elem
-- Returns:
- True if the current markup element is a <wicket:head> tag
-
isWicketHeaderItemsTag
- Parameters:
elem
-- Returns:
- True if the current markup element is a <wicket:header-items> tag
-
isWicketBodyTag
- Parameters:
elem
-- Returns:
- True if the current markup element is a <wicket:body> tag
-
isWicketBorderTag
- Parameters:
elem
-- Returns:
- True if the current markup element is a <wicket:border> tag
-
copyAttributes
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:
-
findTagMarkup
public static final IMarkupFragment findTagMarkup(IMarkupFragment fragment, String id, String tagName, int streamOffset) Find the markup fragment of a tag with wicket:id equal toid
starting 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
IMarkupFragment
of the component tag if found,null
is not found.
-