use of javafx.scene.control.TextInputDialog in project financial by greatkendy123.
the class MyController method delTeamAction.
/**
* 删除团队ID
* 备注:此方法的界面按钮已经删除,但后台代码仍保留着(以备后期要重新开发)
*
* @time 2017年11月14日
* @param event
*/
public void delTeamAction(ActionEvent event) {
// 注册界面
TextInputDialog dialog = new TextInputDialog("");
dialog.setTitle("注册");
dialog.setHeaderText(null);
dialog.setContentText("删除团队ID:");
// dialog.getDialogPane().getButtonTypes().removeAll(ButtonType.CANCEL);
Optional<String> result = dialog.showAndWait();
result.ifPresent(_teamId -> {
try {
String teamId = _teamId.trim().toUpperCase();
// 判断是否有此团队
Huishui hs = DataConstans.huishuiMap.get(teamId);
if (hs == null) {
ShowUtil.show("哥,不存在此团队ID,请检查!");
return;
}
// 清空数据库与缓存中回水表中的团队记录
DBUtil.delHuishui(teamId);
DataConstans.huishuiMap.remove(teamId);
// 清空数据库与缓存中属于该团队的人员记录
DBUtil.delMembers_after_delTeam(teamId);
synchronized (DataConstans.membersMap) {
Iterator<Map.Entry<String, Player>> ite = DataConstans.membersMap.entrySet().iterator();
while (ite.hasNext()) {
Map.Entry<String, Player> entry = ite.next();
Player player = entry.getValue();
if (player.getTeamName().trim().toUpperCase().equals(teamId)) {
// 删除
ite.remove();
}
}
}
// 以下清除代码
// A 清空代理查询中的团队下拉框
String selected_team = teamIDCombox.getSelectionModel().getSelectedItem();
teamIDCombox.getItems().remove(teamId);
if (teamId.equals(selected_team) && teamIDCombox.getItems().size() > 0) {
teamIDCombox.getSelectionModel().select(0);
}
// B 积分查询中的团队下拉框
String selected_jifen = jfTeamIDCombox.getSelectionModel().getSelectedItem();
jfTeamIDCombox.getItems().remove(teamId);
if (teamId.equals(selected_jifen) && jfTeamIDCombox.getItems().size() > 0) {
jfTeamIDCombox.getSelectionModel().select(0);
}
// C 实时上码中的团队下拉框
ShangmaService.initShangmaButton();
((Button) shangmaVBox.getChildren().get(0)).fire();
ShowUtil.show("删除成功!", 2);
} catch (Exception e) {
log.error("删除团队ID失败", e);
}
});
}
use of javafx.scene.control.TextInputDialog in project dwoss by gg-net.
the class ExportDossierToXlsAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Ui.exec(() -> {
Ui.build().title("Bitte DossierId eingeben").dialog().eval(() -> {
TextInputDialog dialog = new TextInputDialog();
dialog.setContentText("Bitte DossierId eingeben:");
dialog.getDialogPane().lookupButton(OK).disableProperty().bind(Bindings.createBooleanBinding(() -> dialog.getEditor().getText().trim().isEmpty(), dialog.getEditor().textProperty()));
return dialog;
}).opt().filter(s -> !StringUtils.isBlank(s)).map(r -> ReplyUtil.wrap(() -> Ui.osOpen(Dl.remote().lookup(DocumentSupporter.class).toXls(r).toTemporaryFile()))).filter(Ui.failure()::handle);
});
}
use of javafx.scene.control.TextInputDialog in project jabref by JabRef.
the class FXDialogService method showInputDialogAndWait.
@Override
public Optional<String> showInputDialogAndWait(String title, String content) {
TextInputDialog inputDialog = new TextInputDialog();
inputDialog.setHeaderText(title);
inputDialog.setContentText(content);
return inputDialog.showAndWait();
}
use of javafx.scene.control.TextInputDialog in project Smartcity-Smarthouse by TechnionYP5777.
the class RoomViewController method addSensor.
private void addSensor(final double x, final double y) {
final TextInputDialog dialog = new TextInputDialog("sensor name");
dialog.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("Homeicon.png"))));
dialog.setTitle("Create Sensor");
dialog.setHeaderText("Config your simulator");
dialog.setContentText("Please enter sensor name:");
final Optional<String> result = dialog.showAndWait();
if (!result.isPresent())
return;
final String name = result.get();
final SensorLabel label = new SensorLabel(x, y, name);
final SensorData sensor = new SensorData(name, label, location);
mainController.addSensor(sensor);
RoomViewController.this.labels.add(label);
pane.getChildren().add(label);
}
use of javafx.scene.control.TextInputDialog in project Money-Manager by krHasan.
the class MakeATransactionController method gmCreateSourceBtn.
@FXML
private void gmCreateSourceBtn(ActionEvent event) {
TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("Create Income Source");
dialog.setHeaderText("Create Income Source, Where from you get Tk.");
dialog.setContentText("Please type a source name :");
Stage MakeATransactionStage = (Stage) gmbtnCreateSource.getScene().getWindow();
dialog.setX(MakeATransactionStage.getX() + 200);
dialog.setY(MakeATransactionStage.getY() + 170);
Optional<String> result = dialog.showAndWait();
if (result.isPresent()) {
String typedName = result.get();
if (typedName.length() == 0) {
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("Operation Falied");
alert.setHeaderText(null);
alert.setContentText("Write a Source Name Please");
alert.setX(MakeATransactionStage.getX() + 200);
alert.setY(MakeATransactionStage.getY() + 170);
Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
alert.hide();
}
}));
idlestage.setCycleCount(1);
idlestage.play();
alert.showAndWait();
} else if (countWords(typedName) == 0) {
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("Operation Falied");
alert.setHeaderText(null);
alert.setContentText("Write a Source Name Please");
alert.setX(MakeATransactionStage.getX() + 200);
alert.setY(MakeATransactionStage.getY() + 170);
Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
alert.hide();
}
}));
idlestage.setCycleCount(1);
idlestage.play();
alert.showAndWait();
} else {
new Source().createSource(typedName);
Alert confirmationMsg = new Alert(AlertType.INFORMATION);
confirmationMsg.setTitle("Message");
confirmationMsg.setHeaderText(null);
confirmationMsg.setContentText("Source " + typedName + " created successfully");
Stage SettingsStage = (Stage) MakeATransactionStage.getScene().getWindow();
confirmationMsg.setX(SettingsStage.getX() + 200);
confirmationMsg.setY(SettingsStage.getY() + 170);
Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(2), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
confirmationMsg.hide();
}
}));
idlestage.setCycleCount(1);
idlestage.play();
confirmationMsg.showAndWait();
gmLoadSource();
gmcmboSource.getSelectionModel().selectLast();
}
}
}
Aggregations