Search in sources :

Example 6 with TilePane

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);
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) ScriptDTO(org.phoenicis.repository.dto.ScriptDTO) Button(javafx.scene.control.Button) TilePane(javafx.scene.layout.TilePane) Text(javafx.scene.text.Text) ErrorMessage(org.phoenicis.javafx.views.common.ErrorMessage) VBox(javafx.scene.layout.VBox)

Example 7 with TilePane

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);
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) Button(javafx.scene.control.Button) TilePane(javafx.scene.layout.TilePane) FileChooser(javafx.stage.FileChooser) Text(javafx.scene.text.Text) ErrorMessage(org.phoenicis.javafx.views.common.ErrorMessage) VBox(javafx.scene.layout.VBox) File(java.io.File)

Aggregations

TilePane (javafx.scene.layout.TilePane)7 Button (javafx.scene.control.Button)4 VBox (javafx.scene.layout.VBox)4 Text (javafx.scene.text.Text)4 ErrorMessage (org.phoenicis.javafx.views.common.ErrorMessage)4 TextWithStyle (org.phoenicis.javafx.views.common.TextWithStyle)4 File (java.io.File)2 FileChooser (javafx.stage.FileChooser)2 ScriptDTO (org.phoenicis.repository.dto.ScriptDTO)2 HashMap (java.util.HashMap)1 Scene (javafx.scene.Scene)1 Label (javafx.scene.control.Label)1 ScrollPane (javafx.scene.control.ScrollPane)1 TitledPane (javafx.scene.control.TitledPane)1 BorderPane (javafx.scene.layout.BorderPane)1 Pane (javafx.scene.layout.Pane)1 Color (javafx.scene.paint.Color)1 WidgetCategory (org.csstudio.display.builder.model.WidgetCategory)1