Record Class TableStyle

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.TableStyle
Record Components:
text - 表格文字樣式覆寫
headerFill - 表頭底色
groupFill - 群組標題列底色
totalFill - 小計與總計列底色
rule - 列分隔線
cellPadding - 儲存格內距
continuationLabel - 群組跨頁時續接列的文字格式,{group} 代入群組名稱
cellBorders - 各儲存格四邊框線預設;null 不新增框線
pageBottomRule - 每個含表身的實體頁片段末端線;null 繼承/預設不覆寫,零寬停用
pageBottomRuleOnContinuationOnly - 頁底線只在表格內部換頁時覆寫;null 繼承,預設 false

public record TableStyle(TextStyle text, ReportColor headerFill, ReportColor groupFill, ReportColor totalFill, LineStyle rule, Length cellPadding, String continuationLabel, CellBorders cellBorders, LineStyle pageBottomRule, Boolean pageBottomRuleOnContinuationOnly) extends Record
表格樣式覆寫值;每個欄位為 null 時繼承上一層
Since:
4.0.0
  • Constructor Details

  • Method Details

    • inherit

      public static TableStyle inherit()
      全部欄位繼承的空覆寫
      Returns:
      空覆寫
    • withText

      public TableStyle withText(TextStyle text)
    • withHeaderFill

      public TableStyle withHeaderFill(ReportColor headerFill)
    • withGroupFill

      public TableStyle withGroupFill(ReportColor groupFill)
    • withTotalFill

      public TableStyle withTotalFill(ReportColor totalFill)
    • withRule

      public TableStyle withRule(LineStyle rule)
    • withCellPadding

      public TableStyle withCellPadding(Length cellPadding)
    • withContinuationLabel

      public TableStyle withContinuationLabel(String continuationLabel)
    • withCellBorders

      public TableStyle withCellBorders(CellBorders borders)
    • withPageBottomRule

      public TableStyle withPageBottomRule(LineStyle line)
      在每頁最後一個表身片段的底緣畫全寬線,包括最後頁、可拆列續頁及紀錄模式。 取代同一底緣的列線與儲存格水平邊,不增加高度或改變分頁;空表格只畫原表頭。 可透過 withPageBottomRuleOnContinuationOnly(Boolean) 限制為表格續頁切點。
      Parameters:
      line - null 表示繼承;零寬停用覆寫,保留原底線
      Returns:
      新樣式
    • withPageBottomRuleOnContinuationOnly

      public TableStyle withPageBottomRuleOnContinuationOnly(Boolean only)
      只在表格仍有後續內容而換頁時套用 pageBottomRule;自然結束保留原有列線與儲存格邊。 不影響分頁;不涵蓋表格結束後由其他區塊引發的換頁。空表格不新增底線。
      Parameters:
      only - null 繼承;true 只作用於續頁切點,false(預設)作用於每個片段
      Returns:
      新樣式
    • overlay

      public TableStyle overlay(TableStyle override)
      以 override 的非 null 欄位覆寫本樣式;文字樣式逐欄位合併
      Parameters:
      override - 覆寫值;null 視同空覆寫
      Returns:
      合併後的新樣式
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • text

      public TextStyle text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • headerFill

      public ReportColor headerFill()
      Returns the value of the headerFill record component.
      Returns:
      the value of the headerFill record component
    • groupFill

      public ReportColor groupFill()
      Returns the value of the groupFill record component.
      Returns:
      the value of the groupFill record component
    • totalFill

      public ReportColor totalFill()
      Returns the value of the totalFill record component.
      Returns:
      the value of the totalFill record component
    • rule

      public LineStyle rule()
      Returns the value of the rule record component.
      Returns:
      the value of the rule record component
    • cellPadding

      public Length cellPadding()
      Returns the value of the cellPadding record component.
      Returns:
      the value of the cellPadding record component
    • continuationLabel

      public String continuationLabel()
      Returns the value of the continuationLabel record component.
      Returns:
      the value of the continuationLabel record component
    • cellBorders

      public CellBorders cellBorders()
      Returns the value of the cellBorders record component.
      Returns:
      the value of the cellBorders record component
    • pageBottomRule

      public LineStyle pageBottomRule()
      Returns the value of the pageBottomRule record component.
      Returns:
      the value of the pageBottomRule record component
    • pageBottomRuleOnContinuationOnly

      public Boolean pageBottomRuleOnContinuationOnly()
      Returns the value of the pageBottomRuleOnContinuationOnly record component.
      Returns:
      the value of the pageBottomRuleOnContinuationOnly record component