use of org.phoenicis.javafx.views.common.TextWithStyle in project phoenicis by PhoenicisOrg.
the class WinePrefixContainerInputTab method populate.
private void populate() {
final VBox inputPane = new VBox();
final Text title = new TextWithStyle(tr("Input settings"), TITLE_CSS_CLASS);
inputPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
inputPane.getChildren().add(title);
final GridPane inputContentPane = new GridPane();
inputContentPane.getStyleClass().add("grid");
final ComboBox<MouseWarpOverride> mouseWarpOverrideComboBox = new ComboBox<>();
mouseWarpOverrideComboBox.setValue(container.getMouseWarpOverride());
addItems(mouseWarpOverrideComboBox, MouseWarpOverride.class);
inputContentPane.add(new TextWithStyle(tr("Mouse Warp Override"), CAPTION_TITLE_CSS_CLASS), 0, 0);
inputContentPane.add(mouseWarpOverrideComboBox, 1, 0);
inputContentPane.getColumnConstraints().addAll(new ColumnConstraintsWithPercentage(30), new ColumnConstraintsWithPercentage(70));
inputPane.getChildren().addAll(inputContentPane);
this.setContent(inputPane);
lockableElements.add(mouseWarpOverrideComboBox);
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project phoenicis 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 org.phoenicis.javafx.views.common.TextWithStyle in project phoenicis by PhoenicisOrg.
the class EnginePanel method populateContent.
private void populateContent() {
final GridPane informationContentPane = new GridPane();
informationContentPane.getStyleClass().add("grid");
informationContentPane.add(new TextWithStyle(tr("Version:"), CAPTION_TITLE_CSS_CLASS), 0, 0);
Label name = new Label(engineDTO.getVersion());
name.setWrapText(true);
informationContentPane.add(name, 1, 0);
int rowIdx = 1;
for (Map.Entry<String, String> userData : engineDTO.getUserData().entrySet()) {
informationContentPane.add(new TextWithStyle(userData.getKey(), CAPTION_TITLE_CSS_CLASS), 0, rowIdx);
Label path = new Label(userData.getValue());
path.setWrapText(true);
informationContentPane.add(path, 1, rowIdx);
rowIdx++;
}
Button installButton = new Button(tr("Install"));
installButton.setOnMouseClicked(evt -> {
try {
onEngineInstall.accept(engineDTO);
} catch (IllegalArgumentException e) {
LOGGER.error("Failed to get engine", e);
new ErrorMessage(tr("Error while trying to install the engine"), e).show();
}
});
Button deleteButton = new Button(tr("Delete"));
deleteButton.setOnMouseClicked(evt -> {
try {
onEngineDelete.accept(engineDTO);
} catch (IllegalArgumentException e) {
LOGGER.error("Failed to get engine", e);
new ErrorMessage(tr("Error while trying to delete the engine"), e).show();
}
});
Region spacer = new Region();
spacer.getStyleClass().add("engineSpacer");
VBox.setVgrow(spacer, Priority.NEVER);
HBox buttonBox = new HBox();
buttonBox.getStyleClass().add("engineButtons");
buttonBox.getChildren().addAll(installButton, deleteButton);
Region progressSpacer = new Region();
progressSpacer.getStyleClass().add("engineSpacer");
VBox.setVgrow(progressSpacer, Priority.NEVER);
this.setCenter(new VBox(informationContentPane, spacer, buttonBox, progressSpacer));
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project POL-POM-5 by PlayOnLinux.
the class WinePrefixContainerInputTab method populate.
private void populate() {
final VBox inputPane = new VBox();
final Text title = new TextWithStyle(tr("Input settings"), TITLE_CSS_CLASS);
inputPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
inputPane.getChildren().add(title);
final GridPane inputContentPane = new GridPane();
inputContentPane.getStyleClass().add("grid");
final ComboBox<MouseWarpOverride> mouseWarpOverrideComboBox = new ComboBox<>();
mouseWarpOverrideComboBox.setValue(container.getMouseWarpOverride());
addItems(mouseWarpOverrideComboBox, MouseWarpOverride.class);
inputContentPane.add(new TextWithStyle(tr("Mouse Warp Override"), CAPTION_TITLE_CSS_CLASS), 0, 0);
inputContentPane.add(mouseWarpOverrideComboBox, 1, 0);
inputContentPane.getColumnConstraints().addAll(new ColumnConstraintsWithPercentage(30), new ColumnConstraintsWithPercentage(70));
inputPane.getChildren().addAll(inputContentPane);
this.setContent(inputPane);
lockableElements.add(mouseWarpOverrideComboBox);
}
use of org.phoenicis.javafx.views.common.TextWithStyle in project POL-POM-5 by PlayOnLinux.
the class WinePrefixContainerWineToolsTab method populate.
private void populate() {
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 GridPane toolsContentPane = new GridPane();
toolsContentPane.getStyleClass().add("grid");
Button configureWine = new Button(tr("Configure Wine"));
configureWine.getStyleClass().addAll("wineToolButton", "configureWine");
configureWine.setOnMouseClicked(event -> {
this.lockAll();
winePrefixContainerController.runInPrefix(container, "winecfg", this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
GridPane.setHalignment(configureWine, HPos.CENTER);
Button registryEditor = new Button(tr("Registry Editor"));
registryEditor.getStyleClass().addAll("wineToolButton", "registryEditor");
registryEditor.setOnMouseClicked(event -> {
this.lockAll();
winePrefixContainerController.runInPrefix(container, "regedit", this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
GridPane.setHalignment(registryEditor, HPos.CENTER);
Button rebootWindows = new Button(tr("Windows reboot"));
rebootWindows.getStyleClass().addAll("wineToolButton", "rebootWindows");
rebootWindows.setOnMouseClicked(event -> {
this.lockAll();
winePrefixContainerController.runInPrefix(container, "wineboot", this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
GridPane.setHalignment(rebootWindows, HPos.CENTER);
Button repairVirtualDrive = new Button(tr("Repair virtual drive"));
repairVirtualDrive.getStyleClass().addAll("wineToolButton", "repairVirtualDrive");
repairVirtualDrive.setOnMouseClicked(event -> {
this.lockAll();
winePrefixContainerController.repairPrefix(container, this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
GridPane.setHalignment(repairVirtualDrive, HPos.CENTER);
Button commandPrompt = new Button(tr("Command prompt"));
commandPrompt.getStyleClass().addAll("wineToolButton", "commandPrompt");
commandPrompt.setOnMouseClicked(event -> {
this.lockAll();
winePrefixContainerController.runInPrefix(container, "wineconsole", this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
GridPane.setHalignment(commandPrompt, HPos.CENTER);
Button taskManager = new Button(tr("Task manager"));
taskManager.getStyleClass().addAll("wineToolButton", "taskManager");
taskManager.setOnMouseClicked(event -> {
this.lockAll();
winePrefixContainerController.runInPrefix(container, "taskmgr", this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
GridPane.setHalignment(taskManager, HPos.CENTER);
Button killProcesses = new Button(tr("Kill processes"));
killProcesses.getStyleClass().addAll("wineToolButton", "killProcesses");
killProcesses.setOnMouseClicked(event -> {
this.lockAll();
winePrefixContainerController.killProcesses(container, this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
GridPane.setHalignment(killProcesses, HPos.CENTER);
Button uninstallWine = new Button(tr("Wine uninstaller"));
uninstallWine.getStyleClass().addAll("wineToolButton", "uninstallWine");
uninstallWine.setOnMouseClicked(event -> {
this.lockAll();
winePrefixContainerController.runInPrefix(container, "uninstaller", this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
});
GridPane.setHalignment(uninstallWine, HPos.CENTER);
this.lockableElements.addAll(Arrays.asList(configureWine, registryEditor, rebootWindows, repairVirtualDrive, commandPrompt, taskManager, uninstallWine));
toolsContentPane.add(configureWine, 0, 0);
toolsContentPane.add(wineToolCaption(tr("Configure Wine")), 0, 1);
toolsContentPane.add(registryEditor, 1, 0);
toolsContentPane.add(wineToolCaption(tr("Registry Editor")), 1, 1);
toolsContentPane.add(rebootWindows, 2, 0);
toolsContentPane.add(wineToolCaption(tr("Windows reboot")), 2, 1);
toolsContentPane.add(repairVirtualDrive, 3, 0);
toolsContentPane.add(wineToolCaption(tr("Repair virtual drive")), 3, 1);
toolsContentPane.add(commandPrompt, 0, 3);
toolsContentPane.add(wineToolCaption(tr("Command prompt")), 0, 4);
toolsContentPane.add(taskManager, 1, 3);
toolsContentPane.add(wineToolCaption(tr("Task manager")), 1, 4);
toolsContentPane.add(killProcesses, 2, 3);
toolsContentPane.add(wineToolCaption(tr("Kill processes")), 2, 4);
toolsContentPane.add(uninstallWine, 3, 3);
toolsContentPane.add(wineToolCaption(tr("Wine uninstaller")), 3, 4);
toolsPane.getChildren().addAll(toolsContentPane);
toolsContentPane.getColumnConstraints().addAll(new ColumnConstraintsWithPercentage(25), new ColumnConstraintsWithPercentage(25), new ColumnConstraintsWithPercentage(25), new ColumnConstraintsWithPercentage(25));
this.setContent(toolsPane);
}
Aggregations