@Override protected Object executeWhenComboBoxOpen() { return itemTextExtractor .getTextFromRenderedComponent(comboboxOperator .getSelectedIndex()); } }.execute();
/**@return The selected item or selected index, depending on the itemIdentifier.*/ public Object actionProduced(Object obj) { if (itemIdentifier.isIndex()) return new Integer(comboboxOperator.getComboboxOperator() .getSelectedIndex()); return comboboxOperator.getSelectedItem(); }
if (combo.getSelectedIndex() != val) { combo.selectItem(val);
private Component getRenderedComponent(final int itemIndex) { final JList popupList = comboboxOperator.waitList(); final Object element = comboboxModel().getElementAt(itemIndex); final boolean isSelected = comboboxOperator.getSelectedIndex() == itemIndex; final boolean hasFocus = comboboxOperator.hasFocus(); final ListCellRenderer cellRenderer = comboboxOperator.getRenderer(); return new SmoothInvoker<Component>() { public Object work() { return cellRenderer.getListCellRendererComponent(popupList, element, itemIndex, isSelected, hasFocus); } }.invoke(); }
keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); keyStrength = panel.getKeyStrength();