[]
使用此单元格类型可在单个单元格中显示并编辑一组互斥选项。可以配置列表的布局方向、间距和文本对齐方式。
示例:
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.getItems().add(new SelectFieldItem("Option 1", "1"));
cellType.getItems().add(new SelectFieldItem("Option 2", "2"));
cellType.setDirection(CellTypeDirection.Vertical);
worksheet.getRange("A1").setCellType(cellType);
booleanintintbooleangetItems()intintintvoidsetAutoBoxSize(boolean value) voidsetBoxSize(int value) voidsetDirection(CellTypeDirection direction) voidsetHorizontalSpacing(int horizontalSpacing) voidsetIsFlowLayout(boolean isFlowLayout) voidsetMaxColumnCount(int maxColumnCount) voidsetMaxRowCount(int maxRowCount) voidsetTextAlign(CellTypeTextAlign textAlign) voidsetVerticalSpacing(int verticalSpacing)
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.getItems().add(new SelectFieldItem("Option 1", "1"));
ArrayList<SelectFieldItem> items = cellType.getItems();
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setDirection(CellTypeDirection.Vertical);
CellTypeDirection direction = cellType.getDirection();
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setDirection(CellTypeDirection.Vertical);
CellTypeDirection direction = cellType.getDirection();
direction - 单选按钮列表应排列的方向。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setIsFlowLayout(false);
boolean isFlowLayout = cellType.getIsFlowLayout();
true;否则为 false。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setIsFlowLayout(false);
boolean isFlowLayout = cellType.getIsFlowLayout();
isFlowLayout - 如果单选按钮列表的布局应自动适应,则为 true;否则为 false。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setTextAlign(CellTypeTextAlign.Left);
CellTypeTextAlign textAlign = cellType.getTextAlign();
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setTextAlign(CellTypeTextAlign.Left);
CellTypeTextAlign textAlign = cellType.getTextAlign();
textAlign - 单选按钮列表的文本对齐方式。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setMaxRowCount(3);
int maxRowCount = cellType.getMaxRowCount();
maxRowCount - 单选按钮列表的最大行数。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setMaxRowCount(3);
int maxRowCount = cellType.getMaxRowCount();
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setMaxColumnCount(2);
int maxColumnCount = cellType.getMaxColumnCount();
maxColumnCount - 单选按钮列表的最大列数。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setMaxColumnCount(2);
int maxColumnCount = cellType.getMaxColumnCount();
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setHorizontalSpacing(12);
int horizontalSpacing = cellType.getHorizontalSpacing();
horizontalSpacing - 单选按钮列表中的水平间距。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setHorizontalSpacing(12);
int horizontalSpacing = cellType.getHorizontalSpacing();
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setVerticalSpacing(8);
int verticalSpacing = cellType.getVerticalSpacing();
verticalSpacing - 单选按钮列表中的垂直间距。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setVerticalSpacing(8);
int verticalSpacing = cellType.getVerticalSpacing();
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setBoxSize(16);
int boxSize = cellType.getBoxSize();
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setBoxSize(16);
int boxSize = cellType.getBoxSize();
value - 复选框或单选按钮框的大小。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setAutoBoxSize(true);
boolean autoBoxSize = cellType.getAutoBoxSize();
true;否则为 false。
RadioButtonListCellType cellType = new RadioButtonListCellType();
cellType.setAutoBoxSize(true);
boolean autoBoxSize = cellType.getAutoBoxSize();
value - 框大小是否随字体大小变化。