/** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { notification.setText(message); notification.setGraphic(icon.view()); notification.getStyleClass().add(palette.name().toLowerCase()); }
public static Label createLabel(String text, Character icon) { Label label = new Label(text); label.setTextFill(Color.GRAY); label.setFont(new Font(20)); label.setGraphicTextGap(6); Text iconT = createIconText(icon, 24); iconT.setFill(Color.GRAY); label.setGraphic(iconT); return label; }
tabLabel.setText(tab.getText()); } else if ("GRAPHIC".equals(p)) { tabLabel.setGraphic(tab.getGraphic()); } else if ("TOOLTIP".equals(p)) {
private void showAutocompletePopup(int insertionIndex, String input) { CompletionResultSource suggestionMaker = mySuggestionProvider.get(); List<MenuItem> suggestions = suggestionMaker.getSortedMatches(input, 5) .map(result -> { Label entryLabel = new Label(); entryLabel.setGraphic(result.getTextFlow()); entryLabel.setPrefHeight(5); CustomMenuItem item = new CustomMenuItem(entryLabel, true); item.setUserData(result); item.setOnAction(e -> applySuggestion(insertionIndex, input, result.getNodeName())); return item; }) .collect(Collectors.toList()); autoCompletePopup.getItems().setAll(suggestions); myCodeArea.getCharacterBoundsOnScreen(insertionIndex, insertionIndex + input.length()) .ifPresent(bounds -> autoCompletePopup.show(myCodeArea, bounds.getMinX(), bounds.getMaxY())); Skin<?> skin = autoCompletePopup.getSkin(); if (skin != null) { Node fstItem = skin.getNode().lookup(".menu-item"); if (fstItem != null) { fstItem.requestFocus(); } } }
private Label buildLabel(String message, NotificationType type) { Label textLabel = new Label(message); textLabel.getStyleClass().add("notification-text"); if (type != null) { textLabel.getStyleClass().add(type.getStyleClass()); textLabel.setGraphic(type.getGraphic()); } return textLabel; }
public DashboardTile(String title, String description, Node graphic) { getStyleClass().addAll("dashboard-modules-tile"); Label titleLabel = new Label(title); titleLabel.getStyleClass().add("dashboard-modules-tile-title"); if (nonNull(graphic)) { titleLabel.setGraphic(graphic); } Label textLabel = new Label(description); textLabel.getStyleClass().add("dashboard-modules-tile-text"); textLabel.setMinHeight(USE_PREF_SIZE); VBox topTile = new VBox(5); topTile.getChildren().addAll(titleLabel, textLabel); button.getStyleClass().add("dashboard-modules-invisible-button"); button.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); armed.bind(button.armedProperty()); getChildren().addAll(new StackPane(topTile, button)); setMaxHeight(USE_PREF_SIZE); setMinHeight(USE_PREF_SIZE); }
private void graphicChanged(ObservableValue<? extends Node> observable, Node oldValue, Node newValue) { this.l.setGraphic(newValue); }
Set<Node> items = scatterChart.lookupAll("Label.chart-legend-item"); int it=0; for (Node item : items) { Label label = (Label) item; label.setGraphic(seriesNodes.get(it)); it++; }
protected void buildExpandedcon() { final FontIcon expandedIcon = new FontIcon("fa-minus-square-o:16"); expandedIcon.getStyleClass().add("expand-collapse-icon"); expandedLabel.setGraphic(expandedIcon); }
protected void buildCollapsedIcon() { final FontIcon icon = new FontIcon("fa-plus-square-o:16"); icon.getStyleClass().add("expand-collapse-icon"); collpasedLabel.setGraphic(icon); }
public static void setContentLocationSeparator(Label separator) { FontIcon icon = new FontIcon("fa-caret-square-o-right:12"); separator.setGraphic(icon); icon.getStyleClass().add("content-location-separator"); }
public static void setHeaderLocationSeparator(Label separator) { FontIcon icon = new FontIcon("mdi-chevron-right:20"); separator.setGraphic(icon); icon.getStyleClass().add("header-location-separator"); }
public static Node getErrorIcon() { Label label = new Label(); FontIcon icon = new FontIcon("fa-exclamation:20"); label.setGraphic(icon); return label; }
/** * Get a fa-caret-square-o-right. * * @return */ public static Node getSep() { Label separator = new Label(); FontIcon icon = new FontIcon("fa-caret-square-o-right:14"); separator.setGraphic(icon); icon.getStyleClass().add("ep-structure-location-item-label-ikonli"); return separator; }
public static Node getSep(String iconStyleClass) { Label separator = new Label(); FontIcon icon = new FontIcon("fa-caret-square-o-right:14"); separator.setGraphic(icon); separator.getStyleClass().add(iconStyleClass); return separator; }
protected void onSuccess(IOperationResult operationResult) { long count = (int) operationResult.getMetaData().get("totalElements"); if (count > 0) { String key = getExtraParameters().get("withRoleBLabel") == null ? WITH_ITEMS : (getExtraParameters().get("withRoleBLabel")); label.setText(controller.getLocalised(key, count)); label.setGraphic(null); } else { String key = getExtraParameters().get("noRoleBLabel") == null ? NO_ITEMS : (getExtraParameters().get("noRoleBLabel")); label.setText(controller.getLocalised(key)); label.setGraphic(null); } }
private void addLegend() { if (legend == null) { legend = new Label(); legend.textProperty().bind(textProperty()); legend.getStyleClass().add("legend"); getChildren().add(0, legend); } legend.setGraphic(getIcon()); }
public Label createIconLabel(GlyphIcons icon, String text, String iconSize, String fontSize, ContentDisplay contentDisplay) { Text iconLabel = createIcon(icon, iconSize); Label label = new Label(text); label.setStyle("-fx-font-size: " + fontSize); label.setGraphic(iconLabel); label.setContentDisplay(contentDisplay); return label; }
private Label createProgressIndicator() { Label graphic = new Label(); graphic.setGraphic(getSkinnable().getProgressNode()); graphic.visibleProperty().bind(getSkinnable().progressVisibleProperty()); graphic.getStyleClass().add("masker-graphic"); //$NON-NLS-1$ return graphic; } }
private Node createDecorationNode(ValidationMessage message) { Node graphic = Severity.ERROR == message.getSeverity() ? createErrorNode() : createWarningNode(); graphic.setStyle(SHADOW_EFFECT); Label label = new Label(); label.setGraphic(graphic); label.setTooltip(createTooltip(message)); label.setAlignment(Pos.CENTER); return label; }