[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

RadioButtonListCellType

Class RadioButtonListCellType

java.lang.Object
com.grapecity.documents.excel.BaseCellType
com.grapecity.documents.excel.RadioButtonListCellType

public class RadioButtonListCellType extends BaseCellType
表示单选按钮列表单元格类型。

使用此单元格类型可在单个单元格中显示并编辑一组互斥选项。可以配置列表的布局方向、间距和文本对齐方式。

示例:


 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);
 
  • Constructor Details

    • RadioButtonListCellType

      public RadioButtonListCellType()
      创建一个单选按钮列表单元格类型。
  • Method Details

    • getItems

      public ArrayList<SelectFieldItem> getItems()
      获取单选按钮列表的项。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.getItems().add(new SelectFieldItem("Option 1", "1"));
       ArrayList<SelectFieldItem> items = cellType.getItems();
       
      Returns:
      单选按钮项的列表。
    • getDirection

      public CellTypeDirection getDirection()
      获取单选按钮列表的方向。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setDirection(CellTypeDirection.Vertical);
       CellTypeDirection direction = cellType.getDirection();
       
      Returns:
      单选按钮列表的排列方向,例如水平或垂直。
    • setDirection

      public void setDirection(CellTypeDirection direction)
      设置单选按钮列表的方向。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setDirection(CellTypeDirection.Vertical);
       CellTypeDirection direction = cellType.getDirection();
       
      Parameters:
      direction - 单选按钮列表应排列的方向。
    • getIsFlowLayout

      public boolean getIsFlowLayout()
      获取单选按钮列表的布局是否自动适应。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setIsFlowLayout(false);
       boolean isFlowLayout = cellType.getIsFlowLayout();
       
      Returns:
      如果单选按钮列表的布局自动适应,则为 true;否则为 false。
    • setIsFlowLayout

      public void setIsFlowLayout(boolean isFlowLayout)
      设置单选按钮列表的布局是否自动适应。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setIsFlowLayout(false);
       boolean isFlowLayout = cellType.getIsFlowLayout();
       
      Parameters:
      isFlowLayout - 如果单选按钮列表的布局应自动适应,则为 true;否则为 false。
    • getTextAlign

      public CellTypeTextAlign getTextAlign()
      获取单选按钮列表文本的位置,仅支持左侧和右侧。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setTextAlign(CellTypeTextAlign.Left);
       CellTypeTextAlign textAlign = cellType.getTextAlign();
       
      Returns:
      单选按钮列表的文本对齐方式,例如左对齐或右对齐。
    • setTextAlign

      public void setTextAlign(CellTypeTextAlign textAlign)
      设置单选按钮列表文本的位置,仅支持左侧和右侧。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setTextAlign(CellTypeTextAlign.Left);
       CellTypeTextAlign textAlign = cellType.getTextAlign();
       
      Parameters:
      textAlign - 单选按钮列表的文本对齐方式。
    • setMaxRowCount

      public void setMaxRowCount(int maxRowCount)
      设置单选按钮列表的最大行数。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setMaxRowCount(3);
       int maxRowCount = cellType.getMaxRowCount();
       
      Parameters:
      maxRowCount - 单选按钮列表的最大行数。
    • getMaxRowCount

      public int getMaxRowCount()
      获取单选按钮列表的最大行数。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setMaxRowCount(3);
       int maxRowCount = cellType.getMaxRowCount();
       
      Returns:
      单选按钮列表的最大行数。
    • setMaxColumnCount

      public void setMaxColumnCount(int maxColumnCount)
      设置单选按钮列表的最大列数。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setMaxColumnCount(2);
       int maxColumnCount = cellType.getMaxColumnCount();
       
      Parameters:
      maxColumnCount - 单选按钮列表的最大列数。
    • getMaxColumnCount

      public int getMaxColumnCount()
      获取单选按钮列表的最大列数。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setMaxColumnCount(2);
       int maxColumnCount = cellType.getMaxColumnCount();
       
      Returns:
      单选按钮列表的最大列数。
    • setHorizontalSpacing

      public void setHorizontalSpacing(int horizontalSpacing)
      设置单选按钮列表中的水平间距。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setHorizontalSpacing(12);
       int horizontalSpacing = cellType.getHorizontalSpacing();
       
      Parameters:
      horizontalSpacing - 单选按钮列表中的水平间距。
    • getHorizontalSpacing

      public int getHorizontalSpacing()
      获取单选按钮列表中的水平间距。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setHorizontalSpacing(12);
       int horizontalSpacing = cellType.getHorizontalSpacing();
       
      Returns:
      单选按钮列表中的水平间距。
    • setVerticalSpacing

      public void setVerticalSpacing(int verticalSpacing)
      设置单选按钮列表中的垂直间距。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setVerticalSpacing(8);
       int verticalSpacing = cellType.getVerticalSpacing();
       
      Parameters:
      verticalSpacing - 单选按钮列表中的垂直间距。
    • getVerticalSpacing

      public int getVerticalSpacing()
      获取单选按钮列表中的垂直间距。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setVerticalSpacing(8);
       int verticalSpacing = cellType.getVerticalSpacing();
       
      Returns:
      单选按钮列表中的垂直间距。
    • getBoxSize

      public int getBoxSize()
      获取一个指示复选框大小的值。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setBoxSize(16);
       int boxSize = cellType.getBoxSize();
       
      Returns:
      一个指示复选框大小的值。
    • setBoxSize

      public void setBoxSize(int value)
      设置一个指示复选框大小的值。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setBoxSize(16);
       int boxSize = cellType.getBoxSize();
       
      Parameters:
      value - 复选框或单选按钮框的大小。
    • getAutoBoxSize

      public boolean getAutoBoxSize()
      获取 boxSize 是否随字体大小变化。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setAutoBoxSize(true);
       boolean autoBoxSize = cellType.getAutoBoxSize();
       
      Returns:
      如果 Auto Box Size 为真,则为 true;否则为 false。
    • setAutoBoxSize

      public void setAutoBoxSize(boolean value)
      设置 boxSize 是否随字体大小变化。
      
       RadioButtonListCellType cellType = new RadioButtonListCellType();
       cellType.setAutoBoxSize(true);
       boolean autoBoxSize = cellType.getAutoBoxSize();
       
      Parameters:
      value - 框大小是否随字体大小变化。