예제 #1
0
  private HBox createSkipLoginBar() {
    HBox hbox = createHBox();
    Label labelWarning = new Label();
    labelWarning.setText(skipWarning);
    labelWarning.setWrapText(true);
    Button skipButton = new Button("Skip login");
    skipButton.setOnAction(
        event -> {
          // skip login, direct to preferencesUI with default user settings
          buildDefaultUser();
          stage.setScene(preferenceUI.createPreferenceScene());
        });
    hbox.getChildren().addAll(labelWarning, skipButton);

    return hbox;
  }
예제 #2
0
  private GridPane createLoginForm(BorderPane borderPane) {
    GridPane loginGrid = createGridPane();
    GridPane loadingGrid = createLoadingIndicator();

    ImageView dropboxIconView = createDropboxIconView();

    Button loginButton = new Button("Login to Dropbox");
    loginButton.setOnAction(
        event -> {
          // direct to login website
          getHostServices().showDocument(loginPage);
          // show loading animation
          borderPane.setCenter(loadingGrid);
          // successful login, direct to preferencesUI with dropbox user settings
          buildDropboxUser();
          stage.setScene(preferenceUI.createPreferenceScene());
        });

    loginGrid.add(dropboxIconView, 0, 0);
    loginGrid.add(loginButton, 1, 0);

    return loginGrid;
  }