Example usage for javafx.scene.control Button getId

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

Introduction

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

Prototype

public final String getId() 

Source Link

Document

The id of this Node .

Usage

From source file:com.rcs.shoe.shop.fx.controller.ui.Controller.java

protected Integer getSize(Button button) {
    return new Integer(button.getId().replaceFirst("button", ""));
}

From source file:UIController.java

@FXML
public void resetButton(ActionEvent event) {
    Object obj = event.getSource();
    if (obj instanceof Button) {
        Button clickedButton = (Button) obj;
        if (clickedButton.getId().equals("reset01")) {
            System.out.println("Reset button of Section 1 was clicked.");
            if (appID != null) {
                appID.setText(null);//from   ww w .j  av a  2  s. c  o  m
            }
            if (accessToken != null) {
                accessToken.setText(null);
            }
            if (mobileNumber != null) {
                mobileNumber.setText(null);
            }
        }
        if (clickedButton.getId().equals("reset02")) {
            System.out.println("Reset button of Section 2 was clicked.");
            if (otp != null) {
                otp.setText(otpStart);
            }
        }
    }
}

From source file:UIController.java

@FXML
public void submitButton(ActionEvent event) throws IOException, JSONException, Exception {
    Object obj = event.getSource();
    if (obj instanceof Button) {
        Button clickedButton = (Button) obj;
        if (clickedButton.getId().equals("submit01")) {
            System.out.println("Submit 01 Button Pressed.");
            cog.setAppID((String) appID.getText());
            cog.setAccessToken((String) accessToken.getText());
            statusText.setText("Processing...");
            String getCallStatus = cog.recieveOtp(mobileNumber.getText());
            if (getCallStatus.equalsIgnoreCase("success")) {
                statusText.setText("Missed call placed, enter otp...");
            } else {
                statusText.setText(getCallStatus);
            }//from w  w  w.  j a  va  2  s .c  o  m
            otpStart = cog.otpStart;
            System.out.println(cog.statusMissedCall);
            otp.setText(otpStart);
        }
        if (clickedButton.getId().equals("submit02")) {
            System.out.println("Submit 02 Button Pressed.");
            String correctedOtp = otp.getText().replaceAll("[+]", "");
            System.out.println(correctedOtp);
            String status;
            status = cog.sendOtp((String) otp.getText());
            System.out.println(status);
            if (status.equalsIgnoreCase("success")) {
                statusText.setText("Mobile Number Verified SuccessFully");
            } else {
                statusText.setText("Mobile Number Verification Failed");
            }

        }
    }
}

From source file:com.rcs.shoe.shop.fx.controller.ui.SaleEnterController.java

private void initializeQuantityFields() {
    quantityLabels = new HashMap<>();
    quantityButtons = new HashMap<>();
    ObservableList<Node> children = sizesPane.getChildren();
    for (Node node : children) {
        if (node instanceof Label && node.getId() != null && node.getId().startsWith("label")) {
            Label label = (Label) node;
            quantityLabels.put(label.getId(), label);
        } else if (node instanceof Button) {
            Button button = (Button) node;
            if (button.getId() != null && button.getId().startsWith("button")) {
                quantityButtons.put(button.getId(), button);
            }/*from   ww w . jav  a  2  s .  co  m*/
        }
    }
}

From source file:jasperreports.FXMLDocumentController.java

@FXML
public void handleButtonAction(ActionEvent event) {

    Button b = (Button) event.getSource();
    if (destination.getText().length() > 0) {
        String destinationFileName = destination.getText();

        switch (b.getId()) {
        case "toPDF1":
            Generowanieraportow.generowanieraportu1pdf(destinationFileName);
            break;
        case "toHTML1":
            Generowanieraportow.generowanieraportu1html(destinationFileName);
            break;
        case "toPDF2":
            Generowanieraportow.generowanieraportu2pdf(destinationFileName);
            break;
        case "toHTML2":
            Generowanieraportow.generowanieraportu2html(destinationFileName);
            break;
        case "toPDF3":
            Generowanieraportow.generowanieraportu3pdf(destinationFileName);
            break;
        case "toHTML3":
            Generowanieraportow.generowanieraportu3html(destinationFileName);
            break;
        case "toPDF4":
            Generowanieraportow.generowanieraportu4pdf(destinationFileName);
            break;
        case "toHTML4":
            Generowanieraportow.generowanieraportu4html(destinationFileName);
            break;
        case "toPDF5":
            Generowanieraportow.generowanieraportu5pdf(destinationFileName);
            break;
        case "toHTML5":
            Generowanieraportow.generowanieraportu5html(destinationFileName);
            break;
        case "toPDF6":
            Generowanieraportow.generowanieraportu6pdf(destinationFileName);
            break;
        case "toHTML6":
            Generowanieraportow.generowanieraportu6html(destinationFileName);
            break;
        }// w  w w  .  jav  a2s .co m

    } else {
        Alert alert = new Alert(AlertType.ERROR);
        alert.setTitle("Bd");
        alert.setHeaderText(null);
        alert.setContentText("Prosz wybra folder docelowy!");
        alert.showAndWait();
    }

}

From source file:calendarioSeries.vistas.MainViewController.java

@FXML
private void handleButtonPressed(ActionEvent event) {
    Button buttonClicked = (Button) event.getSource();
    String id = buttonClicked.getId();
    for (Label diasMe : diasMes) {
        diasMe.setText("");
    }//from w w  w  . j  a v a  2s  . c om

    if (id.equals("next")) {
        if (mesActual.getNumMes() != 11) {
            mesActual = new Mes(mesActual.getNumAno(), mesActual.getNumMes() + 1);
        } else {
            mesActual = new Mes(mesActual.getNumAno() + 1, 0);
        }
    } else if (id.equals("previous")) {
        if (mesActual.getNumMes() != 0) {
            mesActual = new Mes(mesActual.getNumAno(), mesActual.getNumMes() - 1);
        } else {
            mesActual = new Mes(mesActual.getNumAno() - 1, 11);
        }
    }
    showDetallesMes(mesActual);
    event.consume();
}