use of org.phoenicis.javafx.dialogs.ErrorDialog in project POL-POM-5 by PlayOnLinux.
the class ApplicationInformationPanelSkin method updateScripts.
/**
* 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();
}
});
OperatingSystem curOs = new OperatingSystemFetcher().fetchCurrentOperationSystem();
Label lTesting = new Label();
if (script.getTestingOperatingSystems().contains(curOs)) {
lTesting.getStyleClass().add("testingIcon");
lTesting.setTooltip(new Tooltip(tr("Testing")));
lTesting.setMinSize(30, 30);
}
Label lCommercial = new Label();
if (!script.isFree()) {
lCommercial.getStyleClass().add("commercialIcon");
lCommercial.setTooltip(new Tooltip(tr("Commercial")));
lCommercial.setMinSize(30, 30);
}
Label lPatch = new Label();
if (script.isRequiresPatch()) {
lPatch.getStyleClass().add("patchIcon");
lPatch.setTooltip(new Tooltip(tr("Patch required")));
lPatch.setMinSize(30, 30);
}
Label lOs = new Label();
if (!script.getCompatibleOperatingSystems().contains(curOs)) {
lOs.getStyleClass().add("osIcon");
lOs.setTooltip(new Tooltip(tr("All Operating Systems")));
lOs.setMinSize(30, 30);
}
Label lSpace = new Label();
lSpace.setPrefSize(30, 30);
HBox iconBox = new HBox(lTesting, lCommercial, lPatch, lOs, lSpace);
scriptGrid.addRow(i, scriptName, iconBox, installButton);
}
}
use of org.phoenicis.javafx.dialogs.ErrorDialog in project POL-POM-5 by PlayOnLinux.
the class MainWindow method createContainersTab.
private Tab createContainersTab(ContainersFeaturePanel containers) {
final Tab containersTab = new Tab(tr("Containers"), containers);
containersTab.setClosable(false);
containersTab.setOnSelectionChanged(event -> containers.getContainersManager().fetchContainers(containerCategories -> Platform.runLater(() -> {
containers.getCategories().setAll(containerCategories);
containers.setInitialized(true);
}), e -> Platform.runLater(() -> {
final ErrorDialog errorDialog = ErrorDialog.builder().withMessage(tr("Loading containers failed.")).withException(e).withOwner(containers.getScene().getWindow()).build();
errorDialog.showAndWait();
})));
return containersTab;
}
use of org.phoenicis.javafx.dialogs.ErrorDialog in project POL-POM-5 by PlayOnLinux.
the class LibraryController method showError.
private void showError(Exception e) {
Platform.runLater(() -> {
final ErrorDialog errorDialog = ErrorDialog.builder().withOwner(getView().getScene().getWindow()).withException(e).withMessage(tr("Unable to load library, please try again.")).build();
errorDialog.showAndWait();
});
}
use of org.phoenicis.javafx.dialogs.ErrorDialog in project POL-POM-5 by PhoenicisOrg.
the class MainWindow method createContainersTab.
private Tab createContainersTab(ContainersFeaturePanel containers) {
final Tab containersTab = new Tab(tr("Containers"), containers);
containersTab.setClosable(false);
containersTab.setOnSelectionChanged(event -> containers.getContainersManager().fetchContainers(containerCategories -> Platform.runLater(() -> {
containers.getCategories().setAll(containerCategories);
containers.setInitialized(true);
}), e -> Platform.runLater(() -> {
final ErrorDialog errorDialog = ErrorDialog.builder().withMessage(tr("Loading containers failed.")).withException(e).withOwner(containers.getScene().getWindow()).build();
errorDialog.showAndWait();
})));
return containersTab;
}
use of org.phoenicis.javafx.dialogs.ErrorDialog in project POL-POM-5 by PhoenicisOrg.
the class AppsController method showError.
private void showError(Exception e) {
Platform.runLater(() -> {
final ErrorDialog errorDialog = ErrorDialog.builder().withOwner(view.getScene().getWindow()).withException(e).withMessage(tr("Connecting to the repository failed.\nPlease check your connection and try again.")).build();
errorDialog.showAndWait();
});
}
Aggregations