public void delete(ActionEvent event) { ToolsTray bandeja = (ToolsTray) toolTable.getSelectionModel().getSelectedItem(); if (null != bandeja && null != bandeja.getId()) { Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setTitle("删除提醒"); alert.setHeaderText(null); alert.setContentText("确定删除:" + bandeja.getTrayName()); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.OK) { dao.delete(ToolsTray.class, bandeja.getId()); tipsLabel.setText("删除成功:" + bandeja.getTrayName()); refresh(null); } } }
private void modifyPlan(ToolsTray bandeja) { tipsLabel.setText("修改任务中:" + bandeja.getTrayName()); id = bandeja.getId(); nameField.setText(bandeja.getTrayName()); commandText.setText(bandeja.getCommand()); }