Package com.helger.html.hc.html.tabular
Class AbstractHCBaseTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<IMPLTYPE>
-
- com.helger.html.hc.html.tabular.AbstractHCBaseTable<IMPLTYPE>
-
- Type Parameters:
IMPLTYPE- 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>,IHCTable<IMPLTYPE>,IHCHasID<IMPLTYPE>,IHCNode,Serializable
- Direct Known Subclasses:
AbstractHCTable
public abstract class AbstractHCBaseTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>> extends AbstractHCElement<IMPLTYPE> implements IHCTable<IMPLTYPE>
This is the common base class for regular HC tables as well as for more complex constructs (e.g. PUI)- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ICSSClassProviderCSS_FORCE_COLSPAN-
Fields inherited from class com.helger.html.hc.html.AbstractHCElement
DEFAULT_HIDDEN, DEFAULT_SPELLCHECK, DEFAULT_TRANSLATE, DEFAULT_UNFOCUSABLE
-
Fields inherited from interface com.helger.html.hc.html.IHCElement
DEFAULT_TABINDEX
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractHCBaseTable(EHTMLElement aElement)This constructor is used to create elements with logic like a table but actually not having a top 'table' element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IMPLTYPEaddColumn(IHCCol<?> aCol)Add the specified column.IMPLTYPEaddColumnAt(int nIndex, IHCCol<?> aCol)Add the specified column at the specified index.booleancanConvertToMicroNode(IHCConversionSettingsToNode aConversionSettings)This method checks whether the node is suitable for conversion to anIMicroNode.voidcheckInternalConsistency()voidforAllChildren(Consumer<? super IHCNode> aConsumer)voidforAllChildren(Predicate<? super IHCNode> aFilter, Consumer<? super IHCNode> aConsumer)com.helger.commons.state.EContinueforAllChildrenBreakable(Function<? super IHCNode,com.helger.commons.state.EContinue> aConsumer)<DSTTYPE> voidforAllChildrenMapped(Predicate<? super IHCNode> aFilter, Function<? super IHCNode,? extends DSTTYPE> aMapper, Consumer<? super DSTTYPE> aConsumer)com.helger.commons.collection.impl.ICommonsList<IHCNode>getAllChildren()HCTBodygetBody()intgetCellPadding()intgetCellSpacing()IHCNodegetChildAtIndex(int nIndex)intgetChildCount()com.helger.commons.collection.impl.ICommonsIterable<? extends IHCNode>getChildren()HCColGroupgetColGroup()intgetColumnCount()IHCNodegetFirstChild()HCTFootgetFoot()HCTHeadgetHead()IHCNodegetLastChild()StringgetPlainText()booleanhasChildren()protected voidonConsistencyCheck(IHCConversionSettingsToNode aConversionSettings)IMPLTYPEremoveAllColumns()Remove all column definitions.IMPLTYPEremoveColumnAt(int nColumnIndex)Remove the column definition at the specified index.IMPLTYPEsetBody(HCTBody aBody)IMPLTYPEsetCellPadding(int nCellPadding)Set the cell padding.IMPLTYPEsetCellSpacing(int nCellSpacing)Set the cell spacing.IMPLTYPEsetFoot(HCTFoot aFoot)IMPLTYPEsetHead(HCTHead aHead)StringtoString()-
Methods inherited from class com.helger.html.hc.html.AbstractHCElement
addClass, addEventHandler, addStyle, containsClass, containsEventHandler, containsStyle, createMicroElement, customAttrs, fillMicroElement, finishMicroElement, getAccessKey, getAllClasses, getAllClassesAsString, getAllClassNames, getAllStyles, getAllStylesAsString, getAllStyleValues, getContentEditable, getDirection, getDraggable, getElement, getEventHandler, getEventMap, getID, getLanguage, getRole, getStyleValue, getTabIndex, getTagName, getTitle, getTranslate, hasAnyClass, hasAnyStyle, hasStyle, internalConvertToMicroNode, isHidden, isSpellCheck, isTranslateOff, isTranslateOn, isTranslateUndefined, isUnfocusable, isValidID, onFinalizeNodeState, prependEventHandler, removeAllClasses, removeAllEventHandler, removeAllStyles, removeClass, removeStyle, setAccessKey, setContentEditable, setDirection, setDraggable, setEventHandler, setHidden, setID, setID, setLanguage, setRole, setSpellCheck, setTabIndex, setTitle, setTranslate, setUnfocusable
-
Methods inherited from class com.helger.html.hc.impl.AbstractHCNode
consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, findFirstChild, findFirstChildMapped, getNodeState, 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.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenSorted
findFirstChild, findFirstChildMapped
-
Methods inherited from interface com.helger.html.hc.html.IHCElement
addEventHandler, containsEventHandler, customAttrs, getAccessKey, getContentEditable, getDirection, getDraggable, getElement, getEventHandler, getEventMap, getLanguage, getRole, getTabIndex, getTagName, getTitle, getTranslate, isHidden, isSpellCheck, isTranslateOff, isTranslateOn, isTranslateUndefined, isUnfocusable, prependEventHandler, removeAllEventHandler, setAccessKey, setContentEditable, setDirection, setDraggable, setEventHandler, setHidden, setLanguage, setRole, setSpellCheck, setTabIndex, setTitle, setTranslate, setTranslate, setUnfocusable, withCustomAttrs
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSClasses
addClass, addClasses, addClasses, addClasses, containsClass, getAllClasses, getAllClassesAsString, getAllClassNames, hasAnyClass, removeAllClasses, removeClass
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSStyles
addStyle, addStyle, addStyles, addStyles, addStyles, containsStyle, getAllStyles, getAllStylesAsString, getAllStyleValues, getStyleValue, hasAnyStyle, hasStyle, removeAllStyles, removeStyle
-
Methods inherited from interface com.helger.html.hc.IHCHasID
ensureID, getID, hasID, hasNoID, setID, setUniqueID
-
Methods inherited from interface com.helger.html.hc.IHCNode
consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, registerExternalResources
-
Methods inherited from interface com.helger.html.hc.html.tabular.IHCTable
addBodyClass, addBodyRow, addBodyRow, addBodyRowAt, addBodyRowAt, addColumns, addColumns, addColumns, addFooterClass, addFooterRow, addFooterRow, addFooterRowAt, addFooterRowAt, addHeaderClass, addHeaderRow, addHeaderRow, addHeaderRowAt, addHeaderRowAt, addSpanningBodyContent, addSpanningBodyContent, addSpanningFooterContent, addSpanningFooterContent, addSpanningHeaderContent, addSpanningHeaderContent, getAllBodyClasses, getAllBodyClassesAsString, getAllBodyRows, getAllColumns, getAllFooterClasses, getAllFooterClassesAsString, getAllFooterRows, getAllHeaderClasses, getAllHeaderClassesAsString, getAllHeaderRows, getBodyID, getBodyRowAtIndex, getBodyRowCount, getFirstBodyRow, getFirstFooterRow, getFirstHeaderRow, getFooterID, getFooterRowAtIndex, getFooterRowCount, getHeaderID, getHeaderRowAtIndex, getHeaderRowCount, getLastBodyRow, getLastFooterRow, getLastHeaderRow, hasBodyClasses, hasBodyID, hasBodyRows, hasFooterClasses, hasFooterID, hasFooterRows, hasHeaderClasses, hasHeaderID, hasHeaderRows, removeAllBodyRows, removeAllFooterRows, removeAllHeaderRows, removeBodyClass, removeBodyRowAt, removeFooterClass, removeFooterRowAt, removeHeaderClass, removeHeaderRowAt, setBodyID, setFooterID, setHeaderID, setSpanningFooterContent, setSpanningFooterContent, setSpanningHeaderContent, setSpanningHeaderContent, sortAllBodyRows, sortAllFooterRows, sortAllHeaderRows
-
-
-
-
Field Detail
-
CSS_FORCE_COLSPAN
public static final ICSSClassProvider CSS_FORCE_COLSPAN
-
-
Constructor Detail
-
AbstractHCBaseTable
protected AbstractHCBaseTable(@Nonnull @Nonempty EHTMLElement aElement)
This constructor is used to create elements with logic like a table but actually not having a top 'table' element- Parameters:
aElement- The HTML element to be used to create the table
-
-
Method Detail
-
getHead
@Nonnull public final HCTHead getHead()
- Specified by:
getHeadin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Returns:
- The table header. Never
null.
-
setHead
@Nonnull public final IMPLTYPE setHead(@Nonnull HCTHead aHead)
- Specified by:
setHeadin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>
-
getBody
@Nonnull public final HCTBody getBody()
- Specified by:
getBodyin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Returns:
- The table body. Never
null.
-
setBody
@Nonnull public final IMPLTYPE setBody(@Nonnull HCTBody aBody)
- Specified by:
setBodyin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>
-
getFoot
@Nonnull public final HCTFoot getFoot()
- Specified by:
getFootin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Returns:
- The table footer. Never
null.
-
setFoot
@Nonnull public final IMPLTYPE setFoot(@Nonnull HCTFoot aFoot)
- Specified by:
setFootin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>
-
hasChildren
public final boolean hasChildren()
- Specified by:
hasChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
hasChildrenin classAbstractHCNode
-
getChildCount
@Nonnegative public final int getChildCount()
- Specified by:
getChildCountin interfacecom.helger.commons.hierarchy.IHasChildren<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
getChildCountin classAbstractHCNode
-
getFirstChild
@Nullable public final IHCNode getFirstChild()
- Specified by:
getFirstChildin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
getFirstChildin classAbstractHCNode
-
getLastChild
@Nullable public final IHCNode getLastChild()
- Specified by:
getLastChildin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
getLastChildin classAbstractHCNode
-
getAllChildren
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsList<IHCNode> getAllChildren()
- Specified by:
getAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Specified by:
getAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
getAllChildrenin classAbstractHCNode
-
getChildren
@Nonnull public com.helger.commons.collection.impl.ICommonsIterable<? extends IHCNode> getChildren()
- Specified by:
getChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
getChildrenin classAbstractHCNode
-
getChildAtIndex
@Nullable public final IHCNode getChildAtIndex(@Nonnegative int nIndex)
- Specified by:
getChildAtIndexin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
getChildAtIndexin classAbstractHCNode
-
getCellSpacing
@CheckForSigned public final int getCellSpacing()
- Specified by:
getCellSpacingin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Returns:
- The cell spacing. Values ≤ 0 mean undefined.
-
setCellSpacing
@Nonnull public final IMPLTYPE setCellSpacing(int nCellSpacing)
Description copied from interface:IHCTableSet the cell spacing.- Specified by:
setCellSpacingin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Parameters:
nCellSpacing- New value. Values ≤ 0 mean undefined.- Returns:
- this
-
getCellPadding
@CheckForSigned public final int getCellPadding()
- Specified by:
getCellPaddingin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Returns:
- The cell padding. Values ≤ 0 mean undefined.
-
setCellPadding
@Nonnull public final IMPLTYPE setCellPadding(int nCellPadding)
Description copied from interface:IHCTableSet the cell padding.- Specified by:
setCellPaddingin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Parameters:
nCellPadding- New value. Values ≤ 0 mean undefined.- Returns:
- this
-
getColGroup
@Nullable public final HCColGroup getColGroup()
- Specified by:
getColGroupin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Returns:
- The column group used for this table. May be
nullif undefined.
-
addColumn
@Nonnull public final IMPLTYPE addColumn(@Nullable IHCCol<?> aCol)
Description copied from interface:IHCTableAdd the specified column.- Specified by:
addColumnin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Parameters:
aCol- The column to be added. May benull.- Returns:
- this
-
addColumnAt
@Nonnull public final IMPLTYPE addColumnAt(@Nonnegative int nIndex, @Nullable IHCCol<?> aCol)
Description copied from interface:IHCTableAdd the specified column at the specified index.- Specified by:
addColumnAtin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Parameters:
nIndex- The index where the column should be added. Must be ≥ 0.aCol- The column to be added. May benull.- Returns:
- this
-
removeColumnAt
@Nonnull public final IMPLTYPE removeColumnAt(@Nonnegative int nColumnIndex)
Description copied from interface:IHCTableRemove the column definition at the specified index. This does not affect any row contents.- Specified by:
removeColumnAtin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Parameters:
nColumnIndex- The index of the column to remove- Returns:
- this
-
removeAllColumns
@Nonnull public final IMPLTYPE removeAllColumns()
Description copied from interface:IHCTableRemove all column definitions. This does not affect any row contents.- Specified by:
removeAllColumnsin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Returns:
- this
-
getColumnCount
@Nonnegative public final int getColumnCount()
- Specified by:
getColumnCountin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Returns:
- The number of columns as specified in the column group. If no column group is defined, 0 is returned.
-
canConvertToMicroNode
@OverridingMethodsMustInvokeSuper public boolean canConvertToMicroNode(@Nonnull IHCConversionSettingsToNode aConversionSettings)
Description copied from interface:IHCNodeThis method checks whether the node is suitable for conversion to anIMicroNode. If this node cannot be converted, no child node will be converted as well!- Specified by:
canConvertToMicroNodein interfaceIHCNode- Overrides:
canConvertToMicroNodein classAbstractHCNode- Parameters:
aConversionSettings- The conversion settings to be used- Returns:
trueif the node can be converted to a node,falseotherwise.
-
checkInternalConsistency
public void checkInternalConsistency()
- Specified by:
checkInternalConsistencyin interfaceIHCTable<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>
-
onConsistencyCheck
protected void onConsistencyCheck(@Nonnull IHCConversionSettingsToNode aConversionSettings)
- Overrides:
onConsistencyCheckin classAbstractHCElement<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Parameters:
aConversionSettings- HC conversion settings
-
getPlainText
@Nonnull public final String getPlainText()
- Specified by:
getPlainTextin interfaceIHCNode- Overrides:
getPlainTextin classAbstractHCNode- Returns:
- The plain text representation of this text. May not be
null.
-
forAllChildren
public final void forAllChildren(@Nonnull Consumer<? super IHCNode> aConsumer)
- Specified by:
forAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
forAllChildrenin classAbstractHCNode
-
forAllChildrenBreakable
@Nonnull public final com.helger.commons.state.EContinue forAllChildrenBreakable(@Nonnull Function<? super IHCNode,com.helger.commons.state.EContinue> aConsumer)
- Specified by:
forAllChildrenBreakablein interfacecom.helger.commons.hierarchy.IHasChildren<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
forAllChildrenBreakablein classAbstractHCNode
-
forAllChildren
public final void forAllChildren(@Nonnull Predicate<? super IHCNode> aFilter, @Nonnull Consumer<? super IHCNode> aConsumer)
- Specified by:
forAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
forAllChildrenin classAbstractHCNode
-
forAllChildrenMapped
public <DSTTYPE> void forAllChildrenMapped(@Nonnull Predicate<? super IHCNode> aFilter, @Nonnull Function<? super IHCNode,? extends DSTTYPE> aMapper, @Nonnull Consumer<? super DSTTYPE> aConsumer)
- Specified by:
forAllChildrenMappedin interfacecom.helger.commons.hierarchy.IHasChildren<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>- Overrides:
forAllChildrenMappedin classAbstractHCNode
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCElement<IMPLTYPE extends AbstractHCBaseTable<IMPLTYPE>>
-
-