Package com.oorian.html.elements
Class Tr<T extends Tr<T>>
java.lang.Object
com.oorian.html.Element<T>
com.oorian.html.VisualElement<T>
com.oorian.html.StyledElement<T>
com.oorian.html.elements.Tr<T>
Represents the HTML
<tr> element for defining a table row.
The Tr class provides a Java representation of the HTML table row element, which defines
a horizontal row of cells within a table. Each row can contain header cells (<th>)
or data cells (<td>), and provides convenient methods for cell creation and
management.
Features:
- Header cell (th) creation and management
- Data cell (td) creation and management
- Multiple overloaded methods for cell creation with various parameters
- Cell width and style configuration
- Support for text, HTML elements, or styled cells
- Bulk cell creation capability
- Cell retrieval and counting methods
- Automatic parent table update propagation
Usage Example:
// Create a header row
Tr headerRow = new Tr();
headerRow.addHeaderCell("Product");
headerRow.addHeaderCell("Price", 100);
headerRow.addHeaderCell("Quantity", "text-center");
// Create a data row with various cell types
Tr dataRow = new Tr();
dataRow.addDataCell("Widget");
dataRow.addDataCell("$19.99");
// Create a cell with an element
TextInput quantityInput = new TextInput();
dataRow.addDataCell(quantityInput);
// Create multiple cells at once
Tr emptyRow = new Tr();
TableCells cells = emptyRow.addDataCells(5);
// Access cells
TableCell firstCell = dataRow.getCell(0);
TableCells allCells = dataRow.getCells();
int cellCount = dataRow.getNumberOfCells();
- Since:
- 2007
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdds an existing table cell to this row.final TdCreates and adds an empty data cell to this row.final TdaddDataCell(CssStyle style) Creates and adds a data cell with the specified style.final TdaddDataCell(Element element) Creates a data cell containing the specified element.final TdaddDataCell(Element element, int width) Creates a data cell containing the specified element with a fixed width.final TdaddDataCell(Element element, CssStyle style) Creates a data cell containing the specified element with a CssStyle.final TdaddDataCell(Element element, String style) Creates a data cell containing the specified element with a CSS class.final TdaddDataCell(String text) Creates a data cell with the specified text content.final TdaddDataCell(String text, int width) Creates a data cell with text and a fixed width.final TdaddDataCell(String text, CssStyle style) Creates a data cell with text and a CssStyle.final TdaddDataCell(String text, String style) Creates a data cell with text and a CSS class.final TableCellsaddDataCells(int num) Creates multiple empty data cells.final ThCreates and adds an empty header cell to this row.final ThaddHeaderCell(CssStyle style) Creates and adds a header cell with the specified style.final ThaddHeaderCell(Element element) Creates a header cell containing the specified element.final ThaddHeaderCell(Element element, int width) Creates a header cell containing the specified element with a fixed width.final ThaddHeaderCell(Element element, String style) Creates a header cell containing the specified element with a CSS class.final ThaddHeaderCell(String text) Creates a header cell with the specified text content.final ThaddHeaderCell(String text, int width) Creates a header cell with text and a fixed width.final ThaddHeaderCell(String text, String style) Creates a header cell with text and a CSS class.final TableCellgetCell(int colnum) Returns the cell at the specified column index.final TableCellsgetCells()Returns all cells in this row.final TableCellsReturns all data cells in this row.final TableCellsReturns all header cells in this row.final intReturns the number of cells in this row.voidRegisters this element for addition to the DOM.voidRegisters this element for removal from the DOM.voidRegisters this element for update in the DOM.final voidRemoves all cells from this row.Methods inherited from class com.oorian.html.StyledElement
addClass, addStyle, addStyle, addStyleAttribute, addTransition, animate, clearTransitions, getActiveStyle, getCssClass, getDisabledStyle, getFocusStyle, getFocusVisibleStyle, getHoverStyle, getHtml, getStyle, getStyleAttribute, hidden, hide, initialize, isDisplayed, isTransitionForwardActive, onHide, onRemovedFromPage, onShow, removeClass, setActiveStyle, setAlignContent, setAlignContent, setAlignItems, setAlignItems, setAlignSelf, setAlignSelf, setAnimation, setAnimationDelay, setAnimationDelay, setAnimationDelay, setAnimationDirection, setAnimationDirection, setAnimationDuration, setAnimationDuration, setAnimationDuration, setAnimationFillMode, setAnimationFillMode, setAnimationIterationCount, setAnimationIterationCount, setAnimationIterationCount, setAnimationName, setAnimationPlayState, setAnimationPlayState, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setBackdropFilter, setBackdropFilter, setBackfaceVisibility, setBackfaceVisibility, setBackground, setBackground, setBackgroundAttachment, setBackgroundAttachment, setBackgroundBlendMode, setBackgroundBlendMode, setBackgroundClip, setBackgroundClip, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBackgroundOrigin, setBackgroundOrigin, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundRepeat, setBackgroundRepeat, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBlur, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottomColor, setBorderBottomColor, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomStyle, setBorderBottomStyle, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderImage, setBorderImage, setBorderImageOutset, setBorderImageRepeat, setBorderImageSlice, setBorderImageSource, setBorderImageWidth, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeftColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftStyle, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRightColor, setBorderRightColor, setBorderRightStyle, setBorderRightStyle, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderStyle, setBorderStyle, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTopColor, setBorderTopColor, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopStyle, setBorderTopStyle, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBottom, setBottom, setBottom, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxSizing, setBoxSizing, setBreakAfter, setBreakBefore, setBreakInside, setBrightness, setClass, setClear, setClear, setClip, setClipPath, setClipPath, setColGap, setColGap, setColor, setColor, setColumnCount, setColumnCount, setColumnFill, setColumnFill, setColumnGap, setColumnRule, setColumnRuleColor, setColumnRuleColor, setColumnRuleStyle, setColumnRuleStyle, setColumnRuleWidth, setColumnRuleWidth, setColumns, setColumns, setColumns, setColumnSpan, setColumnWidth, setColumnWidth, setColumnWidth, setContrast, setCounterIncrement, setCounterReset, setCursor, setCursor, setDirection, setDirection, setDisabledStyle, setDisplay, setDisplay, setFilter, setFilter, setFilterOpacity, setFlex, setFlexBasis, setFlexDirection, setFlexDirection, setFlexFlow, setFlexGrow, setFlexGrow, setFlexShrink, setFlexShrink, setFlexWrap, setFlexWrap, setFloat, setFloat, setFocusStyle, setFocusVisibleStyle, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFontFace, setFontFamily, setFontFamily, setFontFeatureSettings, setFontKerning, setFontLanguageOverride, setFontSize, setFontSize, setFontSize, setFontSizeAdjust, setFontStretch, setFontStretch, setFontStyle, setFontStyle, setFontSynthesis, setFontVariant, setFontVariant, setFontVariantAlternates, setFontVariantCaps, setFontVariantEastAsian, setFontVariantLigatures, setFontVariantNumeric, setFontVariantPosition, setFontWeight, setFontWeight, setGap, setGap, setGap, setGap, setGrayscale, setHangingPunctuation, setHangingPunctuation, setHeight, setHeight, setHeight, setHoverStyle, setHueRotate, setHyphens, setImageOrientation, setImageRendering, setImageResolution, setImeMode, setInvert, setJustifyContent, setJustifyContent, setKeyFrames, setLeft, setLeft, setLeft, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLineBreak, setLineHeight, setLineHeight, setLineHeight, setLineHeight, setMargin, setMargin, setMargin, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMarginTop, setMark, setMarkAfter, setMarkBefore, setMarks, setMarqueeDirection, setMarqueePlayCount, setMarqueeSpeed, setMarqueeStyle, setMask, setMaskType, setMaxHeight, setMaxHeight, setMaxHeight, setMaxHeightToWindowHeight, setMaxWidth, setMaxWidth, setMaxWidth, setMaxWidthToWindowWidth, setMinHeight, setMinHeight, setMinHeight, setMinHeightToWindowHeight, setMinWidth, setMinWidth, setMinWidth, setMinWidthToWindowWidth, setNavDown, setNavIndex, setNavIndex, setNavLeft, setNavRight, setNavUp, setObjectFit, setObjectPosition, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateTo, setOnDblClick, setOnDblClickChange, setOpacity, setOpacity, setOrder, setOrder, setOrphans, setOutline, setOutline, setOutline, setOutline, setOutlineColor, setOutlineColor, setOutlineOffset, setOutlineOffset, setOutlineOffset, setOutlineStyle, setOutlineStyle, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOverflow, setOverflow, setOverflow, setOverflowWrap, setOverflowX, setOverflowX, setOverflowY, setOverflowY, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPaddingTop, setPageBreakAfter, setPageBreakAfter, setPageBreakBefore, setPageBreakBefore, setPageBreakInside, setPageBreakInside, setPerspective, setPerspective, setPerspective, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPhonemes, setPosition, setPosition, setPosition, setPosition, setPosition, setQuotes, setResize, setResize, setResizeToWindowHeight, setResizeToWindowHeight, setResizeToWindowWidth, setRest, setRestAfter, setRestBefore, setRight, setRight, setRight, setRotate, setRotate, setRowGap, setRowGap, setSaturate, setScale, setScale, setSepia, setShow, setSize, setSize, setSize, setSkewX, setSkewY, setStyle, setStyle, setTabSize, setTabSize, setTabSize, setTabSize, setTextAlign, setTextAlign, setTextAlignLast, setTextAlignLast, setTextCombineUpright, setTextCombineWeight, setTextDecoration, setTextDecoration, setTextDecorationColor, setTextDecorationColor, setTextDecorationLine, setTextDecorationLine, setTextDecorationStyle, setTextDecorationStyle, setTextIndent, setTextIndent, setTextIndent, setTextIndent, setTextJustify, setTextJustify, setTextOrientation, setTextOverflow, setTextOverflow, setTextSelectDisabled, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextTransform, setTextTransform, setTextUnderlinePosition, setTop, setTop, setTop, setTransform, setTransform, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformStyle, setTransformStyle, setTransition, setTransitionDelay, setTransitionDelay, setTransitionDelay, setTransitionDuration, setTransitionDuration, setTransitionDuration, setTransitionProperty, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTranslateX, setTranslateY, setTranslateZ, setUnicodeBidi, setUnicodeBidi, setVerticalAlign, setVerticalAlign, setVisibility, setVisibility, setVoiceBalance, setVoiceDuration, setVoicePitch, setVoicePitchRange, setVoiceRate, setVoiceStress, setVoiceVolume, setWhiteSpace, setWhiteSpace, setWidows, setWidth, setWidth, setWidth, setWordBreak, setWordBreak, setWordSpacing, setWordSpacing, setWordSpacing, setWordSpacing, setWordWrap, setWordWrap, setWritingMode, setZIndex, setZIndex, show, shown, stopAnimation, transitionForward, transitionForward, transitionReverse, transitionReverse, updateStyle, updateStyle, updateStyleIfChangedMethods inherited from class com.oorian.html.VisualElement
clearOnClick, click, disable, enable, getAccessKey, getAutoCapitalize, getEnterKeyHint, getInputMode, getPopover, getRole, getTabIndex, getTitle, isAutoFocus, isContentEditable, isDisabled, isDraggable, isHidden, isInert, isSpellCheck, onDisabled, onEnabled, setAccessKey, setAriaAtomic, setAriaBusy, setAriaChecked, setAriaCheckedMixed, setAriaControls, setAriaCurrent, setAriaDescribedBy, setAriaDisabled, setAriaErrorMessage, setAriaExpanded, setAriaHasPopup, setAriaHasPopup, setAriaHidden, setAriaInvalid, setAriaLabel, setAriaLabelledBy, setAriaLevel, setAriaLive, setAriaModal, setAriaOwns, setAriaPressed, setAriaRequired, setAriaSelected, setAriaValueRange, setAriaValueText, setAutoCapitalize, setAutoFocus, setConsumeEvent, setContentEditable, setDisabled, setDraggable, setDropAllowed, setEnterKeyHint, setFocus, setHidden, setInert, setInputMode, setOnAnimationCancel, setOnAnimationEnd, setOnAnimationIteration, setOnAnimationStart, setOnAuxClick, setOnBeforeInput, setOnBeforeToggle, setOnBlur, setOnChange, setOnClick, setOnClickChange, setOnCompositionEnd, setOnCompositionStart, setOnCompositionUpdate, setOnContextMenu, setOnCopy, setOnCut, setOnDocumentResize, setOnFocus, setOnFocusIn, setOnFocusOut, setOnFormData, setOnGotPointerCapture, setOnInput, setOnInvalid, setOnKeyDown, setOnKeyPressed, setOnKeyUp, setOnLostPointerCapture, setOnMouseDown, setOnMouseEnter, setOnMouseLeave, setOnMouseMove, setOnMouseOut, setOnMouseOutChangeClass, setOnMouseOutChangeStyle, setOnMouseOutChangeStyle, setOnMouseOver, setOnMouseOverChangeClass, setOnMouseOverChangeStyle, setOnMouseOverChangeStyle, setOnMouseOverShow, setOnMouseUp, setOnPageLoad, setOnPaste, setOnPointerCancel, setOnPointerDown, setOnPointerEnter, setOnPointerLeave, setOnPointerMove, setOnPointerOut, setOnPointerOver, setOnPointerUp, setOnResize, setOnScroll, setOnScrollEnd, setOnSelect, setOnSelectionChange, setOnSelectStart, setOnToggle, setOnTouchCancel, setOnTouchEnd, setOnTouchMove, setOnTouchStart, setOnTransitionCancel, setOnTransitionEnd, setOnTransitionRun, setOnTransitionStart, setOnWheel, setOnWindowResize, setPopover, setRole, setRole, setSpellCheck, setTabIndex, setTitle, setTooltipMethods inherited from class com.oorian.html.Element
addAttribute, addAttribute, addAttribute, addAttribute, addElement, addLineBreak, addLineOfText, addLineOfText, addLineOfText, addParagraph, addParagraph, addSpacer, addText, addText, addText, addText, assignId, containsElement, containsElement, create, dispatchEvent, dispatchEvent, dispatchEvent, dispatchEvent, equals, excludeId, executeJs, executeJs, executeJs, getAccept, getAllElements, getAncestor, getAttribute, getAttributes, getComponent, getDir, getElement, getElementById, getElementCount, getElementCount, getElements, getElements, getElementsByComponentName, getElementsByTagName, getHtml, getId, getInnerHtml, getInnerHtml, getIs, getItemId, getItemProp, getItemRef, getItemType, getLang, getNextSibling, getPage, getParent, getPart, getPrevSibling, getSlot, getTagName, getTextContent, getUrl, hasAttribute, hasElements, insertElement, isChildOf, isClosedTag, isCreated, isDescendantOf, isDescendantOf, isInitialized, isItemScope, isTranslate, onCallback, onCreated, onElementAdded, onElementRemoved, onHashChange, onHidden, onInitialized, onJsReturn, onPageLoaded, onPageUnloaded, onRefresh, onShown, onUpdated, onUserEvent, prewrite, recreate, refresh, refresh, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, removeAllElements, removeAttribute, removeAttribute, removeElement, removeElement, removeFromParent, requestCallback, requestCallback, requestCallback, requestCallback, resetId, scrollTo, scrollToBottom, scrollToTop, self, sendCommand, sendUpdate, setAccept, setComponent, setDir, setDir, setElement, setId, setIs, setItemId, setItemProp, setItemRef, setItemScope, setItemType, setLang, setOnError, setOnLoad, setPage, setParent, setPart, setSlot, setTagName, setText, setText, setText, setText, setTranslate, toString, unregisterListener, update, updateAttributes
-
Constructor Details
-
Tr
public Tr()Creates a new table row element.
-
-
Method Details
-
addCell
Adds an existing table cell to this row.- Parameters:
cell- the TableCell to add
-
addHeaderCell
Creates and adds an empty header cell to this row.- Returns:
- the newly created Th element
-
addHeaderCell
Creates and adds a header cell with the specified style.- Parameters:
style- the CssStyle to apply to the cell- Returns:
- the newly created Th element
-
addHeaderCell
Creates a header cell containing the specified element.- Parameters:
element- the Element to place in the cell- Returns:
- the Th element (either the input if it's a Th, or a new Th containing it)
-
addHeaderCell
Creates a header cell containing the specified element with a fixed width.- Parameters:
element- the Element to place in the cellwidth- the cell width in pixels- Returns:
- the Th element
-
addHeaderCell
Creates a header cell containing the specified element with a CSS class.- Parameters:
element- the Element to place in the cellstyle- the CSS class name to apply- Returns:
- the Th element
-
addHeaderCell
Creates a header cell with the specified text content.- Parameters:
text- the text to display in the cell- Returns:
- the newly created Th element
-
addHeaderCell
Creates a header cell with text and a CSS class.- Parameters:
text- the text to display in the cellstyle- the CSS class name to apply- Returns:
- the newly created Th element
-
addHeaderCell
Creates a header cell with text and a fixed width.- Parameters:
text- the text to display in the cellwidth- the cell width in pixels- Returns:
- the newly created Th element
-
addDataCell
Creates and adds an empty data cell to this row.- Returns:
- the newly created Td element
-
addDataCell
Creates and adds a data cell with the specified style.- Parameters:
style- the CssStyle to apply to the cell- Returns:
- the newly created Td element
-
addDataCell
Creates a data cell containing the specified element.- Parameters:
element- the Element to place in the cell- Returns:
- the Td element (either the input if it's a Td, or a new Td containing it)
-
addDataCell
Creates a data cell containing the specified element with a fixed width.- Parameters:
element- the Element to place in the cellwidth- the cell width in pixels- Returns:
- the Td element
-
addDataCell
Creates a data cell with the specified text content.- Parameters:
text- the text to display in the cell- Returns:
- the newly created Td element
-
addDataCell
Creates a data cell with text and a fixed width.- Parameters:
text- the text to display in the cellwidth- the cell width in pixels- Returns:
- the newly created Td element
-
addDataCell
Creates a data cell containing the specified element with a CssStyle.- Parameters:
element- the Element to place in the cellstyle- the CssStyle to apply to the cell- Returns:
- the Td element
-
addDataCell
Creates a data cell containing the specified element with a CSS class.- Parameters:
element- the Element to place in the cellstyle- the CSS class name to apply- Returns:
- the Td element
-
addDataCell
Creates a data cell with text and a CssStyle.- Parameters:
text- the text to display in the cellstyle- the CssStyle to apply to the cell- Returns:
- the newly created Td element
-
addDataCell
Creates a data cell with text and a CSS class.- Parameters:
text- the text to display in the cellstyle- the CSS class name to apply- Returns:
- the newly created Td element
-
addDataCells
Creates multiple empty data cells.- Parameters:
num- the number of cells to create- Returns:
- a TableCells collection containing the created cells
-
getCells
Returns all cells in this row.- Returns:
- a TableCells collection containing all cells
-
getHeaderCells
Returns all header cells in this row.- Returns:
- a TableCells collection containing only Th elements
-
getDataCells
Returns all data cells in this row.- Returns:
- a TableCells collection containing only Td elements
-
getCell
Returns the cell at the specified column index.- Parameters:
colnum- the zero-based column index- Returns:
- the TableCell at the specified index, or null if not found
-
removeAllCells
public final void removeAllCells()Removes all cells from this row. -
getNumberOfCells
public final int getNumberOfCells()Returns the number of cells in this row.- Returns:
- the cell count
-
registerAddition
public void registerAddition()Description copied from class:ElementRegisters this element for addition to the DOM.- Overrides:
registerAdditionin classElement<T extends Tr<T>>
-
registerSubtraction
public void registerSubtraction()Description copied from class:ElementRegisters this element for removal from the DOM.Notifies the page that this element should be removed from the client-side DOM during the next update cycle.
- Overrides:
registerSubtractionin classElement<T extends Tr<T>>
-
registerUpdate
public void registerUpdate()Description copied from class:ElementRegisters this element for update in the DOM.Notifies the page that this element has been modified and should be synchronized with the client-side DOM during the next update cycle.
- Overrides:
registerUpdatein classElement<T extends Tr<T>>
-