ListUI baseListUI = list.getUI();
ComboBoxUI baseComboUI = combo.getUI();
if ((baseListUI instanceof SubstanceListUI)
&& (baseComboUI instanceof SubstanceComboBoxUI)) {
SubstanceListUI listUI = (SubstanceListUI) baseListUI;
SubstanceComboBoxUI comboUI = (SubstanceComboBoxUI) baseComboUI;
ComponentState state = listUI.getCellState(index, result);
ComponentState prevState = listUI.getPrevCellState(index, result);
// special case for the combobox. The selected value is
// painted using the renderer of the list, and the index
// is -1.
if (index == -1) {
ButtonModel transitionModel = comboUI.getTransitionModel();
state = ComponentState.getState(transitionModel, this.combo);
prevState = SubstanceCoreUtilities.getPrevComponentState(combo);
// boolean isEnabled = this.combo.isEnabled();
// if (isSelected && isEnabled) {
// state = ComponentState.SELECTED;