private HBox createYearMonthChooser() { final HBox hBox = new HBox(3); hBox.setAlignment(Pos.CENTER_LEFT); final ComboBox<Integer> months = new ComboBox<Integer>(); months.setConverter(new IntegerStringConverter()); months.valueProperty().bindBidirectional(model.month); months.setEditable(true); for (int i = 0; i < 12; i++) { months.getItems().add(i + 1); } final ComboBox<Integer> years = new ComboBox<Integer>(); for (int i = 1970; i < 2100; i++) { years.getItems().add(i); } years.valueProperty().bindBidirectional(model.year); years.setEditable(true); years.setConverter(new IntegerStringConverter()); hBox.getChildren().add(new Label("Date")); hBox.getChildren().add(months); hBox.getChildren().add(years); VBox.setMargin(hBox, new Insets(3)); return hBox; }
@Override public Node createValueVisualisation() { comboBox = new ComboBox<>(); comboBox.getItems().add(0, null); comboBox.getItems().addAll(possibleValuesProvider.get()); comboBox.valueProperty().bindBidirectional(observableAttributeValue); comboBox.setEditable(false); comboBox.disableProperty().bind(readOnly); comboBox.setConverter(new StringConverter<>() { @Override public String toString(T object) { return object == null ? "" : object.internal().getDisplayText(); } @Override public T fromString(String string) { throw new UnsupportedOperationException(); } }); comboBox.setMinWidth(300); return comboBox; } }
zoomModel.add( "50%" ); //NOI18N comboZoom.setItems( FXCollections.observableList( zoomModel ) ); comboZoom.setEditable( true ); comboZoom.setValue( "100%" ); //NOI18N comboZoom.valueProperty().addListener( new ChangeListener<String>() {
hour.setConverter(new IntegerStringConverter()); hour.valueProperty().bindBidirectional(model.hour); hour.setEditable(true); hour.setPrefWidth(20); for (int i = 0; i < 24; i++) { minute.setEditable(true); minute.setConverter(new IntegerStringConverter()); minute.setPrefWidth(20); secound.setEditable(true); secound.setConverter(new IntegerStringConverter()); secound.setPrefWidth(20);
ecombo5.setEditable(true); ecombo5.setPromptText("select"); AquaFx.resizeControl(ecombo5, ControlSizeVariant.REGULAR);
combo.setEditable(true); combo.getProperties().put(VK_TYPE, VK_TYPE_NUMERIC); pane.getChildren().add(combo);
@Override @SuppressWarnings("unchecked") public Node createValueVisualisation() { ComboBox<E> comboBox = new ComboBox<>(); comboBox.setEditable(false); comboBox.getItems().addAll(possibleEnumConstants); comboBox.valueProperty().bindBidirectional(observableAttributeValue); comboBox.setConverter(stringConverter); Button deleteButton = new Button(); uniformDesign.addDangerIcon(deleteButton, FontAwesome.Glyph.TIMES); deleteButton.setOnAction(event -> observableAttributeValue.set(null)); deleteButton.disableProperty().bind(observableAttributeValue.isNull());//.or(Bindings.createBooleanBinding(()-> isReadOnlyVisualisation))); HBox hbox = new HBox(3); hbox.getChildren().addAll(comboBox,deleteButton); hbox.disableProperty().bind(readOnly); return hbox; } }
editableComboBoxBox.setPadding(new Insets(10)); ComboBox<String> combo1 = new ComboBox<String>(items); combo1.setEditable(true); editableComboBoxBox.getChildren().add(combo1); ComboBox<String> combo2 = new ComboBox<String>(items); combo2.setDisable(true); combo2.setEditable(true); editableComboBoxBox.getChildren().add(combo2); collectorVBox.getChildren().add(editableComboBoxBox); 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); comboBoxBox.getChildren().add(combo4);
@Override public Node createValueVisualisation() { HBox hBox = new HBox(3); hBox.setAlignment(Pos.CENTER_LEFT); Label label = new Label(); label.textProperty().bindBidirectional(observableAttributeValue, new DurationStringConverter()); ComboBox<ChronoUnit> comboBox = new ComboBox<>(); comboBox.setEditable(false); comboBox.getItems().addAll(ChronoUnit.NANOS, ChronoUnit.MICROS, ChronoUnit.MILLIS, ChronoUnit.SECONDS, ChronoUnit.MINUTES, ChronoUnit.HOURS, ChronoUnit.HALF_DAYS, ChronoUnit.DAYS); TextField textField = new TextField(); TypedTextFieldHelper.setupLongTextField(textField); textField.disableProperty().bind(comboBox.valueProperty().isNull()); HBox.setHgrow(textField, Priority.ALWAYS); // boundTo.addListener((observable, oldValue, newValue) -> { // if(newValue == null || !newValue.equals(oldValue)) // setFields(newValue, textField, comboBox); // }); comboBox.valueProperty().addListener((observable, oldValue, newValue) -> setDuration(observableAttributeValue, textField, comboBox)); textField.textProperty().addListener((observable, oldValue, newValue) -> setDuration(observableAttributeValue, textField, comboBox)); hBox.getChildren().addAll(label, comboBox, textField); hBox.disableProperty().bind(readOnly); return hBox; }
combo2.setEditable(true); ChoiceBox<String> choice = new ChoiceBox<String>(FXCollections.observableArrayList("Choice A", "Choice B", "Choice C")); MenuButton m = new MenuButton("Shutdown");
ComboBox<String> ecombo5 = new ComboBox<String>(); ecombo5.setItems(items); ecombo5.setEditable(true); ecombo5.setPromptText("select"); AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.REGULAR).style(ecombo5); ComboBox<String> ecombo6 = new ComboBox<String>(); ecombo6.setItems(items); ecombo6.setEditable(true); ecombo6.setPromptText("select"); AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.SMALL).style(ecombo6); ComboBox<String> ecombo7 = new ComboBox<String>(); ecombo7.setItems(items); ecombo7.setEditable(true); ecombo7.setPromptText("select"); AquaFx.createComboBoxStyler().setSizeVariant(ControlSizeVariant.MINI).style(ecombo7);