@Test public final void testAddingItems() { final JSortedComboBox<String> cbox = new JSortedComboBox<>(); for (String item : testItems) { cbox.addItem(item); } verifySortedOrder(cbox); }
@Override public void addItem(E item) { final int insertionPoint = binarySearch(item); if (insertionPoint >= getItemCount()) { super.addItem(item); } else { super.insertItemAt(item, insertionPoint); } }
JSortedComboBox extends JComboBox<E> { @Override public void addItem(E item) { final int insertionPoint = binarySearch(item); if (insertionPoint >= getItemCount()) { super.addItem(item); } else { super.insertItemAt(item, insertionPoint); } } }
JSortedComboBox extends JComboBox<E> { @Override public void addItem(E item) { final int insertionPoint = binarySearch(item); if (insertionPoint >= getItemCount()) { super.addItem(item); } else { super.insertItemAt(item, insertionPoint); } } JSortedComboBox();  JSortedComboBox(ComboBoxModel<E> aModel);  JSortedComboBox(E[] items); @SuppressWarnings("unchecked")  JSortedComboBox(Vector<E> items); }
JSortedComboBox extends JComboBox<E> { @Override public void addItem(E item) { final int insertionPoint = binarySearch(item); if (insertionPoint >= getItemCount()) { super.addItem(item); } else { super.insertItemAt(item, insertionPoint); } } JSortedComboBox();  JSortedComboBox(ComboBoxModel<E> aModel);  JSortedComboBox(E[] items); @SuppressWarnings("unchecked")  JSortedComboBox(Vector<E> items); @Override void addItem(E item); @Override void insertItemAt(E item, int index); }
JSortedComboBox extends JComboBox<E> { @Override public void addItem(E item) { final int insertionPoint = binarySearch(item); if (insertionPoint >= getItemCount()) { super.addItem(item); } else { super.insertItemAt(item, insertionPoint); } } JSortedComboBox();  JSortedComboBox(ComboBoxModel<E> aModel);  JSortedComboBox(E[] items); @SuppressWarnings("unchecked")  JSortedComboBox(Vector<E> items); @Override void addItem(E item); @Override void insertItemAt(E item, int index);  }