use of javafx.event.ActionEvent in project financial by greatkendy123.
the class LMController method exportClubOneKeyAction.
/**
* 一键导出俱乐部帐单
*
* @param event
*/
public void exportClubOneKeyAction(ActionEvent event) {
// 循环遍历每一个有数据的团队并导出
ObservableList<String> obList = clubListView.getItems();
if (!CollectUtil.isHaveValue(obList)) {
ShowUtil.show("小林提示:没有俱乐部数据!不导出Excel哦!", 2);
return;
} else {
// 2 遍历
for (String teamId : obList) {
clubListView.getSelectionModel().select(teamId);
exportSingleClubAction(new ActionEvent());
log.info("一键导出俱乐部帐单Excel: " + teamId);
}
}
}
use of javafx.event.ActionEvent in project financial by greatkendy123.
the class SMAutoController method initialize.
/**
* DOM加载完后的事件
*/
@SuppressWarnings("unchecked")
@Override
public void initialize(URL location, ResourceBundle resources) {
// 换行
tokenArea.setWrapText(true);
// 绑定列值属性
MyController.bindCellValue(smAutoDate, smAutoPlayerId, smAutoPlayerName, smAutoPaiju, smAutoApplyAccount, smAutoIsTeamAvailabel, smAutoIsCurrentDay, smAutoIsNextDay, smAutoIsAgree, smAutoIsAgreeSuccess, smAutoAvailabel, smAutoTeamTotalAvailabel);
// bindColorColumns(new TGLirunInfo(),tgLirunTotalProfit,
// tgLirunTotalKaixiao, tgLirunATMCompany, tgLirunTGCompany,
// tgLirunTeamProfit, tgLirunRestHeji, tgLirunHeji);
// 初始化次日上码范围
initNextDayRange();
loadTokenAction(new ActionEvent());
}
use of javafx.event.ActionEvent in project dwoss by gg-net.
the class CustomerSearchController method buildContextMenu.
/**
* Build a ContextMenu for ListView of the search results for a better navigation
*
* @return ContextMenu the filled ContextMenu
*/
private ContextMenu buildContextMenu() {
// Create a ContextMenu
ContextMenu contextMenu = new ContextMenu();
MenuItem viewCustomer = new MenuItem("Detailansicht");
MenuItem viewCompleteCustomer = new MenuItem("Detailansicht inc. aller Mandatendetails");
MenuItem editCustomer = new MenuItem("Bearbeiten");
// adding actions to the context menu
viewCustomer.setOnAction((ActionEvent event) -> {
// open toHtml(String matchcode, DefaultCustomerSalesdata defaults)
if (resultListView.getSelectionModel().getSelectedItem() == null)
return;
PicoCustomer selectedCustomer = resultListView.getSelectionModel().getSelectedItem();
Ui.exec(() -> {
Ui.build(statusHbox).title("Kunde mit Mandant").fx().show(() -> Css.toHtml5WithStyle(AGENT.findCustomerAsMandatorHtml(selectedCustomer.getId())), () -> new HtmlPane());
});
});
viewCompleteCustomer.setOnAction((ActionEvent event) -> {
// open toHtml(String salesRow, String comment)
if (resultListView.getSelectionModel().getSelectedItem() == null)
return;
PicoCustomer selectedCustomer = resultListView.getSelectionModel().getSelectedItem();
Ui.exec(() -> {
Ui.build(statusHbox).title("Kunden Ansicht").fx().show(() -> Css.toHtml5WithStyle(AGENT.findCustomerAsHtml(selectedCustomer.getId())), () -> new HtmlPane());
});
});
editCustomer.setOnAction((ActionEvent event) -> {
if (resultListView.getSelectionModel().getSelectedItem() == null)
return;
PicoCustomer picoCustomer = resultListView.getSelectionModel().getSelectedItem();
Ui.exec(() -> {
Customer customer = Ui.progress().call(() -> AGENT.findByIdEager(Customer.class, picoCustomer.getId()));
if (!customer.isValid()) {
Ui.build(resultListView).title("Fehlerhafter Datensatz").alert().message("Kundendaten sind invalid (aktuell normal): " + customer.getViolationMessage()).show(AlertType.WARNING);
} else if (customer.isSimple()) {
L.info("Edit Simple Customer {}", customer.getId());
Optional<CustomerContinue> result = Ui.build(resultListView).fxml().eval(() -> customer, CustomerSimpleController.class).opt();
if (!result.isPresent())
return;
Reply<Customer> reply = Dl.remote().lookup(CustomerAgent.class).store(result.get().simpleCustomer);
if (!Ui.failure().handle(reply))
return;
if (!result.get().continueEnhance)
return;
Ui.build(statusHbox).fxml().eval(() -> reply.getPayload(), CustomerEnhanceController.class).opt().ifPresent(c -> Ui.build(statusHbox).alert("Would store + " + c));
} else if (customer.isBusiness()) {
L.info("Edit (Complex) Customer {}", customer.getId());
Ui.build(statusHbox).fxml().eval(() -> customer, CustomerEnhanceController.class).opt().ifPresent(c -> Ui.build(statusHbox).alert("Would store + " + c));
}
});
});
// add MenuItemes to ContextMenu
contextMenu.getItems().addAll(viewCustomer, viewCompleteCustomer, editCustomer);
return contextMenu;
}
use of javafx.event.ActionEvent in project dwoss by gg-net.
the class CustomerSearchController method initialize.
@Override
public void initialize(URL url, ResourceBundle rb) {
resultListView.setCellFactory(listView -> {
return new ListCell<PicoCustomer>() {
@Override
protected void updateItem(PicoCustomer item, boolean empty) {
super.updateItem(item, empty);
// Platform.runLater(() -> { // WTF i need this, i don't know, but otherwise
if (item == null || empty) {
setText("");
} else {
setText(item.getShortDescription());
}
// });
}
};
});
// bind the checkboxes to the Set of SearchField
bindCheckBoxes();
// add contextmenu to listview
resultListView.setContextMenu(buildContextMenu());
CUSTOMER_TASK_SERVICE = new CustomerTaskService();
observableCustomers = CUSTOMER_TASK_SERVICE.getPartialResults();
resultListView.setItems(observableCustomers);
searchButton.setOnAction((ActionEvent event) -> search());
searchField.setOnKeyPressed((ke) -> {
if (ke.getCode() == KeyCode.ENTER) {
search();
}
});
SEARCH_PROPERTY.bind(searchField.textProperty());
// Needed, so the bar will fill the space, otherwise it keeps beeing small
progressBar.setMaxWidth(MAX_VALUE);
progressBar.setMaxHeight(MAX_VALUE);
// hidde the HBox
progressBar.visibleProperty().bind(CUSTOMER_TASK_SERVICE.runningProperty());
progressIndicator.visibleProperty().bind(CUSTOMER_TASK_SERVICE.runningProperty());
statusHbox.visibleProperty().bind(CUSTOMER_TASK_SERVICE.runningProperty());
progressIndicator.setProgress(0);
progressBar.setProgress(0);
progressBar.progressProperty().bind(CUSTOMER_TASK_SERVICE.progressProperty());
progressIndicator.progressProperty().bind(CUSTOMER_TASK_SERVICE.progressProperty());
Ui.progress().observe(CUSTOMER_TASK_SERVICE);
}
use of javafx.event.ActionEvent in project dwoss by gg-net.
the class ShipmentUpdateStage method init.
private void init(Shipment s) {
okButton.setOnAction((ActionEvent event) -> {
shipment = getShipment();
if (isValid())
close();
});
cancelButton.setOnAction((ActionEvent event) -> {
close();
});
idField = new TextField(Long.toString(s.getId()));
idField.setDisable(true);
shipIdField = new TextField(s.getShipmentId());
Callback<ListView<TradeName>, ListCell<TradeName>> cb = new Callback<ListView<TradeName>, ListCell<TradeName>>() {
@Override
public ListCell<TradeName> call(ListView<TradeName> param) {
return new ListCell<TradeName>() {
@Override
protected void updateItem(TradeName item, boolean empty) {
super.updateItem(item, empty);
if (item == null || empty)
setText("Hersteller wählen...");
else
setText(item.getName());
}
};
}
};
Set<TradeName> contractors = Dl.local().lookup(CachedMandators.class).loadContractors().all();
ownerBox = new ComboBox<>(FXCollections.observableArrayList(contractors));
ownerBox.setMaxWidth(MAX_VALUE);
ownerBox.setCellFactory(cb);
ownerBox.getSelectionModel().selectedItemProperty().addListener((ObservableValue<? extends TradeName> observable, TradeName oldValue, TradeName newValue) -> {
if (newValue == null)
return;
shipment.setContractor(newValue);
manufacturerBox.getSelectionModel().select(newValue.getManufacturer());
});
ObservableList<TradeName> manufacturers = FXCollections.observableArrayList(TradeName.getManufacturers());
manufacturerBox = new ComboBox<>(manufacturers);
manufacturerBox.setMaxWidth(MAX_VALUE);
manufacturerBox.setCellFactory(cb);
SingleSelectionModel<TradeName> sm = ownerBox.getSelectionModel();
if (s.getContractor() == null)
sm.selectFirst();
else
sm.select(s.getContractor());
if (shipment.getDefaultManufacturer() != null)
manufacturerBox.getSelectionModel().select(shipment.getDefaultManufacturer());
statusBox = new ComboBox<>(FXCollections.observableArrayList(Shipment.Status.values()));
statusBox.setMaxWidth(MAX_VALUE);
statusBox.getSelectionModel().select(s.getStatus() == null ? OPENED : s.getStatus());
GridPane grid = new GridPane();
grid.addRow(1, new Label("ID:"), idField);
grid.addRow(2, new Label("Shipment ID:"), shipIdField);
grid.addRow(3, new Label("Besitzer:"), ownerBox);
grid.addRow(4, new Label("Hersteller:"), manufacturerBox);
grid.addRow(5, new Label("Status"), statusBox);
grid.setMaxWidth(MAX_VALUE);
grid.vgapProperty().set(2.);
grid.getColumnConstraints().add(0, new ColumnConstraints(100, 100, Double.MAX_VALUE, Priority.SOMETIMES, HPos.LEFT, false));
grid.getColumnConstraints().add(1, new ColumnConstraints(100, 150, Double.MAX_VALUE, Priority.ALWAYS, HPos.LEFT, true));
HBox hButtonBox = new HBox(okButton, cancelButton);
hButtonBox.alignmentProperty().set(Pos.TOP_RIGHT);
errorLabel.setWrapText(true);
BorderPane rootPane = new BorderPane(grid, errorLabel, null, hButtonBox, null);
this.setTitle(s.getId() > 0 ? "Shipment bearbeiten" : "Shipment anlegen");
this.setScene(new Scene(rootPane));
this.setResizable(false);
}
Aggregations