@Test public void testRender_SimpleDropDownData() { final Cell.Context context = mock(Cell.Context.class); final SafeHtmlBuilder safeHtmlBuilder = mock(SafeHtmlBuilder.class); final String[] data = new String[]{"one", "two"}; final DropDownData dd = DropDownData.create(data); when(dmo.getEnums(eq(FACT_TYPE), eq(FACT_FIELD), any(Map.class))).thenReturn(dd); when(listBox.getItemCount()).thenReturn(data.length); when(listBox.getValue(eq(0))).thenReturn("one"); when(listBox.getValue(eq(1))).thenReturn("two"); when(listBox.getItemText(eq(0))).thenReturn("one"); when(listBox.getItemText(eq(1))).thenReturn("two"); cell.render(context, "one", safeHtmlBuilder); final ArgumentCaptor<SafeHtml> captor = ArgumentCaptor.forClass(SafeHtml.class); verify(safeHtmlBuilder, times(1)).append(captor.capture()); assertEquals("one", captor.getValue().asString()); }
@Override public void render(Context context, String value, SafeHtmlBuilder sb) { DropDownData dd = dmo.getEnums(this.factType, this.factField, this.dropDownManager.getCurrentValueMap(context)); if (dd == null) { return; } utilities.setDropDownData(value, dd, isMultipleSelect, dmo.getResourcePath(), listBox); if (value != null) { String label = getLabel(value); sb.append(renderer.render(label)); } }
PopupDropDownEditCell extends
                                   AbstractPopupEditCell<String, String> { @Override public void render(Context context, String value, SafeHtmlBuilder sb) { DropDownData dd = dmo.getEnums(this.factType, this.factField, this.dropDownManager.getCurrentValueMap(context)); if (dd == null) { return; } utilities.setDropDownData(value, dd, isMultipleSelect, dmo.getResourcePath(), listBox); if (value != null) { String label = getLabel(value); sb.append(renderer.render(label)); } } }
PopupDropDownEditCell extends
                                   AbstractPopupEditCell<String, String> { @Override public void render(Context context, String value, SafeHtmlBuilder sb) { DropDownData dd = dmo.getEnums(this.factType, this.factField, this.dropDownManager.getCurrentValueMap(context)); if (dd == null) { return; } utilities.setDropDownData(value, dd, isMultipleSelect, dmo.getResourcePath(), listBox); if (value != null) { String label = getLabel(value); sb.append(renderer.render(label)); } } PopupDropDownEditCell(final String factType,
                                 final String factField,
                                 final AsyncPackageDataModelOracle dmo,
                                 final CellTableDropDownDataValueMapProvider dropDownManager,
                                 final boolean isReadOnly);  PopupDropDownEditCell(final String factType,
                                 final String factField,
                                 final AsyncPackageDataModelOracle dmo,
                                 final CellTableDropDownDataValueMapProvider dropDownManager,
                                 final boolean isMultipleSelect,
                                 final boolean isReadOnly); }
PopupDropDownEditCell extends
                                   AbstractPopupEditCell<String, String> { @Override public void render(Context context, String value, SafeHtmlBuilder sb) { DropDownData dd = dmo.getEnums(this.factType, this.factField, this.dropDownManager.getCurrentValueMap(context)); if (dd == null) { return; } utilities.setDropDownData(value, dd, isMultipleSelect, dmo.getResourcePath(), listBox); if (value != null) { String label = getLabel(value); sb.append(renderer.render(label)); } } PopupDropDownEditCell(final String factType,
                                 final String factField,
                                 final AsyncPackageDataModelOracle dmo,
                                 final CellTableDropDownDataValueMapProvider dropDownManager,
                                 final boolean isReadOnly);  PopupDropDownEditCell(final String factType,
                                 final String factField,
                                 final AsyncPackageDataModelOracle dmo,
                                 final CellTableDropDownDataValueMapProvider dropDownManager,
                                 final boolean isMultipleSelect,
                                 final boolean isReadOnly); @Override void render(Context context,
                       String value,
                       SafeHtmlBuilder sb); }
PopupDropDownEditCell extends
                                   AbstractPopupEditCell<String, String> { @Override public void render(Context context, String value, SafeHtmlBuilder sb) { DropDownData dd = dmo.getEnums(this.factType, this.factField, this.dropDownManager.getCurrentValueMap(context)); if (dd == null) { return; } utilities.setDropDownData(value, dd, isMultipleSelect, dmo.getResourcePath(), listBox); if (value != null) { String label = getLabel(value); sb.append(renderer.render(label)); } } PopupDropDownEditCell(final String factType,
                                 final String factField,
                                 final AsyncPackageDataModelOracle dmo,
                                 final CellTableDropDownDataValueMapProvider dropDownManager,
                                 final boolean isReadOnly);  PopupDropDownEditCell(final String factType,
                                 final String factField,
                                 final AsyncPackageDataModelOracle dmo,
                                 final CellTableDropDownDataValueMapProvider dropDownManager,
                                 final boolean isMultipleSelect,
                                 final boolean isReadOnly); @Override void render(Context context,
                       String value,
                       SafeHtmlBuilder sb);  }