Skip to content

Create BaseTextTableRender with reusable text table code - #18

Merged
rickwporter merged 3 commits into
mainfrom
rickwporter/base-text-table
Nov 2, 2026
Merged

rickwporter merged 3 commits into
mainfrom
rickwporter/base-text-table

Conversation

@rickwporter

Copy link
Copy Markdown
Owner

RATIONALE

Refactor the TextTableRender into a base class (BaseTextTableRender) and leave text-table specific things in place. This makes room for another render class to re-use these elements. The TableGlyphs provide for the box parameters (for the lines) the characters provide left, fill, junction, and right values that define the lines of a table.

CHANGES

Refactor TextTableRender to pull out reusable pieces to BaseTextTableRender. Here are some of the "highlights":

  • pad() - appropriately horizontally pad cell text
  • `alignments() - fills in the list to make sure array is at least as big as the table
  • textRow() - creates line of text for a single row object
  • rule() - creates table separator line using the provided glyphs.
  • caption() - formats caption text (if any)
  • sharesLeadingCells() - when removing redundant, this sets matched currentRow cells to empty strings.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor
File Coverage [100%] 🍏
BaseTextTableRender.java 100% 🍏
TextTableRender.java 100% 🍏
TableGlyphs.java 100% 🍏
Total Project Coverage 99.9% 🍏

@rickwporter
rickwporter merged commit 286d203 into main Nov 2, 2026
1 check passed
@rickwporter
rickwporter deleted the rickwporter/base-text-table branch November 2, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant