apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/report/CSSParsingReport.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization

@@ -30,13 +30,11 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 package com.oracle.javafx.scenebuilder.kit.editor.report;
 
-import com.sun.javafx.css.CssError;
-import com.sun.javafx.css.StyleManager;
-import com.sun.javafx.css.parser.CSSParser;
+import javafx.css.CssParser;
 import java.io.IOException;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;

@@ -47,40 +45,40 @@
  *
  */
 public class CSSParsingReport {
     private final Path stylesheetPath;
     private IOException ioException;
-    private final List<CssError> cssErrors = new ArrayList<>();
+    private final List<CssParser.ParseError> parseErrors = new ArrayList<>();
     
     public CSSParsingReport(Path stylesheetPath) {
         assert stylesheetPath != null;
         
         this.stylesheetPath = stylesheetPath;
-        final Set<CssError> previousErrors = new HashSet<>(StyleManager.errorsProperty());
+        final Set<CssParser.ParseError> previousErrors = new HashSet<>(CssParser.errorsProperty());
         try {
-            new CSSParser().parse(stylesheetPath.toUri().toURL());
+            new CssParser().parse(stylesheetPath.toUri().toURL());
             // Leave this.ioException to null
-            cssErrors.addAll(StyleManager.errorsProperty());
-            cssErrors.removeAll(previousErrors);
+            parseErrors.addAll(CssParser.errorsProperty());
+            parseErrors.removeAll(previousErrors);
         } catch(IOException x) {
             this.ioException = x;
         } finally {
-            StyleManager.errorsProperty().removeAll(cssErrors);
+            CssParser.errorsProperty().removeAll(parseErrors);
         }
     }
 
     public Path getStylesheetPath() {
         return stylesheetPath;
     }
     
     public boolean isEmpty() {
-        return (ioException == null) && cssErrors.isEmpty();
+        return (ioException == null) && parseErrors.isEmpty();
     }
     
     public IOException getIOException() {
         return ioException;
     }
     
-    public List<CssError> getCssErrors() {
-        return Collections.unmodifiableList(cssErrors);
+    public List<CssParser.ParseError> getParseErrors() {
+        return Collections.unmodifiableList(parseErrors);
     }
 }