use of javafx.event.ActionEvent in project Money-Manager by krHasan.
the class SettingsController method unarchiveSector.
@FXML
private void unarchiveSector(ActionEvent event) {
try {
sector.unarchiveSector(sectorcmboUnArchive.getValue());
Alert confirmationMsg = new Alert(AlertType.INFORMATION);
confirmationMsg.setTitle("Message");
confirmationMsg.setHeaderText(null);
confirmationMsg.setContentText(sectorcmboUnArchive.getValue() + " is Unarchived Successfully");
Stage SettingsStage = (Stage) btnDashboard.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();
tabSectorInitialize();
} catch (Exception e) {
}
}
use of javafx.event.ActionEvent in project Money-Manager by krHasan.
the class SettingsController method sourcebtnDelete.
@FXML
private void sourcebtnDelete(ActionEvent event) {
try {
Stage SettingsStage = (Stage) btnDashboard.getScene().getWindow();
Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle("Delete Source");
alert.setHeaderText("Are you sure?");
alert.setContentText("You are going to delete Source \"" + sourcecmboDelete.getValue() + "\" ");
alert.setX(SettingsStage.getX() + 210);
alert.setY(SettingsStage.getY() + 170);
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
source.deleteSource(sourcecmboDelete.getValue());
Alert confirmationMsg = new Alert(AlertType.INFORMATION);
confirmationMsg.setTitle("Message");
confirmationMsg.setHeaderText(null);
confirmationMsg.setContentText(sourcecmboDelete.getValue() + " Deleted Successfully");
confirmationMsg.setX(SettingsStage.getX() + 190);
confirmationMsg.setY(SettingsStage.getY() + 190);
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();
}
tabSourceInitialize();
} catch (Exception e) {
}
}
use of javafx.event.ActionEvent in project Money-Manager by krHasan.
the class SettingsController method changeName.
@FXML
private void changeName(ActionEvent event) {
try {
if (!nameChangeClicked) {
TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("Name Change");
dialog.setHeaderText("Enter password for authentication");
dialog.setContentText("Your Password :");
Stage SettingsStage = (Stage) btnDashboard.getScene().getWindow();
dialog.setX(SettingsStage.getX() + 200);
dialog.setY(SettingsStage.getY() + 170);
Optional<String> result = dialog.showAndWait();
if (result.isPresent()) {
if (getPassword().equals(result.get())) {
systemtxtName.setDisable(false);
systembtnChangeName.setText("Save Name");
nameChangeClicked = true;
} else {
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("Message");
alert.setHeaderText(null);
alert.setContentText("Wrong Password");
alert.setX(SettingsStage.getX() + 200);
alert.setY(SettingsStage.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 {
setUserFullName(systemtxtName.getText());
nameChangeClicked = false;
Alert confirmationMsg = new Alert(AlertType.INFORMATION);
confirmationMsg.setTitle("Message");
confirmationMsg.setHeaderText(null);
confirmationMsg.setContentText("Information updated successfully");
Stage SettingsStage = (Stage) btnDashboard.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();
lblUserFullName.setText(getUserFullName());
tabSystemInitialize();
}
} catch (Exception e) {
}
}
use of javafx.event.ActionEvent in project Money-Manager by krHasan.
the class SettingsController method advancedBtnAdd.
@FXML
private void advancedBtnAdd(ActionEvent event) {
try {
if (new ComboboxList().getAdvancedSectorActiveArraySize() == 7) {
Alert confirmationMsg = new Alert(AlertType.INFORMATION);
confirmationMsg.setTitle("Message");
confirmationMsg.setHeaderText(null);
confirmationMsg.setContentText("You can add maximum 7 sector to this list");
Stage SettingsStage = (Stage) btnDashboard.getScene().getWindow();
confirmationMsg.setX(SettingsStage.getX() + 200);
confirmationMsg.setY(SettingsStage.getY() + 170);
tabAdvancedInitialize();
Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(7), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
confirmationMsg.setResult(ButtonType.CANCEL);
confirmationMsg.hide();
}
}));
idlestage.setCycleCount(1);
idlestage.play();
confirmationMsg.showAndWait();
} else {
advancedSector.addSectorToList(advancedCmboAdd.getValue());
Alert confirmationMsg = new Alert(AlertType.INFORMATION);
confirmationMsg.setTitle("Message");
confirmationMsg.setHeaderText(null);
confirmationMsg.setContentText("Successful");
Stage SettingsStage = (Stage) btnDashboard.getScene().getWindow();
confirmationMsg.setX(SettingsStage.getX() + 200);
confirmationMsg.setY(SettingsStage.getY() + 28);
tabAdvancedInitialize();
Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(2), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
confirmationMsg.setResult(ButtonType.CANCEL);
confirmationMsg.hide();
}
}));
idlestage.setCycleCount(1);
idlestage.play();
confirmationMsg.showAndWait();
}
} catch (Exception e) {
}
}
use of javafx.event.ActionEvent in project Money-Manager by krHasan.
the class TransactionHistoryController method mnuUndo.
@FXML
private void mnuUndo(ActionEvent event) {
String feedback = new Undo().actionUndo();
Stage TransactionHistoryStage = (Stage) btnSignOut.getScene().getWindow();
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Action Successful");
alert.setHeaderText(null);
alert.setContentText(feedback);
alert.setX(TransactionHistoryStage.getX() + 190);
alert.setY(TransactionHistoryStage.getY() + 190);
initialize();
Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(2), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
alert.hide();
}
}));
idlestage.setCycleCount(1);
idlestage.play();
alert.showAndWait();
}
Aggregations