void (int delta, GrTypeComboBox combo) { if (delta == 0) return; final int size = combo.getModel().getSize(); int next = combo.getSelectedIndex() + delta; if (next < 0 || next >= size) { if (!UISettings.getInstance().getCycleScrolling()) { return; } next = (next + size) % size; } combo.setSelectedIndex(next); }