public ConfigurationsDialogBuilder addConfigurations(List<Configuration> configurations) { dialog.setTitle("Choose a configuration to graph"); dialog.configurations = configurations; dialog.borderPanel.setCenter(dialog.scrollPane); ObservableList<Node> children = dialog.configurationsBox.getChildren(); ToggleGroup toggleGroup = new ToggleGroup(); for (Configuration configuration : configurations) { String name = configuration.getName(); RadioButton configurationRadioButton = new RadioButton(name); configurationRadioButton.setToggleGroup(toggleGroup); if (name.equals("compile")) { configurationRadioButton.setSelected(true); // todo select default from prefs } children.add(configurationRadioButton); } return this; }
public ConfigurationsDialogBuilder setTitle(String title) { dialog.setTitle(title); return this; }