[]
        
(Showing Draft Content)

ComboBoxCellItem

Class ComboBoxCellItem

java.lang.Object
com.grapecity.documents.excel.ComboBoxCellItem

public class ComboBoxCellItem extends Object
Represents a combo box item.

Each item has a value and a text. The text is displayed in the combo box dropdown, while the value is stored in the underlying data model. Items are added to a ComboBoxCellType via ComboBoxCellType.getItems().


 ComboBoxCellItem item = new ComboBoxCellItem();
 item.setValue("US");
 item.setText("United States");

 ComboBoxCellType cellType = new ComboBoxCellType();
 cellType.getItems().add(item);
 worksheet.getRange("A1").setCellType(cellType);
 
  • Constructor Details

    • ComboBoxCellItem

      public ComboBoxCellItem()
  • Method Details

    • getValue

      public Object getValue()
      Gets the value of the item.
      
       ComboBoxCellItem item = new ComboBoxCellItem();
       item.setValue("US");
       Object value = item.getValue();
       
      Returns:
      The value of the item.
    • setValue

      public void setValue(Object value)
      Sets the value of the item.
      
       ComboBoxCellItem item = new ComboBoxCellItem();
       item.setValue("US");
       
      Parameters:
      value - The value of the item.
    • getText

      public String getText()
      Gets the text of the item.
      
       ComboBoxCellItem item = new ComboBoxCellItem();
       item.setText("United States");
       String text = item.getText();
       
      Returns:
      The text of the item.
    • setText

      public void setText(String text)
      Sets the text of the item.
      
       ComboBoxCellItem item = new ComboBoxCellItem();
       item.setText("United States");
       
      Parameters:
      text - The text of the item.