Example usage for javafx.scene.control Label getStylesheets

List of usage examples for javafx.scene.control Label getStylesheets

Introduction

In this page you can find the example usage for javafx.scene.control Label getStylesheets.

Prototype

public final ObservableList<String> getStylesheets() 

Source Link

Document

Gets an observable list of string URLs linking to the stylesheets to use with this Parent's contents.

Usage

From source file:caillou.company.clonemanager.gui.customComponent.location.LocationController.java

@Subscribe
public void showErrors(ShowErrorsEvent showErrorsEvent) {
    final List<Error> errors = this.getModel().getErrors();
    if (!errors.isEmpty()) {
        VBox vbox = new VBox();
        vbox.setSpacing(5);//  ww w. ja  v  a 2  s. com
        for (Error error : errors) {
            Label errorLabel = new Label(error.getMessage());
            errorLabel.getStylesheets().add(StyleSheet.LOCATION_CSS);
            if (error.getSeverityLevel()
                    .equals(caillou.company.clonemanager.gui.bean.error.Error.SEVERITY_LEVEL.ERROR)) {
                errorLabel.getStyleClass().add("error");
            } else if (error.getSeverityLevel()
                    .equals(caillou.company.clonemanager.gui.bean.error.Error.SEVERITY_LEVEL.WARNING)) {
                errorLabel.getStyleClass().add("warning");
            }

            vbox.getChildren().add(new Label(error.getMessage()));
        }
        errorPopOver.setContentNode(vbox);
        errorPopOver.show(path);
    } else {
        errorPopOver.hide();
    }
}