@Test public void checkToWidgetNoValueValue() { when(cell.getValue()).thenReturn(cellValue); BaseColumnConverterUtilities.toWidget(false, cell, listBox); verify(listBox, never()).addItem(anyString()); verify(listBox, never()).addItem(anyString(), anyString()); }
public static void toWidget(final boolean isMultipleSelect, final GridCell<String> cell, final ListBox widget) { if (cell == null || cell.getValue() == null || cell.getValue().getValue() == null) { if (widget.getItemCount() > 0) { widget.setSelectedIndex(0); } } else { final String value = cell.getValue().getValue(); if (isMultipleSelect) { final List<String> values = Arrays.asList(value.split(",")); for (int i = 0; i < widget.getItemCount(); i++) { widget.setItemSelected(i, values.contains(widget.getValue(i))); } } else { for (int i = 0; i < widget.getItemCount(); i++) { if (widget.getValue(i).equals(value)) { widget.setSelectedIndex(i); break; } } } } }
BaseColumnConverterUtilities { public static void toWidget(final boolean isMultipleSelect, final GridCell<String> cell, final ListBox widget) { if (cell == null || cell.getValue() == null || cell.getValue().getValue() == null) { if (widget.getItemCount() > 0) { widget.setSelectedIndex(0); } } else { final String value = cell.getValue().getValue(); if (isMultipleSelect) { final List<String> values = Arrays.asList(value.split(",")); for (int i = 0; i < widget.getItemCount(); i++) { widget.setItemSelected(i, values.contains(widget.getValue(i))); } } else { for (int i = 0; i < widget.getItemCount(); i++) { if (widget.getValue(i).equals(value)) { widget.setSelectedIndex(i); break; } } } } } }
BaseColumnConverterUtilities { public static void toWidget(final boolean isMultipleSelect, final GridCell<String> cell, final ListBox widget) { if (cell == null || cell.getValue() == null || cell.getValue().getValue() == null) { if (widget.getItemCount() > 0) { widget.setSelectedIndex(0); } } else { final String value = cell.getValue().getValue(); if (isMultipleSelect) { final List<String> values = Arrays.asList(value.split(",")); for (int i = 0; i < widget.getItemCount(); i++) { widget.setItemSelected(i, values.contains(widget.getValue(i))); } } else { for (int i = 0; i < widget.getItemCount(); i++) { if (widget.getValue(i).equals(value)) { widget.setSelectedIndex(i); break; } } } } }  }
BaseColumnConverterUtilities { public static void toWidget(final boolean isMultipleSelect, final GridCell<String> cell, final ListBox widget) { if (cell == null || cell.getValue() == null || cell.getValue().getValue() == null) { if (widget.getItemCount() > 0) { widget.setSelectedIndex(0); } } else { final String value = cell.getValue().getValue(); if (isMultipleSelect) { final List<String> values = Arrays.asList(value.split(",")); for (int i = 0; i < widget.getItemCount(); i++) { widget.setItemSelected(i, values.contains(widget.getValue(i))); } } else { for (int i = 0; i < widget.getItemCount(); i++) { if (widget.getValue(i).equals(value)) { widget.setSelectedIndex(i); break; } } } } }  static void toWidget(final boolean isMultipleSelect,
                                final GridCell<String> cell,
                                final ListBox widget); static String fromWidget(final boolean isMultipleSelect,
                                    final ListBox widget); }
BaseColumnConverterUtilities { public static void toWidget(final boolean isMultipleSelect, final GridCell<String> cell, final ListBox widget) { if (cell == null || cell.getValue() == null || cell.getValue().getValue() == null) { if (widget.getItemCount() > 0) { widget.setSelectedIndex(0); } } else { final String value = cell.getValue().getValue(); if (isMultipleSelect) { final List<String> values = Arrays.asList(value.split(",")); for (int i = 0; i < widget.getItemCount(); i++) { widget.setItemSelected(i, values.contains(widget.getValue(i))); } } else { for (int i = 0; i < widget.getItemCount(); i++) { if (widget.getValue(i).equals(value)) { widget.setSelectedIndex(i); break; } } } } }  static void toWidget(final boolean isMultipleSelect,
                                final GridCell<String> cell,
                                final ListBox widget); static String fromWidget(final boolean isMultipleSelect,
                                    final ListBox widget);  }