Search in sources :

Example 1 with SidebarGroup

use of org.phoenicis.javafx.components.common.control.SidebarGroup in project POL-POM-5 by PlayOnLinux.

the class ApplicationSidebarSkin method createFilterGroup.

private SidebarGroup<CheckBox> createFilterGroup() {
    final CheckBox testingCheck = createCheckBox(tr("Testing"));
    testingCheck.setTooltip(new Tooltip(tr("Also show apps in testing state")));
    getControl().containTestingApplicationsProperty().bind(testingCheck.selectedProperty());
    final CheckBox requiresPatchCheck = createCheckBox(tr("Patch required"));
    requiresPatchCheck.setTooltip(new Tooltip(tr("Also show apps, where CD patch is necessary")));
    getControl().containRequiresPatchApplicationsProperty().bind(requiresPatchCheck.selectedProperty());
    final CheckBox commercialCheck = createCheckBox(tr("Commercial"));
    commercialCheck.setTooltip(new Tooltip(tr("Also show apps not free of costs")));
    commercialCheck.setSelected(true);
    getControl().containCommercialApplicationsProperty().bind(commercialCheck.selectedProperty());
    final CheckBox operatingSystemCheck = createCheckBox(tr("All Operating Systems"));
    operatingSystemCheck.setTooltip(new Tooltip(tr("Also show apps tested on different OS")));
    getControl().containAllOSCompatibleApplicationsProperty().bind(operatingSystemCheck.selectedProperty());
    return new SidebarGroup<>(tr("Filters"), FXCollections.observableArrayList(testingCheck, requiresPatchCheck, commercialCheck, operatingSystemCheck));
}
Also used : CheckBox(javafx.scene.control.CheckBox) Tooltip(javafx.scene.control.Tooltip) SidebarGroup(org.phoenicis.javafx.components.common.control.SidebarGroup)

Example 2 with SidebarGroup

use of org.phoenicis.javafx.components.common.control.SidebarGroup in project POL-POM-5 by PlayOnLinux.

the class EngineSidebarSkin method createInstallationFilters.

/**
 * Creates the {@link SidebarGroup} containing buttons to filter for installed and not installed engines
 */
private SidebarGroup<CheckBox> createInstallationFilters() {
    final CheckBox installedCheck = new CheckBox(tr("Installed"));
    installedCheck.getStyleClass().add("sidebarCheckBox");
    installedCheck.setSelected(true);
    getControl().showInstalledProperty().bind(installedCheck.selectedProperty());
    final CheckBox notInstalledCheck = new CheckBox(tr("Not installed"));
    notInstalledCheck.getStyleClass().add("sidebarCheckBox");
    notInstalledCheck.setSelected(true);
    getControl().showNotInstalledProperty().bind(notInstalledCheck.selectedProperty());
    final SidebarGroup<CheckBox> installationFilterGroup = new SidebarGroup<>();
    installationFilterGroup.getComponents().addAll(installedCheck, notInstalledCheck);
    return installationFilterGroup;
}
Also used : CheckBox(javafx.scene.control.CheckBox) SidebarGroup(org.phoenicis.javafx.components.common.control.SidebarGroup)

Example 3 with SidebarGroup

use of org.phoenicis.javafx.components.common.control.SidebarGroup in project POL-POM-5 by PlayOnLinux.

the class LibrarySidebarSkin method createAdvancedToolsGroup.

/**
 * Creates a {@link SidebarGroup} which contains the advanced tool buttons to:
 * <ul>
 * <li>create a new shortcut</li>
 * <li>run a script</li>
 * <li>open a Phoenicis console</li>
 * </ul>
 *
 * @return The created {@link SidebarGroup} object
 */
private SidebarGroup<Button> createAdvancedToolsGroup() {
    final Button createShortcut = new Button(tr("Create shortcut"));
    createShortcut.getStyleClass().addAll("sidebarButton", "openTerminal");
    createShortcut.setOnMouseClicked(event -> Optional.ofNullable(getControl().getOnCreateShortcut()).ifPresent(Runnable::run));
    final Button runScript = new Button(tr("Run a script"));
    runScript.getStyleClass().addAll("sidebarButton", "scriptButton");
    runScript.setOnMouseClicked(event -> {
        final FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle(tr("Open Script..."));
        final File scriptToRun = fileChooser.showOpenDialog(getControl().getScene().getWindow());
        if (scriptToRun != null) {
            Optional.ofNullable(getControl().getOnScriptRun()).ifPresent(onScriptRun -> onScriptRun.accept(scriptToRun));
        }
    });
    final Button runConsole = new Button(tr("{0} console", getControl().getApplicationName()));
    runConsole.getStyleClass().addAll("sidebarButton", "consoleButton");
    runConsole.setOnMouseClicked(event -> Optional.ofNullable(getControl().getOnOpenConsole()).ifPresent(Runnable::run));
    final SidebarGroup<Button> advancedToolsGroup = new SidebarGroup<>(tr("Advanced Tools"));
    advancedToolsGroup.getComponents().addAll(createShortcut, /* runScript, */
    runConsole);
    return advancedToolsGroup;
}
Also used : Button(javafx.scene.control.Button) FileChooser(javafx.stage.FileChooser) File(java.io.File) SidebarGroup(org.phoenicis.javafx.components.common.control.SidebarGroup)

Example 4 with SidebarGroup

use of org.phoenicis.javafx.components.common.control.SidebarGroup in project POL-POM-5 by PhoenicisOrg.

the class LibrarySidebarSkin method createAdvancedToolsGroup.

/**
 * Creates a {@link SidebarGroup} which contains the advanced tool buttons to:
 * <ul>
 * <li>create a new shortcut</li>
 * <li>run a script</li>
 * <li>open a Phoenicis console</li>
 * </ul>
 *
 * @return The created {@link SidebarGroup} object
 */
private SidebarGroup<Button> createAdvancedToolsGroup() {
    final Button createShortcut = new Button(tr("Create shortcut"));
    createShortcut.getStyleClass().addAll("sidebarButton", "openTerminal");
    createShortcut.setOnMouseClicked(event -> Optional.ofNullable(getControl().getOnCreateShortcut()).ifPresent(Runnable::run));
    final Button runScript = new Button(tr("Run a script"));
    runScript.getStyleClass().addAll("sidebarButton", "scriptButton");
    runScript.setOnMouseClicked(event -> {
        final FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle(tr("Open Script..."));
        final File scriptToRun = fileChooser.showOpenDialog(getControl().getScene().getWindow());
        if (scriptToRun != null) {
            Optional.ofNullable(getControl().getOnScriptRun()).ifPresent(onScriptRun -> onScriptRun.accept(scriptToRun));
        }
    });
    final Button runConsole = new Button(tr("{0} console", getControl().getApplicationName()));
    runConsole.getStyleClass().addAll("sidebarButton", "consoleButton");
    runConsole.setOnMouseClicked(event -> Optional.ofNullable(getControl().getOnOpenConsole()).ifPresent(Runnable::run));
    final SidebarGroup<Button> advancedToolsGroup = new SidebarGroup<>(tr("Advanced Tools"));
    advancedToolsGroup.getComponents().addAll(createShortcut, /* runScript, */
    runConsole);
    return advancedToolsGroup;
}
Also used : Button(javafx.scene.control.Button) FileChooser(javafx.stage.FileChooser) File(java.io.File) SidebarGroup(org.phoenicis.javafx.components.common.control.SidebarGroup)

Example 5 with SidebarGroup

use of org.phoenicis.javafx.components.common.control.SidebarGroup in project POL-POM-5 by PhoenicisOrg.

the class EngineSidebarSkin method createInstallationFilters.

/**
 * Creates the {@link SidebarGroup} containing buttons to filter for installed and not installed engines
 */
private SidebarGroup<CheckBox> createInstallationFilters() {
    final CheckBox installedCheck = new CheckBox(tr("Installed"));
    installedCheck.getStyleClass().add("sidebarCheckBox");
    installedCheck.setSelected(true);
    getControl().showInstalledProperty().bind(installedCheck.selectedProperty());
    final CheckBox notInstalledCheck = new CheckBox(tr("Not installed"));
    notInstalledCheck.getStyleClass().add("sidebarCheckBox");
    notInstalledCheck.setSelected(true);
    getControl().showNotInstalledProperty().bind(notInstalledCheck.selectedProperty());
    final SidebarGroup<CheckBox> installationFilterGroup = new SidebarGroup<>();
    installationFilterGroup.getComponents().addAll(installedCheck, notInstalledCheck);
    return installationFilterGroup;
}
Also used : CheckBox(javafx.scene.control.CheckBox) SidebarGroup(org.phoenicis.javafx.components.common.control.SidebarGroup)

Aggregations

SidebarGroup (org.phoenicis.javafx.components.common.control.SidebarGroup)6 CheckBox (javafx.scene.control.CheckBox)4 File (java.io.File)2 Button (javafx.scene.control.Button)2 Tooltip (javafx.scene.control.Tooltip)2 FileChooser (javafx.stage.FileChooser)2