Package com.helger.html.hc.html
Class AbstractHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<IMPLTYPE>
-
- Type Parameters:
IMPLTYPE- The implementation type.
- All Implemented Interfaces:
com.helger.commons.hierarchy.IHasChildren<IHCNode>,com.helger.commons.hierarchy.IHasChildrenRecursive<IHCNode>,com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>,com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>,IHCElement<IMPLTYPE>,IHCHasCSSClasses<IMPLTYPE>,IHCHasCSSStyles<IMPLTYPE>,IHCHasID<IMPLTYPE>,IHCNode,Serializable
- Direct Known Subclasses:
AbstractHCArea,AbstractHCBaseTable,AbstractHCCol,AbstractHCControl,AbstractHCElementWithInternalChildren,AbstractHCMediaElementChild,AbstractHCScript,HCBase,HCBR,HCCommand,HCEmbed,HCFrame,HCGenericElement,HCHead,HCHR,HCHtml,HCLink,HCMeta,HCParam,HCStyle,HCTitle,HCWBR
@NotThreadSafe public abstract class AbstractHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>> extends AbstractHCNode implements IHCElement<IMPLTYPE>
Base class for an HC element.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_HIDDENBy default an element is not hiddenstatic booleanDEFAULT_SPELLCHECKBy default an element is not spell checkedstatic com.helger.commons.state.ETriStateDEFAULT_TRANSLATEDefault translate modestatic booleanDEFAULT_UNFOCUSABLEBy default an element is not unfocusable-
Fields inherited from interface com.helger.html.hc.html.IHCElement
DEFAULT_TABINDEX
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractHCElement(EHTMLElement eElement)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IMPLTYPEaddClass(ICSSClassProvider aCSSClassProvider)IMPLTYPEaddEventHandler(EJSEvent eJSEvent, IHasJSCode aJSCode)Add a JS event handler at the end.IMPLTYPEaddStyle(com.helger.css.propertyvalue.ICSSValue aValue)Add an element specific style.booleancontainsClass(ICSSClassProvider aCSSClassProvider)Check if the passed CSS class is present or not.booleancontainsEventHandler(EJSEvent eJSEvent)Check if any event handler is registered for the specified event.booleancontainsStyle(com.helger.css.property.ECSSProperty eProperty)Check if a style value is associated to a single property.protected com.helger.xml.microdom.IMicroElementcreateMicroElement(IHCConversionSettingsToNode aConversionSettings)IHCAttrContainercustomAttrs()protected voidfillMicroElement(com.helger.xml.microdom.IMicroElement aElement, IHCConversionSettingsToNode aConversionSettings)Set all attributes and child elements of this objectprotected voidfinishMicroElement(com.helger.xml.microdom.IMicroElement eElement, IHCConversionSettingsToNode aConversionSettings)This method is called after the element itself was created and filled.StringgetAccessKey()com.helger.commons.collection.impl.ICommonsOrderedSet<ICSSClassProvider>getAllClasses()StringgetAllClassesAsString()Get the string representation of all contained classes as it should be set to the HTMLclassattribute.com.helger.commons.collection.impl.ICommonsOrderedSet<String>getAllClassNames()com.helger.commons.collection.impl.ICommonsOrderedMap<com.helger.css.property.ECSSProperty,com.helger.css.propertyvalue.ICSSValue>getAllStyles()StringgetAllStylesAsString(com.helger.css.ICSSWriterSettings aCSSSettings)The value to be set to the HTML style attributecom.helger.commons.collection.impl.ICommonsList<com.helger.css.propertyvalue.ICSSValue>getAllStyleValues()EHCContentEditablegetContentEditable()EHCTextDirectiongetDirection()EHCDraggablegetDraggable()EHTMLElementgetElement()IHasJSCodegetEventHandler(EJSEvent eJSEvent)Get the event handler of the specified event.JSEventMapgetEventMap()StringgetID()Get the HTML ID of this object.
Note: we cannot useIHasID<String>because the constraint of IHasID is, that the returned ID may not benullwhereas here the HTML ID can benull!StringgetLanguage()EHTMLRolegetRole()com.helger.css.propertyvalue.ICSSValuegetStyleValue(com.helger.css.property.ECSSProperty eProperty)Find the style value associated to a single property.longgetTabIndex()StringgetTagName()StringgetTitle()com.helger.commons.state.ETriStategetTranslate()booleanhasAnyClass()booleanhasAnyStyle()booleanhasStyle(com.helger.css.propertyvalue.ICSSValue aValue)Check if the style property is contained, and the value matches.protected com.helger.xml.microdom.IMicroNodeinternalConvertToMicroNode(IHCConversionSettingsToNode aConversionSettings)booleanisHidden()booleanisSpellCheck()booleanisTranslateOff()booleanisTranslateOn()booleanisTranslateUndefined()booleanisUnfocusable()static booleanisValidID(String sID)protected voidonConsistencyCheck(IHCConversionSettingsToNode aConversionSettings)protected voidonFinalizeNodeState(IHCConversionSettingsToNode aConversionSettings, IHCHasChildrenMutable<?,? super IHCNode> aTargetNode)Finalize the node by applying any internal state that was not yet converted to a HC element.IMPLTYPEprependEventHandler(EJSEvent eJSEvent, IHasJSCode aJSCode)Add a JS event handler at the front.IMPLTYPEremoveAllClasses()Remove all previously added CSS classes at once.IMPLTYPEremoveAllEventHandler(EJSEvent eJSEvent)Remove all event handler for the specified JS event.IMPLTYPEremoveAllStyles()Remove all styles from the elementIMPLTYPEremoveClass(ICSSClassProvider aCSSClassProvider)Remove the specified CSS class if present.IMPLTYPEremoveStyle(com.helger.css.property.ECSSProperty eProperty)Remove the specified style from the elementIMPLTYPEsetAccessKey(String sAccessKey)Set the value of the HTMLaccesskeyattribute.IMPLTYPEsetContentEditable(EHCContentEditable eContentEditable)Change the content editable stateIMPLTYPEsetDirection(EHCTextDirection eDirection)Set the value of the HTMLdirattribute.IMPLTYPEsetDraggable(EHCDraggable eDraggable)Set the draggable state of this elementIMPLTYPEsetEventHandler(EJSEvent eJSEvent, IHasJSCode aJSCode)Set a JS event handler.IMPLTYPEsetHidden(boolean bHidden)Set the hidden state of this elementIMPLTYPEsetID(String sID)Set the HTML ID of this object.IMPLTYPEsetID(String sID, boolean bImSureToOverwriteAnExistingID)IMPLTYPEsetLanguage(String sLanguage)Set the value of the HTMLlangattribute.IMPLTYPEsetRole(EHTMLRole eRole)Set the role attribute of this element.IMPLTYPEsetSpellCheck(boolean bSpellCheck)Set the value of the HTMLspellcheckattribute.IMPLTYPEsetTabIndex(long nTabIndex)Set the tab index of this object.IMPLTYPEsetTitle(String sTitle)Set the value of the HTMLtitleattribute.IMPLTYPEsetTranslate(com.helger.commons.state.ETriState eTranslate)Set the value of the HTMLtranslateattribute.IMPLTYPEsetUnfocusable(boolean bUnfocusable)Set the unfocusable state of this element.StringtoString()-
Methods inherited from class com.helger.html.hc.impl.AbstractHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, findFirstChild, findFirstChildMapped, forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getChildAtIndex, getChildCount, getChildren, getFirstChild, getLastChild, getNodeState, getPlainText, hasChildren, internalSetNodeState, onCustomizeNode, onRegisterExternalResources, registerExternalResources
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildren
forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getChildCount, getChildren, hasChildren, hasNoChildren
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenSorted
findFirstChild, findFirstChildMapped, getAllChildren, getChildAtIndex, getFirstChild, getLastChild
-
Methods inherited from interface com.helger.html.hc.html.IHCElement
setTranslate, withCustomAttrs
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSClasses
addClasses, addClasses, addClasses
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSStyles
addStyle, addStyles, addStyles, addStyles
-
Methods inherited from interface com.helger.html.hc.IHCHasID
ensureID, hasID, hasNoID, setUniqueID
-
Methods inherited from interface com.helger.html.hc.IHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, getPlainText, registerExternalResources
-
-
-
-
Field Detail
-
DEFAULT_TRANSLATE
public static final com.helger.commons.state.ETriState DEFAULT_TRANSLATE
Default translate mode
-
DEFAULT_UNFOCUSABLE
public static final boolean DEFAULT_UNFOCUSABLE
By default an element is not unfocusable- See Also:
- Constant Field Values
-
DEFAULT_HIDDEN
public static final boolean DEFAULT_HIDDEN
By default an element is not hidden- See Also:
- Constant Field Values
-
DEFAULT_SPELLCHECK
public static final boolean DEFAULT_SPELLCHECK
By default an element is not spell checked- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractHCElement
protected AbstractHCElement(@Nonnull EHTMLElement eElement)
-
-
Method Detail
-
getElement
@Nonnull public final EHTMLElement getElement()
- Specified by:
getElementin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The contained HTML element. Never
null.
-
getTagName
@Nonnull @Nonempty public final String getTagName()
- Specified by:
getTagNamein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The tag name of this element (without namespace)
-
getID
@Nullable public final String getID()
Description copied from interface:IHCHasIDGet the HTML ID of this object.
Note: we cannot useIHasID<String>because the constraint of IHasID is, that the returned ID may not benullwhereas here the HTML ID can benull!- Specified by:
getIDin interfaceIHCHasID<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The HTML ID of this object.
-
setID
@Nonnull public final IMPLTYPE setID(@Nullable String sID)
Description copied from interface:IHCHasIDSet the HTML ID of this object.- Specified by:
setIDin interfaceIHCHasID<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
sID- The ID to use. Must conform to the HTML rules for an element ID.- Returns:
- this
-
setID
@Nonnull public final IMPLTYPE setID(@Nullable String sID, boolean bImSureToOverwriteAnExistingID)
-
getTitle
@Nullable public final String getTitle()
- Specified by:
getTitlein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The value of the HTML
titleattribute. May benull.
-
setTitle
@Nonnull public final IMPLTYPE setTitle(@Nullable String sTitle)
Description copied from interface:IHCElementSet the value of the HTMLtitleattribute.- Specified by:
setTitlein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
sTitle- The new title. May benull.- Returns:
- this
-
containsClass
public final boolean containsClass(@Nullable ICSSClassProvider aCSSClassProvider)
Description copied from interface:IHCHasCSSClassesCheck if the passed CSS class is present or not.- Specified by:
containsClassin interfaceIHCHasCSSClasses<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
aCSSClassProvider- The CSS class provider to check. May benull.- Returns:
trueif the passed CSS class is contained,falseotherwise.
-
addClass
@Nonnull public final IMPLTYPE addClass(@Nullable ICSSClassProvider aCSSClassProvider)
- Specified by:
addClassin interfaceIHCHasCSSClasses<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>
-
removeClass
@Nonnull public final IMPLTYPE removeClass(@Nullable ICSSClassProvider aCSSClassProvider)
Description copied from interface:IHCHasCSSClassesRemove the specified CSS class if present.- Specified by:
removeClassin interfaceIHCHasCSSClasses<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
aCSSClassProvider- The CSS class provider to use. May benull.- Returns:
- this
-
removeAllClasses
@Nonnull public final IMPLTYPE removeAllClasses()
Description copied from interface:IHCHasCSSClassesRemove all previously added CSS classes at once.- Specified by:
removeAllClassesin interfaceIHCHasCSSClasses<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- this
-
getAllClasses
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsOrderedSet<ICSSClassProvider> getAllClasses()
- Specified by:
getAllClassesin interfaceIHCHasCSSClasses<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- A sorted set with all registered CSS class providers. Never
null.
-
getAllClassNames
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsOrderedSet<String> getAllClassNames()
- Specified by:
getAllClassNamesin interfaceIHCHasCSSClasses<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- A set with all CSS class names registered so far. Never
null.
-
hasAnyClass
public final boolean hasAnyClass()
- Specified by:
hasAnyClassin interfaceIHCHasCSSClasses<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
trueif at least one CSS class is assigned,falseotherwise.
-
getAllClassesAsString
@Nullable public final String getAllClassesAsString()
Description copied from interface:IHCHasCSSClassesGet the string representation of all contained classes as it should be set to the HTMLclassattribute. A single blank is used as a separator.- Specified by:
getAllClassesAsStringin interfaceIHCHasCSSClasses<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
nullif no classes are present.
-
getAllStyles
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsOrderedMap<com.helger.css.property.ECSSProperty,com.helger.css.propertyvalue.ICSSValue> getAllStyles()
- Specified by:
getAllStylesin interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- A copy of all contained styles. Never
null.
-
getAllStyleValues
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsList<com.helger.css.propertyvalue.ICSSValue> getAllStyleValues()
- Specified by:
getAllStyleValuesin interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- All style values. Never
null.
-
getStyleValue
@Nullable public final com.helger.css.propertyvalue.ICSSValue getStyleValue(@Nullable com.helger.css.property.ECSSProperty eProperty)
Description copied from interface:IHCHasCSSStylesFind the style value associated to a single property.- Specified by:
getStyleValuein interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eProperty- The property to search. May benull.- Returns:
nullif no such style is contained.
-
containsStyle
public final boolean containsStyle(@Nullable com.helger.css.property.ECSSProperty eProperty)
Description copied from interface:IHCHasCSSStylesCheck if a style value is associated to a single property.- Specified by:
containsStylein interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eProperty- The property to search. May benull.- Returns:
trueif a respective style is present,falseotherwise.
-
hasStyle
public final boolean hasStyle(@Nullable com.helger.css.propertyvalue.ICSSValue aValue)
Description copied from interface:IHCHasCSSStylesCheck if the style property is contained, and the value matches.- Specified by:
hasStylein interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
aValue- The value to be checked- Returns:
trueif such a CSS value is contained,falseotherwise
-
hasAnyStyle
public final boolean hasAnyStyle()
- Specified by:
hasAnyStylein interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
trueif at least one CSS style is assigned,falseotherwise.
-
addStyle
@Nonnull public final IMPLTYPE addStyle(@Nullable com.helger.css.propertyvalue.ICSSValue aValue)
Description copied from interface:IHCHasCSSStylesAdd an element specific style.- Specified by:
addStylein interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
aValue- The value to be added. May benull.- Returns:
- this
-
removeStyle
@Nonnull public final IMPLTYPE removeStyle(@Nonnull com.helger.css.property.ECSSProperty eProperty)
Description copied from interface:IHCHasCSSStylesRemove the specified style from the element- Specified by:
removeStylein interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eProperty- The style property to remove- Returns:
- this
-
removeAllStyles
@Nonnull public final IMPLTYPE removeAllStyles()
Description copied from interface:IHCHasCSSStylesRemove all styles from the element- Specified by:
removeAllStylesin interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- this
-
getAllStylesAsString
@Nullable public final String getAllStylesAsString(@Nonnull com.helger.css.ICSSWriterSettings aCSSSettings)
Description copied from interface:IHCHasCSSStylesThe value to be set to the HTML style attribute- Specified by:
getAllStylesAsStringin interfaceIHCHasCSSStyles<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
aCSSSettings- The CSS settings to use- Returns:
nullif no styles are present
-
getDirection
@Nullable public final EHCTextDirection getDirection()
- Specified by:
getDirectionin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The value of the HTML
dirattribute. May benull.
-
setDirection
@Nonnull public final IMPLTYPE setDirection(@Nullable EHCTextDirection eDirection)
Description copied from interface:IHCElementSet the value of the HTMLdirattribute.- Specified by:
setDirectionin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eDirection- The new direction. May benull.- Returns:
- this
-
getLanguage
@Nullable public final String getLanguage()
- Specified by:
getLanguagein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The value of the HTML
langattribute. May benull.
-
setLanguage
@Nonnull public final IMPLTYPE setLanguage(@Nullable String sLanguage)
Description copied from interface:IHCElementSet the value of the HTMLlangattribute.- Specified by:
setLanguagein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
sLanguage- The new language. May benull.- Returns:
- this
-
getEventMap
@Nullable @ReturnsMutableObject public final JSEventMap getEventMap()
- Specified by:
getEventMapin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>
-
getEventHandler
@Nullable public final IHasJSCode getEventHandler(@Nullable EJSEvent eJSEvent)
Description copied from interface:IHCElementGet the event handler of the specified event.- Specified by:
getEventHandlerin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eJSEvent- The event to query. May benull.- Returns:
nullif no such event handler is registered.
-
containsEventHandler
public final boolean containsEventHandler(@Nullable EJSEvent eJSEvent)
Description copied from interface:IHCElementCheck if any event handler is registered for the specified event.- Specified by:
containsEventHandlerin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eJSEvent- The event to be queried. May benull.- Returns:
trueof a non-nullevent is specified, and if a handler is present.
-
addEventHandler
@Nonnull public final IMPLTYPE addEventHandler(@Nonnull EJSEvent eJSEvent, @Nullable IHasJSCode aJSCode)
Description copied from interface:IHCElementAdd a JS event handler at the end.- Specified by:
addEventHandlerin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eJSEvent- The event to use. May not benull.aJSCode- The JSCode to be executed on the specified event. May benullin which case nothing happens.- Returns:
- this.
-
prependEventHandler
@Nonnull public final IMPLTYPE prependEventHandler(@Nonnull EJSEvent eJSEvent, @Nullable IHasJSCode aJSCode)
Description copied from interface:IHCElementAdd a JS event handler at the front.- Specified by:
prependEventHandlerin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eJSEvent- The event to use. May not benull.aJSCode- The JSCode to be executed on the specified event. May benullin which case nothing happens.- Returns:
- this.
-
setEventHandler
@Nonnull public final IMPLTYPE setEventHandler(@Nonnull EJSEvent eJSEvent, @Nullable IHasJSCode aJSCode)
Description copied from interface:IHCElementSet a JS event handler. All eventually present event handlers are overwritten.- Specified by:
setEventHandlerin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eJSEvent- The event to set. May not benull.aJSCode- The JSCode to be executed on the specified event. May benullin which case no event handler will be present after the call.- Returns:
- this.
-
removeAllEventHandler
@Nonnull public final IMPLTYPE removeAllEventHandler(@Nullable EJSEvent eJSEvent)
Description copied from interface:IHCElementRemove all event handler for the specified JS event.- Specified by:
removeAllEventHandlerin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eJSEvent- The JS event to remove the handler. May benull.- Returns:
- this
-
isUnfocusable
public final boolean isUnfocusable()
- Specified by:
isUnfocusablein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
trueif this element cannot be focused.
-
setUnfocusable
@Nonnull public final IMPLTYPE setUnfocusable(boolean bUnfocusable)
Description copied from interface:IHCElementSet the unfocusable state of this element.- Specified by:
setUnfocusablein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
bUnfocusable-trueto make it unfocusable,falseotherwise.- Returns:
- this
-
isHidden
public final boolean isHidden()
- Specified by:
isHiddenin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
trueif this is hidden
-
setHidden
@Nonnull public final IMPLTYPE setHidden(boolean bHidden)
Description copied from interface:IHCElementSet the hidden state of this element- Specified by:
setHiddenin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
bHidden-trueif it is hidden,falseotherwise- Returns:
- this
-
getTabIndex
@CheckForSigned public final long getTabIndex()
- Specified by:
getTabIndexin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The tab index of this object. The semantics of negative values
depends on the browser! In HTML5 negative values are allowed but
won't set a focus when tabbing. The default value is indicated by
IHCElement.DEFAULT_TABINDEX
-
setTabIndex
@Nonnull public final IMPLTYPE setTabIndex(long nTabIndex)
Description copied from interface:IHCElementSet the tab index of this object. This is a common element in HTML5 only. The default value isIHCElement.DEFAULT_TABINDEX- Specified by:
setTabIndexin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
nTabIndex- The tab-index of this object. The semantics of negative values depends on the browser! In HTML5 negative values are allowed but won't set a focus when tabbing.- Returns:
- this
-
getAccessKey
@Nullable public final String getAccessKey()
- Specified by:
getAccessKeyin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The value of the HTML
accesskeyattribute. May benull.
-
setAccessKey
@Nonnull public final IMPLTYPE setAccessKey(@Nullable String sAccessKey)
Description copied from interface:IHCElementSet the value of the HTMLaccesskeyattribute.- Specified by:
setAccessKeyin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
sAccessKey- The new accesskey. May benull.- Returns:
- this
-
isTranslateOn
public final boolean isTranslateOn()
- Specified by:
isTranslateOnin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
trueif HTMLtranslateistrue.
-
isTranslateOff
public final boolean isTranslateOff()
- Specified by:
isTranslateOffin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
trueif HTMLtranslateisfalse.
-
isTranslateUndefined
public final boolean isTranslateUndefined()
- Specified by:
isTranslateUndefinedin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
trueif HTMLtranslateis not set.
-
getTranslate
@Nonnull public final com.helger.commons.state.ETriState getTranslate()
- Specified by:
getTranslatein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The value of the HTML
translateattribute. Nevernull.
-
setTranslate
@Nonnull public final IMPLTYPE setTranslate(@Nonnull com.helger.commons.state.ETriState eTranslate)
Description copied from interface:IHCElementSet the value of the HTMLtranslateattribute.- Specified by:
setTranslatein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eTranslate- The new translate state. May not benull.- Returns:
- this
-
getContentEditable
@Nullable public final EHCContentEditable getContentEditable()
- Specified by:
getContentEditablein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The current state of content editable
-
setContentEditable
@Nonnull public final IMPLTYPE setContentEditable(@Nullable EHCContentEditable eContentEditable)
Description copied from interface:IHCElementChange the content editable state- Specified by:
setContentEditablein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eContentEditable- New value. May benull.- Returns:
- this
-
getDraggable
@Nullable public final EHCDraggable getDraggable()
- Specified by:
getDraggablein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- the draggable state. May be
null.
-
setDraggable
@Nonnull public final IMPLTYPE setDraggable(@Nullable EHCDraggable eDraggable)
Description copied from interface:IHCElementSet the draggable state of this element- Specified by:
setDraggablein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eDraggable- Value to set. May benull.- Returns:
- this
-
isSpellCheck
public final boolean isSpellCheck()
- Specified by:
isSpellCheckin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
trueif spell check is enabled,falseotherwise.
-
setSpellCheck
@Nonnull public final IMPLTYPE setSpellCheck(boolean bSpellCheck)
Description copied from interface:IHCElementSet the value of the HTMLspellcheckattribute.- Specified by:
setSpellCheckin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
bSpellCheck-trueto enabled,falseotherwise.- Returns:
- this
-
getRole
@Nullable public final EHTMLRole getRole()
- Specified by:
getRolein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- The role of this element. May be
null. By default an element has no role.
-
setRole
@Nonnull public final IMPLTYPE setRole(@Nullable EHTMLRole eRole)
Description copied from interface:IHCElementSet the role attribute of this element.- Specified by:
setRolein interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Parameters:
eRole- The role to set. May benull. According to the specs, abstract roles should not be used!- Returns:
- this
-
customAttrs
@Nonnull @ReturnsMutableCopy public final IHCAttrContainer customAttrs()
- Specified by:
customAttrsin interfaceIHCElement<IMPLTYPE extends AbstractHCElement<IMPLTYPE>>- Returns:
- A non-
nullset of "custom" attributes for which no predefined method binding is available. Used e.g. for "aria-*" and "data-*" attributes.
-
onFinalizeNodeState
@OverridingMethodsMustInvokeSuper protected void onFinalizeNodeState(@Nonnull IHCConversionSettingsToNode aConversionSettings, @Nonnull IHCHasChildrenMutable<?,? super IHCNode> aTargetNode)
Description copied from class:AbstractHCNodeFinalize the node by applying any internal state that was not yet converted to a HC element. This method is called at maximum once per IHCNode. It is safe to still add classes, style or children to this node in this method.- Overrides:
onFinalizeNodeStatein classAbstractHCNode- Parameters:
aConversionSettings- HC conversion settingsaTargetNode- The target node where additional nodes should be added
-
onConsistencyCheck
protected void onConsistencyCheck(@Nonnull IHCConversionSettingsToNode aConversionSettings)
- Overrides:
onConsistencyCheckin classAbstractHCNode- Parameters:
aConversionSettings- HC conversion settings
-
createMicroElement
@OverrideOnDemand @Nonnull protected com.helger.xml.microdom.IMicroElement createMicroElement(@Nonnull IHCConversionSettingsToNode aConversionSettings)
- Parameters:
aConversionSettings- The conversion settings to be used- Returns:
- The created micro element for this HC element. May not be
null.
-
fillMicroElement
@OverrideOnDemand @OverridingMethodsMustInvokeSuper protected void fillMicroElement(@Nonnull com.helger.xml.microdom.IMicroElement aElement, @Nonnull IHCConversionSettingsToNode aConversionSettings)
Set all attributes and child elements of this object- Parameters:
aElement- The current micro element to be filled. Nevernull.aConversionSettings- The conversion settings to be used. Nevernull.
-
finishMicroElement
@OverrideOnDemand protected void finishMicroElement(@Nonnull com.helger.xml.microdom.IMicroElement eElement, @Nonnull IHCConversionSettingsToNode aConversionSettings)
This method is called after the element itself was created and filled. Overwrite this method to perform actions that can only be done after the element was build finally.- Parameters:
eElement- The created micro elementaConversionSettings- The conversion settings to be used
-
internalConvertToMicroNode
@Nonnull @OverridingMethodsMustInvokeSuper protected com.helger.xml.microdom.IMicroNode internalConvertToMicroNode(@Nonnull IHCConversionSettingsToNode aConversionSettings)
- Specified by:
internalConvertToMicroNodein classAbstractHCNode
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCNode
-
-