@Test public void setContentEmpty() { popup.setContent(mock(Command.class), externalFactTypes); verify(importTypeListBox).clear(); verify(importTypeListBox).addItem(importTypesCaptor.capture()); final List<String> importTypes = importTypesCaptor.getAllValues(); assertEquals(1, importTypes.size()); assertEquals(ImportConstants.INSTANCE.noTypesAvailable(), importTypes.get(0)); verify(importTypeListBox).addItem(ImportConstants.INSTANCE.noTypesAvailable()); verify(importTypeListBox).setSelectedIndex(0); verify(importTypeListBox).setEnabled(false); }
public void setContent(final Command callbackCommand, final List<Import> allAvailableImportTypes) { this.callbackCommand = callbackCommand; this.importTypeListBox.clear(); if (allAvailableImportTypes.size() > 0) { allAvailableImportTypes.sort(Sorters.sortByFQCN()); importTypeListBox.addItem(ImportConstants.INSTANCE.ChooseAFactType()); for (Import importType : allAvailableImportTypes) { importTypeListBox.addItem(importType.getType()); } importTypeListBox.setEnabled(true); } else { importTypeListBox.addItem(ImportConstants.INSTANCE.noTypesAvailable()); importTypeListBox.setEnabled(false); } footer.enableOkButton(false); importTypeListBox.setSelectedIndex(0); }
AddImportPopup extends BaseModal { public void setContent(final Command callbackCommand, final List<Import> allAvailableImportTypes) { this.callbackCommand = callbackCommand; this.importTypeListBox.clear(); if (allAvailableImportTypes.size() > 0) { allAvailableImportTypes.sort(Sorters.sortByFQCN()); importTypeListBox.addItem(ImportConstants.INSTANCE.ChooseAFactType()); for (Import importType : allAvailableImportTypes) { importTypeListBox.addItem(importType.getType()); } importTypeListBox.setEnabled(true); } else { importTypeListBox.addItem(ImportConstants.INSTANCE.noTypesAvailable()); importTypeListBox.setEnabled(false); } footer.enableOkButton(false); importTypeListBox.setSelectedIndex(0); } }
AddImportPopup extends BaseModal { public void setContent(final Command callbackCommand, final List<Import> allAvailableImportTypes) { this.callbackCommand = callbackCommand; this.importTypeListBox.clear(); if (allAvailableImportTypes.size() > 0) { allAvailableImportTypes.sort(Sorters.sortByFQCN()); importTypeListBox.addItem(ImportConstants.INSTANCE.ChooseAFactType()); for (Import importType : allAvailableImportTypes) { importTypeListBox.addItem(importType.getType()); } importTypeListBox.setEnabled(true); } else { importTypeListBox.addItem(ImportConstants.INSTANCE.noTypesAvailable()); importTypeListBox.setEnabled(false); } footer.enableOkButton(false); importTypeListBox.setSelectedIndex(0); } AddImportPopup(); }
AddImportPopup extends BaseModal { public void setContent(final Command callbackCommand, final List<Import> allAvailableImportTypes) { this.callbackCommand = callbackCommand; this.importTypeListBox.clear(); if (allAvailableImportTypes.size() > 0) { allAvailableImportTypes.sort(Sorters.sortByFQCN()); importTypeListBox.addItem(ImportConstants.INSTANCE.ChooseAFactType()); for (Import importType : allAvailableImportTypes) { importTypeListBox.addItem(importType.getType()); } importTypeListBox.setEnabled(true); } else { importTypeListBox.addItem(ImportConstants.INSTANCE.noTypesAvailable()); importTypeListBox.setEnabled(false); } footer.enableOkButton(false); importTypeListBox.setSelectedIndex(0); } AddImportPopup(); String getImportType(); void setContent(final Command callbackCommand,
                           final List<Import> allAvailableImportTypes); }
AddImportPopup extends BaseModal { public void setContent(final Command callbackCommand, final List<Import> allAvailableImportTypes) { this.callbackCommand = callbackCommand; this.importTypeListBox.clear(); if (allAvailableImportTypes.size() > 0) { allAvailableImportTypes.sort(Sorters.sortByFQCN()); importTypeListBox.addItem(ImportConstants.INSTANCE.ChooseAFactType()); for (Import importType : allAvailableImportTypes) { importTypeListBox.addItem(importType.getType()); } importTypeListBox.setEnabled(true); } else { importTypeListBox.addItem(ImportConstants.INSTANCE.noTypesAvailable()); importTypeListBox.setEnabled(false); } footer.enableOkButton(false); importTypeListBox.setSelectedIndex(0); } AddImportPopup(); String getImportType(); void setContent(final Command callbackCommand,
                           final List<Import> allAvailableImportTypes);  }