/** * Populates the content of this component */ private void populate() { choiceBox = new ComboBox<>(repositoryChoices); choiceBox.setPromptText(tr("Please select the repository type you want to add")); choiceBox.setConverter(new StringConverter<RepositoryType>() { @Override public String toString(RepositoryType repositoryType) { return repositoryType.getLabel(); } @Override public RepositoryType fromString(String string) { return Arrays.stream(RepositoryType.values()).filter(type -> type.getLabel().equals(string)).findAny() .orElse(null); } }); choiceBox.setOnAction( event -> onRepositoryTypeSelection.accept(choiceBox.getSelectionModel().getSelectedItem())); Label choiceBoxLabel = new Label(tr("Repository type:")); choiceBoxLabel.setLabelFor(choiceBox); HBox content = new HBox(choiceBoxLabel, choiceBox); content.setId("repositoryTypeSelection"); HBox.setHgrow(choiceBox, Priority.ALWAYS); this.setCenter(content); }
ecombo5.setItems(items); ecombo5.setEditable(true); ecombo5.setPromptText("select"); AquaFx.resizeControl(ecombo5, ControlSizeVariant.REGULAR); hbox.getChildren().add(ecombo5); combo5.setPromptText("select"); AquaFx.resizeControl(combo5, ControlSizeVariant.REGULAR); hbox.getChildren().add(combo5);
columnField.setPromptText("column"); columnField.getSelectionModel().select(0);
comboBoxBox.setPadding(new Insets(10)); ComboBox<String> combo3 = new ComboBox<String>(items); combo3.setPromptText("test"); combo3.setEditable(false); comboBoxBox.getChildren().add(combo3); ComboBox<String> combo4 = new ComboBox<String>(items); combo4.setPromptText("test"); combo4.setEditable(false); combo4.setDisable(true);
ecombo5.setItems(items); ecombo5.setEditable(true); ecombo5.setPromptText("select"); AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(ecombo5); grid.add(ecombo5, 6, 2); ComboBox<String> combo5 = new ComboBox<String>(); combo5.setItems(items); combo5.setPromptText("select"); AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(combo5); grid.add(combo5, 7, 2); ecombo6.setItems(items); ecombo6.setEditable(true); ecombo6.setPromptText("select"); AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.SMALL).style(ecombo6); grid.add(ecombo6, 6, 3); ComboBox<String> combo6 = new ComboBox<String>(); combo6.setItems(items); combo6.setPromptText("select"); AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.SMALL).style(combo6); grid.add(combo6, 7, 3); ecombo7.setItems(items); ecombo7.setEditable(true); ecombo7.setPromptText("select"); AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.MINI).style(ecombo7); grid.add(ecombo7, 6, 4); ComboBox<String> combo7 = new ComboBox<String>(); combo7.setItems(items);