@Test public void testSetSelectedIndex() { SourceProductSelector selector = new SourceProductSelector(appContext, "Source"); selector.initProducts(); assertSame(defaultProducts[0], selector.getSelectedProduct()); selector.setSelectedIndex(1); assertSame(defaultProducts[1], selector.getSelectedProduct()); selector.setSelectedIndex(2); assertSame(defaultProducts[2], selector.getSelectedProduct()); }
public void setSelectedIndex(int index) { productListModel.setSelectedItem(productListModel.getElementAt(index)); }
SourceProductSelector { public void setSelectedIndex(int index) { productListModel.setSelectedItem(productListModel.getElementAt(index)); } }
SourceProductSelector { public void setSelectedIndex(int index) { productListModel.setSelectedItem(productListModel.getElementAt(index)); } SourceProductSelector(AppContext appContext);  SourceProductSelector(AppContext appContext, boolean enableEmptySelection);  SourceProductSelector(AppContext appContext, String labelText);  SourceProductSelector(AppContext appContext, String labelText, boolean enableEmptySelection); }
SourceProductSelector { public void setSelectedIndex(int index) { productListModel.setSelectedItem(productListModel.getElementAt(index)); } SourceProductSelector(AppContext appContext);  SourceProductSelector(AppContext appContext, boolean enableEmptySelection);  SourceProductSelector(AppContext appContext, String labelText);  SourceProductSelector(AppContext appContext, String labelText, boolean enableEmptySelection); ProductFilter getProductFilter(); void setProductFilter(ProductFilter productFilter); synchronized void initProducts(); int getProductCount(); void setSelectedIndex(int index); Product getSelectedProduct(); void setCurrentDirectory(File directory); File getCurrentDirectory(); void setSelectedProduct(Product product); synchronized void releaseProducts(); void addSelectionChangeListener(SelectionChangeListener listener); void removeSelectionChangeListener(SelectionChangeListener listener); JComboBox<Object> getProductNameComboBox(); JLabel getProductNameLabel(); JButton getProductFileChooserButton(); JPanel createDefaultPanel(); JPanel createDefaultPanel(String borderTitle); }
SourceProductSelector { public void setSelectedIndex(int index) { productListModel.setSelectedItem(productListModel.getElementAt(index)); } SourceProductSelector(AppContext appContext);  SourceProductSelector(AppContext appContext, boolean enableEmptySelection);  SourceProductSelector(AppContext appContext, String labelText);  SourceProductSelector(AppContext appContext, String labelText, boolean enableEmptySelection); ProductFilter getProductFilter(); void setProductFilter(ProductFilter productFilter); synchronized void initProducts(); int getProductCount(); void setSelectedIndex(int index); Product getSelectedProduct(); void setCurrentDirectory(File directory); File getCurrentDirectory(); void setSelectedProduct(Product product); synchronized void releaseProducts(); void addSelectionChangeListener(SelectionChangeListener listener); void removeSelectionChangeListener(SelectionChangeListener listener); JComboBox<Object> getProductNameComboBox(); JLabel getProductNameLabel(); JButton getProductFileChooserButton(); JPanel createDefaultPanel(); JPanel createDefaultPanel(String borderTitle);  }