Example usage for javafx.scene.control RadioButton getId

List of usage examples for javafx.scene.control RadioButton getId

Introduction

In this page you can find the example usage for javafx.scene.control RadioButton getId.

Prototype

public final String getId() 

Source Link

Document

The id of this Node .

Usage

From source file:dpfmanager.shell.interfaces.gui.component.report.ReportsView.java

@FXML
protected void clearReports(ActionEvent event) throws Exception {
    LocalDate date = LocalDate.now();
    date = date.plusYears(10L);//  w  w w. j a  v  a 2 s  .c  om
    RadioButton radio = (RadioButton) toggleClear.getSelectedToggle();
    if (radio.getId().equals("radOlder")) {
        if (datePicker.getValue() != null) {
            date = datePicker.getValue();
        } else {
            getContext().send(BasicConfig.MODULE_MESSAGE,
                    new AlertMessage(AlertMessage.Type.ALERT, bundle.getString("alertSelectDate")));
            return;
        }
    }

    // All ok, delete
    if (getController().clearReports(date)) {
        getModel().clearData();
        getModel().readReports();
        recalculateSize();
        hideClearOptions();
        addData();
        getContext().send(BasicConfig.MODULE_MESSAGE,
                new AlertMessage(AlertMessage.Type.INFO, bundle.getString("successDeleteReports")));
    } else {
        getContext().send(BasicConfig.MODULE_MESSAGE,
                new AlertMessage(AlertMessage.Type.ERROR, bundle.getString("errorDeleteReports")));
    }
}