Source:
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)) { assignIcon(lTesting, "Testing", "testingIcon", 30); } Label lCommercial = new Label(); if (!script.isFree()) { assignIcon(lCommercial, "Commercial", "commercialIcon", 30); } Label lPatch = new Label(); if (script.isRequiresPatch()) { assignIcon(lPatch, "Patch required", "patchIcon", 30); } Label lOs = new Label(); if (!script.getCompatibleOperatingSystems().contains(curOs)) { assignIcon(lOs, "All Operating Systems", "osIcon", 30); } Label lSpace = new Label(); lSpace.setPrefSize(30, 30); javafx.scene.layout.HBox iconBox = new javafx.scene.layout.HBox(lTesting, lCommercial, lPatch, lOs, lSpace); scriptGrid.addRow(i, scriptName, iconBox, installButton); } }

Target:
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); } }