|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.markup.MarkupElement org.apache.wicket.markup.ComponentTag
public class ComponentTag
A subclass of MarkupElement which represents a "significant" markup tag, such as a component open tag. Insignificant markup tags (those which are merely concerned with markup formatting operations and do not denote components or component nesting) are coalesced into instances of RawMarkup (also a subclass of MarkupElement).
Field Summary | |
---|---|
static int |
RENDER_RAW
Render the tag as RawMarkup even if no Component can be found |
protected XmlTag |
xmlTag
The underlying xml tag |
Constructor Summary | |
---|---|
ComponentTag(ComponentTag tag)
Constructor |
|
ComponentTag(String name,
XmlTag.TagType type)
Automatically create a XmlTag, assign the name and the type, and construct a ComponentTag based on this XmlTag. |
|
ComponentTag(XmlTag tag)
Construct. |
Method Summary | ||
---|---|---|
void |
addBehavior(Behavior behavior)
Adds a behavior to this component tag. |
|
void |
append(String key,
CharSequence value,
String separator)
Appends specified value to the attribute |
|
boolean |
closes(MarkupElement open)
Gets whether this tag closes the provided open tag. |
|
void |
enableAutolink(boolean autolink)
If autolink is set to true, href attributes will automatically be converted into Wicket bookmarkable URLs. |
|
boolean |
equalTo(MarkupElement element)
This is not an implementation of equals because we don't care about hashCodes for MarkupElements yet. |
|
String |
getAttribute(String name)
A convenient method. |
|
IValueMap |
getAttributes()
|
|
Iterator<? extends Behavior> |
getBehaviors()
|
|
boolean |
getFlag(int flag)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
|
String |
getId()
Get the tag's component id |
|
int |
getLength()
Gets the length of the tag in characters. |
|
Class<? extends Component> |
getMarkupClass()
In case of inherited markup, the base and the extended markups are merged and the information about the tags origin is lost. |
|
String |
getName()
|
|
String |
getNamespace()
|
|
ComponentTag |
getOpenTag()
If set, return the corresponding open tag (ComponentTag). |
|
int |
getPos()
|
|
XmlTag.TagType |
getType()
|
|
Object |
getUserData(String key)
Gets userData. |
|
XmlTag |
getXmlTag()
|
|
boolean |
hasBehaviors()
|
|
boolean |
hasNoCloseTag()
|
|
boolean |
isAutoComponentTag()
|
|
boolean |
isAutolinkEnabled()
True if autolink is enabled and the tag contains a href attribute. |
|
boolean |
isClose()
|
|
boolean |
isIgnore()
Gets ignore. |
|
boolean |
isOpen()
|
|
boolean |
isOpen(String id)
|
|
boolean |
isOpenClose()
|
|
boolean |
isOpenClose(String id)
|
|
void |
makeImmutable()
Makes this tag object immutable by making the attribute map unmodifiable. |
|
ComponentTag |
mutable()
Gets this tag if it is already mutable, or a mutable copy of this tag if it is immutable. |
|
void |
onBeforeRender(Component component,
MarkupStream markupStream)
For subclasses to override. |
|
void |
put(String key,
boolean value)
|
|
void |
put(String key,
CharSequence value)
|
|
void |
put(String key,
int value)
|
|
void |
put(String key,
StringValue value)
|
|
void |
putAll(Map<String,Object> map)
|
|
void |
putInternal(String key,
CharSequence value)
THIS METHOD IS NOT PART OF THE PUBLIC API, DO NOT CALL IT |
|
void |
remove(String key)
|
|
boolean |
requiresCloseTag()
Gets whether this tag does not require a closing tag. |
|
void |
setAutoComponentTag(boolean auto)
|
|
void |
setFlag(int flag,
boolean set)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
|
void |
setHasNoCloseTag(boolean hasNoCloseTag)
True if the HTML tag (e.g. |
|
void |
setId(String id)
Set the component's id. |
|
void |
setIgnore(boolean ignore)
Sets ignore. |
|
|
setMarkupClass(Class<C> wicketHeaderClass)
Set the class of wicket component which contains the wicket:head tag. |
|
void |
setModified(boolean modified)
Manually mark the ComponentTag being modified. |
|
void |
setName(String name)
|
|
void |
setNamespace(String namespace)
|
|
void |
setOpenTag(ComponentTag tag)
Assuming this is a close tag, assign it's corresponding open tag. |
|
void |
setType(XmlTag.TagType type)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
|
void |
setUserData(String key,
Object value)
Sets userData. |
|
CharSequence |
syntheticCloseTagString()
|
|
CharSequence |
toCharSequence()
|
|
String |
toString()
Converts this object to a string representation. |
|
String |
toUserDebugString()
Converts this object to a string representation including useful information for debugging |
|
void |
writeOutput(Response response,
boolean stripWicketAttributes,
String namespace)
Write the tag to the response |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int RENDER_RAW
protected final XmlTag xmlTag
Constructor Detail |
---|
public ComponentTag(String name, XmlTag.TagType type)
name
- The name of html tagtype
- The type of tagpublic ComponentTag(XmlTag tag)
tag
- The underlying xml tagpublic ComponentTag(ComponentTag tag)
tag
- The ComponentTag tag which this wicket tag is based upon.Method Detail |
---|
public final void setFlag(int flag, boolean set)
flag
- The flag to setset
- True to turn the flag on, false to turn it offpublic final boolean getFlag(int flag)
flag
- The flag to test
public final void addBehavior(Behavior behavior)
behavior
- public final boolean hasBehaviors()
public final Iterator<? extends Behavior> getBehaviors()
public final boolean closes(MarkupElement open)
closes
in class MarkupElement
open
- The open tag
public final void enableAutolink(boolean autolink)
autolink
- enable/disable automatic href conversionpublic final IValueMap getAttributes()
XmlTag.getAttributes()
public final String getAttribute(String name)
name
-
public final String getId()
public final int getLength()
public final String getName()
public final String getNamespace()
public final ComponentTag getOpenTag()
public final int getPos()
XmlTag.getPos()
public final XmlTag.TagType getType()
public final boolean isAutolinkEnabled()
public final boolean isClose()
XmlTag.isClose()
public final boolean isOpen()
XmlTag.isOpen()
public final boolean isOpen(String id)
id
- Required component id
XmlTag.isOpen()
public final boolean isOpenClose()
XmlTag.isOpenClose()
public final boolean isOpenClose(String id)
id
- Required component id
XmlTag.isOpenClose()
public final void makeImmutable()
public ComponentTag mutable()
public final void put(String key, boolean value)
key
- The keyvalue
- The valueXmlTag.put(String, boolean)
public final void put(String key, int value)
key
- The keyvalue
- The valueXmlTag.put(String, int)
public final void put(String key, CharSequence value)
key
- The keyvalue
- The valueXmlTag.put(String, CharSequence)
public final void putInternal(String key, CharSequence value)
key
- The keyvalue
- The valueXmlTag.put(String, CharSequence)
public final void append(String key, CharSequence value, String separator)
value
to the attribute
key
- The keyvalue
- The valueseparator
- The separator used to append the valuepublic final void put(String key, StringValue value)
key
- The keyvalue
- The valueXmlTag.put(String, StringValue)
public final void putAll(Map<String,Object> map)
map
- a key/value mapXmlTag.putAll(Map)
public final void remove(String key)
key
- The key to removeXmlTag.remove(String)
public final boolean requiresCloseTag()
public final void setId(String id)
id
- The component's id assigned to the tag.public final void setName(String name)
name
- New tag nameXmlTag.setName(String)
public final void setNamespace(String namespace)
namespace
- New tag name namespaceXmlTag.setNamespace(String)
public final void setOpenTag(ComponentTag tag)
tag
- the open-tag
RuntimeException
- if 'this' is not a close tagpublic final void setType(XmlTag.TagType type)
type
- The new typepublic final CharSequence syntheticCloseTagString()
public CharSequence toCharSequence()
toCharSequence
in class MarkupElement
MarkupElement.toCharSequence()
public final String toString()
toString
in class Object
public final void writeOutput(Response response, boolean stripWicketAttributes, String namespace)
response
- The response to write tostripWicketAttributes
- if true, wicket:id are removed from outputnamespace
- Wicket's namespace to usepublic final String toUserDebugString()
toUserDebugString
in class MarkupElement
public final XmlTag getXmlTag()
public final void setModified(boolean modified)
modified
- public boolean hasNoCloseTag()
public void setHasNoCloseTag(boolean hasNoCloseTag)
hasNoCloseTag
- public Class<? extends Component> getMarkupClass()
public <C extends Component> void setMarkupClass(Class<C> wicketHeaderClass)
C
- wicketHeaderClass
- wicketHeaderClasspublic boolean equalTo(MarkupElement element)
MarkupElement
equalTo
in class MarkupElement
element
- The markup element to compare with
MarkupElement.equalTo(org.apache.wicket.markup.MarkupElement)
public boolean isIgnore()
public void setIgnore(boolean ignore)
ignore
- If true than MarkupParser will remove it from the markuppublic boolean isAutoComponentTag()
public void setAutoComponentTag(boolean auto)
auto
- True, if wicket:id has been automatically created (internal component)public Object getUserData(String key)
key
- The key to store and retrieve the value
public void setUserData(String key, Object value)
key
- The key to store and retrieve the valuevalue
- The user specific value to storepublic void onBeforeRender(Component component, MarkupStream markupStream)
component
- The component that is about to be renderedmarkupStream
- The current markup stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |