Class FormControl.Builder

java.lang.Object
io.keikai.axyra.sheets.content.FormControl.Builder
Enclosing class:
FormControl

public static final class FormControl.Builder extends Object
A fluent builder for a FormControl. Values are checked only when the control is added or updated on a sheet.
  • Method Details

    • anchor

      public FormControl.Builder anchor(int fromRow, int fromColumn, int toRow, int toColumn)
      Sets the two-cell anchor (0-based). The control's top-left corner is at the top-left of cell (fromRow, fromColumn). Its bottom-right corner is at the top-left of cell (toRow, toColumn), so that cell is not covered unless anchorOffsets(long, long, long, long) moves the corner into it. Example: anchor(1, 1, 3, 3) covers B2:C3. A negative index makes the add call throw AxyraException.
    • anchorOffsets

      public FormControl.Builder anchorOffsets(long fromRowOffset, long fromColumnOffset, long toRowOffset, long toColumnOffset)
      Sets the offsets of the anchor's corners inside their cells, in EMU (914400 EMU = 1 inch). Note the order: row offset before column offset for each corner, unlike Chart.Builder.anchorOffsets(int, int, int, int).
    • linkedCell

      public FormControl.Builder linkedCell(String a1Ref)
      Sets the cell that mirrors the control's state, in A1 form ("A1", "Sheet2!B3"); null or an empty string sets none.
    • listFillRange

      public FormControl.Builder listFillRange(String a1Range)
      Sets the range that supplies a combo box's or list box's items, in A1 form; null or an empty string sets none.
    • checked

      public FormControl.Builder checked(boolean checked)
      Sets the state of a check box or option button.
    • selectedIndex

      public FormControl.Builder selectedIndex(int index)
      Sets the 1-based selected item of a combo box or list box; 0 means no selection. Accepts 0–255; a larger or negative value makes Sheet.addFormControl throw AxyraException.
    • dropLines

      public FormControl.Builder dropLines(int lines)
      Sets how many rows a combo box's drop-down shows; Excel uses 8 when not set. A negative value makes the add call throw AxyraException.
    • value

      public FormControl.Builder value(int value)
      Sets the current value of a scroll bar or spin button.
    • range

      public FormControl.Builder range(int min, int max)
      Sets the minimum and maximum value of a scroll bar or spin button.
    • increment

      public FormControl.Builder increment(int increment)
      Sets the step of one arrow click on a scroll bar or spin button.
    • page

      public FormControl.Builder page(int page)
      Sets the step of one click on a scroll bar's track.
    • text

      public FormControl.Builder text(String text)
      Sets the caption of a button, check box, option button, label or group box; null or an empty string shows the control name.
    • threeD

      public FormControl.Builder threeD(boolean threeD)
      Sets the 3-D shading flag of Excel's Format Control dialog.
    • build

      public FormControl build()
      The immutable control. The type and values are checked only when the control is added or updated on a sheet.