Package com.helger.html.hc.html.tabular
Class HCRow
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<IMPLTYPE>
-
- com.helger.html.hc.html.AbstractHCElementWithInternalChildren<HCRow,IHCCell<?>>
-
- com.helger.html.hc.html.tabular.HCRow
-
- 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<HCRow>,IHCElement<HCRow>,IHCElementWithInternalChildren<HCRow,IHCCell<?>>,IHCHasCSSClasses<HCRow>,IHCHasCSSStyles<HCRow>,IHCHasChildrenMutable<HCRow,IHCCell<?>>,IHCHasID<HCRow>,IHCNode,Serializable
public class HCRow extends AbstractHCElementWithInternalChildren<HCRow,IHCCell<?>>
Represents an HTML <tr> element- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IHCCell<?>addAndReturnCell(IHCNode aCellChild)Add a single new cell and add the passed element.IHCCell<?>addAndReturnCell(IHCNode... aCellChildren)Add a single new cell and add the passed elements.IHCCell<?>addAndReturnCell(Iterable<? extends IHCNode> aCellChildren)Add a single new cell and add the passed elements.IHCCell<?>addAndReturnCell(String sCellText)Add a single cell with the given text element.IHCCell<?>addAndReturnCell(String... aCellTexts)Add a single cell with the given text elements.IHCCell<?>addAndReturnCellAt(int nIndex, IHCNode aCellChild)Add a single new cell and add the passed element.IHCCell<?>addAndReturnCellAt(int nIndex, IHCNode... aCellChildren)Add a single new cell and add the passed elements.IHCCell<?>addAndReturnCellAt(int nIndex, Iterable<? extends IHCNode> aCellChildren)Add a single new cell and add the passed elements.IHCCell<?>addAndReturnCellAt(int nIndex, String sCellText)Add a single cell with the given text element.IHCCell<?>addAndReturnCellAt(int nIndex, String... aCellTexts)Add a single cell with the given text elements.IHCCell<?>addCell()Add an empty cell.HCRowaddCell(IHCNode aChild)Add a single new cell and add the passed element.HCRowaddCell(IHCNode... aCellChildren)Add a single new cell and add the passed elements.HCRowaddCell(Iterable<? extends IHCNode> aCellChildren)Add a single new cell and add the passed elements.HCRowaddCell(String sCellText)Add a single cell with the given text element.HCRowaddCell(String... aCellTexts)Add a single new cell and add the passed texts.IHCCell<?>addCellAt(int nIndex)Add an empty cell at the specified index.HCRowaddCellAt(int nIndex, IHCNode aChild)Add a single new cell and add the passed element.HCRowaddCellAt(int nIndex, IHCNode... aCellChildren)Add a single new cell and add the passed elements.HCRowaddCellAt(int nIndex, Iterable<? extends IHCNode> aCellChildren)Add a single new cell and add the passed elements.HCRowaddCellAt(int nIndex, String sCellText)Add a single cell with the given text element.HCRowaddCellAt(int nIndex, String... aCellChildren)Add a single new cell and add the passed texts.HCRowaddCells(IHCNode aCellChild)Deprecated.HCRowaddCells(IHCNode... aCellChildren)Add multiple cells, one for each passed element.HCRowaddCells(Iterable<? extends IHCNode> aCellChildren)Add multiple cells, one for each passed element.HCRowaddCells(String sCellChild)Deprecated.HCRowaddCells(String... aCellTexts)Add multiple cells, one for each passed string.booleancanConvertToMicroNode(IHCConversionSettingsToNode aConversionSettings)This method checks whether the node is suitable for conversion to anIMicroNode.IHCCell<?>getCellAtEffectiveIndex(int nIndex)Get the cell at the specified index in this row.IHCCell<?>getCellAtIndex(int nIndex)Get the cell at the specified index in this row.intgetCellCount()Note: this method only counts the effective cells and does NOT include eventually contained "colspans"!intgetEffectiveCellCount()Count the number of effective cells - including "colspans" - of this row.booleanisColspanUsed()booleanisHeader()booleanisRowspanUsed()HCRowremoveCellAt(int nIndex)Remove the cell at the specified indexStringtoString()-
Methods inherited from class com.helger.html.hc.html.AbstractHCElementWithInternalChildren
addChild, addChildAt, afterAddChild, afterRemoveChild, beforeAddChild, children, fillMicroElement, findFirstChild, findFirstChildMapped, forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getAllChildrenAsNodeList, getChildAtIndex, getChildCount, getChildren, getChildrenFormEmitting, getFirstChild, getLastChild, getPlainText, hasChildren, removeAllChildren, removeChild, removeChildAt, sortAllChildren
-
Methods inherited from class com.helger.html.hc.html.AbstractHCElement
addClass, addEventHandler, addStyle, containsClass, containsEventHandler, containsStyle, createMicroElement, customAttrs, 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, onConsistencyCheck, 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, 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.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.IHCElementWithInternalChildren
recursiveContainsChildWithTagName
-
Methods inherited from interface com.helger.html.hc.IHCHasChildrenMutable
addAndReturnChild, addAndReturnChildAt, addChildren, addChildren, addChildren, addChildrenAt, addChildrenAt, setChild
-
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
-
-
-
-
Method Detail
-
isHeader
public final boolean isHeader()
-
addCell
@Nonnull public final IHCCell<?> addCell()
Add an empty cell.- Returns:
- The created cell. Never
null.
-
addCellAt
@Nonnull public final IHCCell<?> addCellAt(@Nonnegative int nIndex)
Add an empty cell at the specified index.- Parameters:
nIndex- The index where the cell should be added- Returns:
- The created cell. Never
null.
-
addAndReturnCell
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCell(@Nullable String sCellText)
Add a single cell with the given text element.- Parameters:
sCellText- The text to be set into the cell. May benull.- Returns:
- the created table cell
-
addAndReturnCell
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCell(@Nullable IHCNode aCellChild)
Add a single new cell and add the passed element.- Parameters:
aCellChild- The element to add. May benull.- Returns:
- The created cell. Never
null.
-
addAndReturnCell
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCell(@Nullable String... aCellTexts)
Add a single cell with the given text elements.- Parameters:
aCellTexts- The text to be set into the cell. May benull.- Returns:
- the created table cell
-
addAndReturnCell
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCell(@Nullable IHCNode... aCellChildren)
Add a single new cell and add the passed elements.- Parameters:
aCellChildren- The list of elements to add. May benull.- Returns:
- The created cell. Never
null.
-
addAndReturnCell
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCell(@Nullable Iterable<? extends IHCNode> aCellChildren)
Add a single new cell and add the passed elements.- Parameters:
aCellChildren- The list of elements to add. May benull.- Returns:
- The created cell. Never
null.
-
addAndReturnCellAt
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCellAt(@Nonnegative int nIndex, @Nullable String sCellText)
Add a single cell with the given text element.- Parameters:
nIndex- The index where the cell should be addedsCellText- The text to be set into the cell. May benull.- Returns:
- the created table cell
-
addAndReturnCellAt
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCellAt(@Nonnegative int nIndex, @Nullable IHCNode aCellChild)
Add a single new cell and add the passed element.- Parameters:
nIndex- The index where the cell should be addedaCellChild- The element to add. May benull.- Returns:
- The created cell. Never
null.
-
addAndReturnCellAt
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCellAt(@Nonnegative int nIndex, @Nullable String... aCellTexts)
Add a single cell with the given text elements.- Parameters:
nIndex- The index where the cell should be addedaCellTexts- The text to be set into the cell. May benull.- Returns:
- the created table cell
-
addAndReturnCellAt
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCellAt(@Nonnegative int nIndex, @Nullable IHCNode... aCellChildren)
Add a single new cell and add the passed elements.- Parameters:
nIndex- The index where the cell should be addedaCellChildren- The list of elements to add. May benull.- Returns:
- The created cell. Never
null.
-
addAndReturnCellAt
@Nonnull @CheckReturnValue public final IHCCell<?> addAndReturnCellAt(@Nonnegative int nIndex, @Nullable Iterable<? extends IHCNode> aCellChildren)
Add a single new cell and add the passed elements.- Parameters:
nIndex- The index where the cell should be addedaCellChildren- The list of elements to add. May benull.- Returns:
- The created cell. Never
null.
-
addCell
@Nonnull public final HCRow addCell(@Nullable String sCellText)
Add a single cell with the given text element.- Parameters:
sCellText- The text to be set into the cell. May benull.- Returns:
- this (the table row)
-
addCell
@Nonnull public final HCRow addCell(@Nullable IHCNode aChild)
Add a single new cell and add the passed element.- Parameters:
aChild- The element to add. May benull.- Returns:
- this (the table row)
-
addCell
@Nonnull public final HCRow addCell(@Nullable String... aCellTexts)
Add a single new cell and add the passed texts.- Parameters:
aCellTexts- The list of texts to add. May benull.- Returns:
- this (the table row)
-
addCell
@Nonnull public final HCRow addCell(@Nullable IHCNode... aCellChildren)
Add a single new cell and add the passed elements.- Parameters:
aCellChildren- The list of elements to add. May benull.- Returns:
- this (the table row)
-
addCell
@Nonnull public final HCRow addCell(@Nullable Iterable<? extends IHCNode> aCellChildren)
Add a single new cell and add the passed elements.- Parameters:
aCellChildren- The list of elements to add. May benull.- Returns:
- this (the table row)
-
addCellAt
@Nonnull public final HCRow addCellAt(@Nonnegative int nIndex, @Nullable String sCellText)
Add a single cell with the given text element.- Parameters:
nIndex- The index where the cell should be addedsCellText- The text to be set into the cell. May benull.- Returns:
- this (the table row)
-
addCellAt
@Nonnull public final HCRow addCellAt(@Nonnegative int nIndex, @Nullable IHCNode aChild)
Add a single new cell and add the passed element.- Parameters:
nIndex- The index where the cell should be addedaChild- The element to add. May benull.- Returns:
- this (the table row)
-
addCellAt
@Nonnull public final HCRow addCellAt(@Nonnegative int nIndex, @Nullable String... aCellChildren)
Add a single new cell and add the passed texts.- Parameters:
nIndex- The index where the cell should be addedaCellChildren- The list of texts to add. May benull.- Returns:
- this (the table row)
-
addCellAt
@Nonnull public final HCRow addCellAt(@Nonnegative int nIndex, @Nullable IHCNode... aCellChildren)
Add a single new cell and add the passed elements.- Parameters:
nIndex- The index where the cell should be addedaCellChildren- The list of elements to add. May benull.- Returns:
- this (the table row)
-
addCellAt
@Nonnull public final HCRow addCellAt(@Nonnegative int nIndex, @Nullable Iterable<? extends IHCNode> aCellChildren)
Add a single new cell and add the passed elements.- Parameters:
nIndex- The index where the cell should be addedaCellChildren- The list of elements to add. May benull.- Returns:
- this (the table row)
-
addCells
@Deprecated(forRemoval=false) @Nonnull @DevelopersNote("Use addCell") public final HCRow addCells(@Nullable String sCellChild)
Deprecated.
-
addCells
@Nonnull public final HCRow addCells(@Nullable String... aCellTexts)
Add multiple cells, one for each passed string.- Parameters:
aCellTexts- The list of strings for which a table cell should be created.- Returns:
- this (the table row)
-
addCells
@Deprecated(forRemoval=false) @Nonnull @DevelopersNote("Use addCell") public final HCRow addCells(@Nullable IHCNode aCellChild)
Deprecated.
-
addCells
@Nonnull public final HCRow addCells(@Nullable IHCNode... aCellChildren)
Add multiple cells, one for each passed element.- Parameters:
aCellChildren- The list of elements for which new cells should be created. May benull.- Returns:
- this (the table row)
-
addCells
@Nonnull public final HCRow addCells(@Nullable Iterable<? extends IHCNode> aCellChildren)
Add multiple cells, one for each passed element.- Parameters:
aCellChildren- The list of elements for which new cells should be created. May benull.- Returns:
- this (the table row)
-
getCellAtIndex
@Nullable public final IHCCell<?> getCellAtIndex(int nIndex)
Get the cell at the specified index in this row. This method does NOT consider colspans!!!!- Parameters:
nIndex- The index of the cell- Returns:
nullif no such cell is present
-
getCellAtEffectiveIndex
@Nullable public final IHCCell<?> getCellAtEffectiveIndex(int nIndex)
Get the cell at the specified index in this row. This method does consider colspans!!!!- Parameters:
nIndex- The index of the cell. Should be ≥ 0.- Returns:
nullif no such cell is present
-
getCellCount
@Nonnegative public final int getCellCount()
Note: this method only counts the effective cells and does NOT include eventually contained "colspans"!- Returns:
- The number of contained cells.
-
getEffectiveCellCount
@Nonnegative public final int getEffectiveCellCount()
Count the number of effective cells - including "colspans" - of this row.- Returns:
- The number of effectively contained cells. Always ≥ 0.
-
removeCellAt
@Nonnull public final HCRow removeCellAt(@Nonnegative int nIndex)
Remove the cell at the specified index- Parameters:
nIndex- The index to remove- Returns:
- this
-
isColspanUsed
public final boolean isColspanUsed()
- Returns:
trueif at least one contained cell uses a colspan.
-
isRowspanUsed
public final boolean isRowspanUsed()
- Returns:
trueif at least one contained cell uses a rowspan.
-
canConvertToMicroNode
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 classAbstractHCElementWithInternalChildren<HCRow,IHCCell<?>>- Parameters:
aConversionSettings- The conversion settings to be used- Returns:
trueif the node can be converted to a node,falseotherwise.
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCElementWithInternalChildren<HCRow,IHCCell<?>>
-
-