public StructureFileSelectionUi(StructureFileSelectionModel model) {
EnumSet<FileInputMode> inputModes = model.getAllInputModes();
if (inputModes.contains(FileInputMode.LOCAL)) {
// This is XML
existingStructureChoice = new KongaRadioButton("Select an &existing XML structure");
existingFileSelector = ExistingFileSelectionUi.forXml(model);
uploadLocalFileChoice = new KongaRadioButton("&Upload an XML structure file (DTD or Schema)");
localFileSelector = createFileSelector();
fromSampleFileChoice = new KongaRadioButton("Create a &new XML structure from a sample file (next page)");
} else {
// This is JSON
existingStructureChoice = new KongaRadioButton("Select an &existing JSON structure");
existingFileSelector = ExistingFileSelectionUi.forJson(model);
uploadLocalFileChoice = null;
localFileSelector = null;
fromSampleFileChoice = new KongaRadioButton("Create a &new JSON structure from a sample file (next page)");
}
listenToUi();
bindProperties(model);
}