void addCSSIfAvailable ( final Parent parent ) { // Read global css when available: final List < String > list = PropertyReaderHelper . get ( applicationContext . getEnvironment ( ) , "javafx.css" ) ; if ( ! list . isEmpty ( ) ) { list . forEach ( css -> parent . getStylesheets ( ) . add ( getClass ( ) . getResource ( css ) . toExternalForm ( ) ) ) ; } addCSSFromAnnotation ( parent ) ; final URL uri = getClass ( ) . getResource ( getStyleSheetName ( ) ) ; if ( uri == null ) { return ; } final String uriToCss = uri . toExternalForm ( ) ; parent . getStylesheets ( ) . add ( uriToCss ) ; }
Adds the CSS if available .