buttonBox.setId(id); buttonBox.setAlignment(Pos.TOP_RIGHT);
/** * Populates the repository details step for the classpath repository */ private void populate() { this.classpathField = new TextField(); Label classpathLabel = new Label(tr("Classpath:")); classpathLabel.setLabelFor(classpathField); HBox content = new HBox(classpathLabel, classpathField); content.setId("addClasspathRepository"); HBox.setHgrow(classpathField, Priority.ALWAYS); this.setCenter(content); }
/** * This Method creates and defines a horizontal box with a button. */ public HBox addHorizontalBoxWithButton() { // set up horizontal box and button HBox hBox = new HBox(); hBox.setId("hBox"); hBox.setPadding(new Insets(10, 10, 10, 10)); hBox.setSpacing(10); // hBox.setStyle("-fx-background-colour: #FFFFFF;"); hBox.setAlignment(Pos.CENTER); Button startButton = new Button("CLICK ME"); startButton.setPrefSize(100, 30); // set up a message Text message = new Text("Click the button to get started."); message.setId("message"); hBox.getChildren().add(message); hBox.getChildren().add(startButton); return hBox; }
/** * Populates the repository details step for the local repository */ private void populate() { this.pathField = new TextField(); this.openBrowser = new Button(tr("Choose Directory...")); openBrowser.setOnAction(event -> { DirectoryChooser chooser = new DirectoryChooser(); File directory = chooser.showDialog(null); pathField.setText(directory.toString()); }); HBox content = new HBox(pathField, openBrowser); content.setId("addLocalRepository"); HBox.setHgrow(pathField, Priority.ALWAYS); this.setCenter(content); }
row.setId("candidateship"); row.setVisible(canBeCandidate(player, town));
hBoxProgressPaneInnerTaskEntry.setId(taskId + "Hbox"); hBoxProgressPaneInnerTaskEntry.getChildren().addAll(piTaskEntry, lblTaskEntry); vBoxProgressPaneInner.getChildren().add(0, separatorTasks);
/** * Populates the content of this component */ private void populate() { choiceBox = new ComboBox<>(repositoryChoices); choiceBox.setPromptText(tr("Please select the repository type you want to add")); choiceBox.setConverter(new StringConverter<RepositoryType>() { @Override public String toString(RepositoryType repositoryType) { return repositoryType.getLabel(); } @Override public RepositoryType fromString(String string) { return Arrays.stream(RepositoryType.values()).filter(type -> type.getLabel().equals(string)).findAny() .orElse(null); } }); choiceBox.setOnAction( event -> onRepositoryTypeSelection.accept(choiceBox.getSelectionModel().getSelectedItem())); Label choiceBoxLabel = new Label(tr("Repository type:")); choiceBoxLabel.setLabelFor(choiceBox); HBox content = new HBox(choiceBoxLabel, choiceBox); content.setId("repositoryTypeSelection"); HBox.setHgrow(choiceBox, Priority.ALWAYS); this.setCenter(content); }
protected void drawFooter() { HBox footer = new HBox(); footer.setAlignment(Pos.CENTER_RIGHT); footer.setPadding(new Insets(8)); footer.setSpacing(10); footer.setPrefHeight(45); footer.setId("footer"); getParent().getRoot().setBottom(footer); Button cancelButton = new Button(tr("Cancel")); nextButton = new Button(tr("Next")); footer.getChildren().addAll(cancelButton, nextButton); cancelButton.setOnMouseClicked(event -> { cancelButton.setDisable(true); messageWaitingForResponse.sendCancelSignal(); }); }