Package io.keikai.axyra.sheets.content
Class FormControl
java.lang.Object
io.keikai.axyra.sheets.content.FormControl
A worksheet form control (immutable): check box, option button, button,
combo box, list box, scroll bar, spin button, edit box, label or group box —
the classic Form Controls group on Excel's Developer tab. Add with
Sheet.addFormControl(...); read back with
Sheet.formControls(); replace with
Sheet.updateFormControl(index, control). Crosses the boundary as
flat JSON.
The anchor is a two-cell rectangle in 0-based row/column coordinates,
optionally refined by EMU offsets inside the corner cells. Per-type state:
checked (check box / option button), listFillRange +
selectedIndex + dropLines (combo / list box),
value/min/max/increment/page (scroll bar / spin button),
text (caption shown by captioned controls), linkedCell
(cell reflecting the control's state) and threeD (the 3-D shading
flag of the Format Control dialog).
Reference: ECMA-376 Part 1 §18.3.1.13 (controls) plus the
<formControlPr> control-properties part.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic FormControl.BuilderA push button; the caption comes from.text(...)or the name.static FormControl.BuilderA check box; set state with.checked(true).booleanchecked()Check box / option button state.static FormControl.BuilderA drop-down combo box; feed it with.listFillRange("F1:F5").intVisible drop-down rows of a combo box (Excel's default is 8).static FormControl.BuilderAn edit box (legacy dialog-sheet control).intstatic FormControlintfromRow()static FormControl.BuilderA group box frame (visually groups option buttons).intIncremental change of a scroll bar / spin button.static FormControl.BuilderA static text label.Linked cell in A1 form (e.g.static FormControl.BuilderA list box; feed it with.listFillRange("F1:F5").Items source range in A1 form for combo / list boxes, or null.intmax()intmin()name()The shape name, e.g.static FormControl.Builderof(FormControlType type, String name) A control of anyFormControlType.static FormControl.BuilderoptionButton(String name) An option (radio) button; set state with.checked(true).intpage()Page change of a scroll bar.static FormControl.BuilderA scroll bar; configure.range(min, max)/.value(v).int1-based selected item index of a combo / list box; 0 = no selection.static FormControl.BuilderspinButton(String name) A spin button; configure.range(min, max)/.value(v).text()Caption text painted by captioned controls, or null (name is used).booleanthreeD()The 3-D shading flag of the Format Control dialog.A builder pre-loaded with this control, for read–modify–write round-trips.inttoColumn()toJson()inttoRow()type()intvalue()Current value of a scroll bar / spin button.
-
Method Details
-
checkBox
A check box; set state with.checked(true). -
optionButton
An option (radio) button; set state with.checked(true). -
button
A push button; the caption comes from.text(...)or the name. -
comboBox
A drop-down combo box; feed it with.listFillRange("F1:F5"). -
listBox
A list box; feed it with.listFillRange("F1:F5"). -
scrollBar
A scroll bar; configure.range(min, max)/.value(v). -
spinButton
A spin button; configure.range(min, max)/.value(v). -
editBox
An edit box (legacy dialog-sheet control). -
label
A static text label. -
groupBox
A group box frame (visually groups option buttons). -
of
A control of anyFormControlType. -
toBuilder
A builder pre-loaded with this control, for read–modify–write round-trips. -
toJson
-
fromJson
-
type
-
name
The shape name, e.g."Check Box 1". -
fromRow
public int fromRow() -
fromColumn
public int fromColumn() -
toRow
public int toRow() -
toColumn
public int toColumn() -
linkedCell
Linked cell in A1 form (e.g."A1","Sheet2!B3"), or null. -
listFillRange
Items source range in A1 form for combo / list boxes, or null. -
checked
public boolean checked()Check box / option button state. -
selectedIndex
public int selectedIndex()1-based selected item index of a combo / list box; 0 = no selection. -
dropLines
public int dropLines()Visible drop-down rows of a combo box (Excel's default is 8). -
value
public int value()Current value of a scroll bar / spin button. -
min
public int min() -
max
public int max() -
increment
public int increment()Incremental change of a scroll bar / spin button. -
page
public int page()Page change of a scroll bar. -
text
Caption text painted by captioned controls, or null (name is used). -
threeD
public boolean threeD()The 3-D shading flag of the Format Control dialog.
-