use of javafx.scene.layout.TilePane in project POL-POM-5 by PhoenicisOrg.
the class WinePrefixContainerWineToolsTab method populate.
private void populate(ApplicationDTO engineTools) {
final VBox toolsPane = new VBox();
final Text title = new TextWithStyle(tr("Wine tools"), TITLE_CSS_CLASS);
toolsPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
toolsPane.getChildren().add(title);
final TilePane toolsContentPane = new TilePane();
toolsContentPane.setPrefColumns(3);
toolsContentPane.getStyleClass().add("grid");
for (ScriptDTO tool : engineTools.getScripts()) {
Button toolButton = new Button(tool.getScriptName());
toolButton.getStyleClass().addAll("toolButton");
toolButton.setStyle("-fx-background-image: url('" + tool.getIcon() + "');");
toolButton.setOnMouseClicked(event -> {
this.lockAll();
this.engineToolsManager.runTool(container.getEngine(), container.getName(), tool.getId(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
this.lockableElements.add(toolButton);
toolsContentPane.getChildren().add(toolButton);
}
toolsPane.getChildren().add(toolsContentPane);
this.setContent(toolsPane);
}
use of javafx.scene.layout.TilePane in project phoenicis by PhoenicisOrg.
the class WinePrefixContainerToolsTab method populate.
private void populate() {
final VBox toolsPane = new VBox();
final Text title = new TextWithStyle(tr("Tools"), TITLE_CSS_CLASS);
toolsPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
toolsPane.getChildren().add(title);
final TilePane toolsContentPane = new TilePane();
toolsContentPane.setPrefColumns(3);
toolsContentPane.getStyleClass().add("grid");
Button runExecutable = new Button(tr("Run executable"));
runExecutable.getStyleClass().addAll("toolButton", "runExecutable");
runExecutable.setOnMouseClicked(event -> {
this.lockAll();
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle(tr("Choose executable"));
File file = fileChooser.showOpenDialog(this.getContent().getScene().getWindow());
if (file != null) {
winePrefixContainerController.runInContainer(container, file.getAbsolutePath(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
}
});
this.lockableElements.add(runExecutable);
toolsContentPane.getChildren().add(runExecutable);
toolsPane.getChildren().addAll(toolsContentPane);
this.setContent(toolsPane);
}
Aggregations