textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS);
public void add(Node labelNode, Node dataNode) { GridPane.setConstraints(labelNode, 0, rowCount); GridPane.setConstraints(dataNode, 1, rowCount); GridPane.setHgrow(labelNode, Priority.SOMETIMES); GridPane.setHgrow(dataNode, Priority.ALWAYS); GridPane.setHalignment(labelNode, HPos.RIGHT); GridPane.setHalignment(dataNode, HPos.LEFT); mainPane.getChildren().addAll(labelNode, dataNode); rowCount++; }
public void add(Node labelNode, Node dataNode) { GridPane.setConstraints(labelNode, 0, rowCount); GridPane.setConstraints(dataNode, 1, rowCount); GridPane.setHgrow(labelNode, Priority.SOMETIMES); GridPane.setHgrow(dataNode, Priority.ALWAYS); GridPane.setHalignment(labelNode, HPos.RIGHT); GridPane.setHalignment(dataNode, HPos.LEFT); mainPane.getChildren().addAll(labelNode, dataNode); rowCount++; }
GridPane.setHgrow(editor, Priority.ALWAYS);
textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS);
/** * * @param node */ protected void apply(Node node) { // sanatize the node super.apply(node); // apply constraints if (row < 0) throw new IllegalArgumentException("You must set the row index"); javafx.scene.layout.GridPane.setRowIndex(node, row); if (col < 0) throw new IllegalArgumentException("You must set the col index"); javafx.scene.layout.GridPane.setColumnIndex(node, col); javafx.scene.layout.GridPane.setRowSpan(node, rowSpan); javafx.scene.layout.GridPane.setColumnSpan(node, colSpan); javafx.scene.layout.GridPane.setMargin(node, margin != null ? margin : marginReset); if (hgrow != null) GenericLayoutConstraints.overrideMaxWidth(node, this); javafx.scene.layout.GridPane.setHalignment(node, halignment != null ? halignment : halignmentReset); javafx.scene.layout.GridPane.setHgrow(node, hgrow != null ? hgrow : hgrowReset); javafx.scene.layout.GridPane.setValignment(node, valignment != null ? valignment : valignmentReset); if (vgrow != null) GenericLayoutConstraints.overrideMaxHeight(node, this); javafx.scene.layout.GridPane.setVgrow(node, vgrow != null ? vgrow : vgrowReset); } }
textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS);
public static void showException(String title, String message, Exception exception) { final Alert alert = new Alert(Alert.AlertType.ERROR); alert.initStyle(StageStyle.UTILITY); alert.setTitle("Exception"); alert.setHeaderText(title); alert.setContentText(message); final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw); exception.printStackTrace(pw); final String exceptionText = sw.toString(); final Label label = new Label("Details:"); final TextArea textArea = new TextArea(exceptionText); textArea.setEditable(false); textArea.setWrapText(true); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); final GridPane expContent = new GridPane(); expContent.setMaxWidth(Double.MAX_VALUE); expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); alert.getDialogPane().setExpandableContent(expContent); alert.showAndWait(); }
void updatePane() { actionsBar = ActionUtils.createButtonBar(getActions()); actionsBar.opacityProperty().bind(transition); GridPane.setHgrow(actionsBar, Priority.SOMETIMES); pane.getChildren().clear(); int row = 0; if (title != null) { pane.add(title, 0, row++); } pane.add(label, 0, row); pane.add(actionsBar, 1, row); if (isCloseButtonVisible()) { pane.add(closeBtn, 2, 0, 1, row+1); } }
public ExceptionAlert(Throwable e, String contentText, ButtonType... buttonTypes) { super(AlertType.ERROR, contentText, buttonTypes); String exceptionText = ExceptionUtils.getFullStackTrace(e); Label label = new Label(bundle.getString("stackTraceLabel")); TextArea textArea = new TextArea(exceptionText); textArea.setEditable(false); textArea.setWrapText(true); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); GridPane expContent = new GridPane(); expContent.setMaxWidth(Double.MAX_VALUE); expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); // Set expandable Exception into the dialog pane. this.getDialogPane().setExpandableContent(expContent); } }
private void buildListViewTab(Tab tab) { GridPane grid = new GridPane(); grid.setPadding(new Insets(5, 5, 5, 5)); grid.setHgap(5); grid.setVgap(5); // create the listview final ListView<TestPerson> listView = new ListView<TestPerson>(); listView.setItems(data); // set the cell factory Callback<TestPerson, ObservableValue<Boolean>> getProperty = new Callback<TestPerson, ObservableValue<Boolean>>() { @Override public BooleanProperty call(TestPerson person) { // given a person, we return the property that represents // whether or not they are invited. We can then bind to this // bidirectionally. return person.telecommuterProperty(); } }; listView.setCellFactory(CheckBoxListCell.forListView(getProperty)); grid.add(listView, 0, 0); GridPane.setVgrow(listView, Priority.ALWAYS); GridPane.setHgrow(listView, Priority.ALWAYS); tab.setContent(grid); }
private void updateGrid() { grid.getChildren().clear(); // add the message to the top of the dialog updateContentText(); // then build all the buttons int row = 1; for (final ButtonType buttonType : getDialogPane().getButtonTypes()) { if (buttonType == null) continue; final Button button = (Button)getDialogPane().lookupButton(buttonType); GridPane.setHgrow(button, Priority.ALWAYS); GridPane.setVgrow(button, Priority.ALWAYS); grid.add(button, 0, row++); } // // last button gets some extra padding (hacky) // GridPane.setMargin(buttons.get(buttons.size() - 1), new Insets(0,0,10,0)); getDialogPane().setContent(grid); getDialogPane().requestLayout(); }
private void populateRepositoryRefresh() { // Refresh Repositories this.refreshLayout = new GridPane(); this.refreshLayout.setHgap(20); this.refreshLayout.setVgap(10); this.refreshRepositoriesLabel = new Label( tr("Fetch updates from the repositories to retrieve latest script versions")); this.refreshRepositoriesLabel.setWrapText(true); this.refreshRepositoriesButton = new Button(tr("Refresh Repositories")); this.refreshRepositoriesButton.setOnAction(event -> { this.vBox.setDisable(true); this.overlay.toFront(); repositoryManager.triggerRepositoryChange(); }); this.refreshLayout.add(refreshRepositoriesLabel, 0, 0); this.refreshLayout.add(refreshRepositoriesButton, 1, 0); GridPane.setHgrow(refreshRepositoriesLabel, Priority.ALWAYS); }
private void populate(List<EngineSetting> engineSettings) { final VBox displayPane = new VBox(); displayPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS); final GridPane displayContentPane = new GridPane(); displayContentPane.getStyleClass().add("grid"); int row = 0; for (EngineSetting setting : engineSettings) { final ComboBox<String> comboBox = new ComboBox<>(); comboBox.setMaxWidth(Double.MAX_VALUE); ObservableList<String> items = FXCollections.observableArrayList(setting.getOptions()); comboBox.setItems(items); comboBox.setValue(setting.getCurrentOption(this.container.getName())); comboBox.valueProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> { this.lockAll(); setting.setOption(this.container.getName(), items.indexOf(newValue)); this.unlockAll(); })); displayContentPane.add(new TextWithStyle(setting.getText(), CAPTION_TITLE_CSS_CLASS), 0, row); displayContentPane.add(comboBox, 1, row); lockableElements.add(comboBox); ++row; } Region spacer = new Region(); GridPane.setHgrow(spacer, Priority.ALWAYS); displayContentPane.add(spacer, 2, 0); displayPane.getChildren().addAll(displayContentPane); this.setContent(displayPane); }
private void buildTableViewTab(Tab tab) { GridPane grid = new GridPane(); grid.setPadding(new Insets(5, 5, 5, 5)); grid.setHgap(5); grid.setVgap(5); // create the tableview TableColumn<TestPerson, Boolean> invitedColumn = new TableColumn<TestPerson, Boolean>("Invited"); invitedColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, Boolean>("invited")); TableColumn<TestPerson, String> nameColumn = new TableColumn<TestPerson, String>("First Name"); nameColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, String>("firstName")); TableView<TestPerson> tableView = new TableView<TestPerson>(data); tableView.getColumns().setAll(invitedColumn, nameColumn); // set the cell factory in the invited TableColumn invitedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(invitedColumn)); grid.add(tableView, 0, 0); GridPane.setVgrow(tableView, Priority.ALWAYS); GridPane.setHgrow(tableView, Priority.ALWAYS); tab.setContent(grid); }
this.repositoryGrid.add(repositoryLayout, 1, 0); GridPane.setHgrow(repositoryLayout, Priority.ALWAYS); GridPane.setVgrow(repositoryLayout, Priority.ALWAYS);
/** * Refreshes the shown scripts. * When this method is called it begins by clearing the <code>scriptGrid</code>. * Afterwards this method refills it. */ private void updateScripts(final GridPane scriptGrid) { scriptGrid.getChildren().clear(); for (int i = 0; i < filteredScripts.size(); i++) { ScriptDTO script = filteredScripts.get(i); final Label scriptName = new Label(script.getScriptName()); GridPane.setHgrow(scriptName, Priority.ALWAYS); if (getControl().isShowScriptSource()) { final Tooltip tooltip = new Tooltip(tr("Source: {0}", script.getScriptSource())); Tooltip.install(scriptName, tooltip); } final Button installButton = new Button(tr("Install")); installButton.setOnMouseClicked(evt -> { try { installScript(script); } catch (IllegalArgumentException e) { final ErrorDialog errorDialog = ErrorDialog.builder() .withMessage(tr("Error while trying to download the installer")) .withException(e) .build(); errorDialog.showAndWait(); } }); scriptGrid.addRow(i, scriptName, installButton); } }
textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS);