List of usage examples for javafx.util.converter BigDecimalStringConverter BigDecimalStringConverter
BigDecimalStringConverter
From source file:com.hengyi.japp.print.client.controller.MdController.java
@Override public void initialize(URL url, ResourceBundle rb) { zrolmgeColumn.setCellValueFactory(o -> o.getValue().zrolmgeProperty()); zsgwghtColumn.setCellValueFactory(o -> o.getValue().zsgwghtProperty()); zsgwghtColumn.setCellFactory(TextFieldTableCell.forTableColumn(new BigDecimalStringConverter())); zsgwghtColumn.setOnEditCommit(ev -> ev.getTableView().getItems().get(ev.getTablePosition().getRow()) .setZsgwght(ev.getNewValue())); sapMaraListView.setOnMouseClicked(ev -> { if (ev.getClickCount() == 2) { selectSapMara(sapMaraListView.getSelectionModel().getSelectedItem()); sapMaraListView.setVisible(false); }/* w w w . j a v a 2 s . c o m*/ }); }
From source file:com.hengyi.japp.print.client.controller.MdController.java
public void initMd(Md _md) { md = _md;/*w ww .j a v a 2 s .co m*/ chargLabel.textProperty().bind(md.chargProperty()); hsdatField.valueProperty().bindBidirectional(md.hsdatProperty()); sapYmmbanciField.valueProperty().bindBidirectional(md.sapYmmbanciProperty()); sapYmmbanciField.itemsProperty().bind(md.getSapT001().sapYmmbancisProperty()); sapT001wField.valueProperty().bindBidirectional(md.sapT001wProperty()); sapT001wField.itemsProperty().bind(md.getSapT001().sapT001wsProperty()); // sapT001wField.valueProperty().addListener((ov, oldV, newV) -> sapT001wLabel.textProperty().bind(newV.name1Property())); // sapT001wField.setCellFactory(SAPT001WCELLFACTORY); sapT001lField.valueProperty().bindBidirectional(md.sapT001lProperty()); sapT001lField.itemsProperty().bind(md.getSapT001w().sapT001lsProperty()); // sapT001lField.valueProperty().addListener((ov, oldV, newV) -> sapT001lLabel.textProperty().bind(newV.lgobeProperty())); // sapT001lField.setCellFactory(SAPT001LCELLFACTORY); sapZpackageField.valueProperty().bindBidirectional(md.sapZpackageProperty()); sapZpackageField.itemsProperty().bind(md.getSapT001().sapZpackagesProperty()); sapYmmzhixField.valueProperty().addListener( (ov, oldV, newV) -> sapYmmzhixLabel.setText(newV == null ? null : newV.getYzxwght() + " KG")); sapYmmzhixField.valueProperty().bindBidirectional(md.sapYmmzhixProperty()); sapYmmzhixField.itemsProperty().bind(md.getSapT001().sapYmmzhixsProperty()); // sapYmmzhixField.setCellFactory(SAPYMMZHIXCELLFACTORY); sapYmmtonggField.valueProperty().addListener( (ov, oldV, newV) -> sapYmmtonggLabel.setText(newV == null ? null : newV.getZtgwght() + " KG")); sapYmmtonggField.valueProperty().bindBidirectional(md.sapYmmtonggProperty()); sapYmmtonggField.itemsProperty().bind(md.getSapT001().sapYmmtonggsProperty()); // sapYmmtonggField.setCellFactory(SAPYMMTONGGCELLFACTORY); zrolmgeField.textProperty().bindBidirectional(md.zrolmgeProperty(), new NumberStringConverter()); sapYmmmachField.valueProperty().bindBidirectional(md.sapYmmmachProperty()); sapYmmmachField.itemsProperty().bind(md.getSapT001().sapYmmmachsProperty()); // sapYmmmachField.valueProperty().addListener((ov, oldV, newV) -> sapYmmmachLabel.setText(newV == null ? null : newV.getZplant())); // sapYmmmachField.setCellFactory(SAPYMMMACHCELLFACTORY); // sapYmmcheField.valueProperty().bindBidirectional(md.sapYmmcheProperty()); // sapYmmcheField.itemsProperty().bind(md.getSapT001().sapymm()); // sapYmmcheField.setCellFactory(SAPYMMCHECELLFACTORY); // sapYmmcheField.valueProperty().addListener((ov, oldV, newV) -> sapYmmcheLabel.setText(newV == null ? null : newV.getZchwght() + " KG")); zcanmgeField.textProperty().bindBidirectional(md.zcanmgeProperty(), new NumberStringConverter()); zdzflgField.selectedProperty().bindBidirectional(md.zdzflgProperty()); zcnwghtField.textProperty().bindBidirectional(md.zcnwghtProperty(), new BigDecimalStringConverter()); xdTable.itemsProperty().bindBidirectional(md.xdsProperty()); sumZsgwghtLabel.textProperty().bindBidirectional(md.zsgwghtProperty(), new BigDecimalStringConverter()); sumZsnwghtLabel.textProperty().bindBidirectional(md.zsnwghtProperty(), new BigDecimalStringConverter()); if (StringUtils.isNotBlank(md.getCharg())) { sapMaraListView.setVisible(false); Platform.runLater(() -> matnrField.requestFocus()); } }