Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove deprecated API from JavaFX 23 #730

Merged
merged 2 commits into from
Sep 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,16 @@
import com.oracle.javafx.scenebuilder.kit.editor.EditorPlatform.Theme;
import com.oracle.javafx.scenebuilder.kit.fxom.FXOMInstance;
import com.oracle.javafx.scenebuilder.kit.metadata.property.ValuePropertyMetadata;
import javafx.css.CompoundSelector;
import javafx.css.Rule;
import javafx.css.Selector;
import javafx.css.SimpleSelector;
import javafx.css.Style;
import javafx.css.Stylesheet;
import javafx.css.CssParser;

/**
*
* Utility classes using css internal classes (from com.sun package). Note that
* the CSS Analyzer is also using extensively com.sun classes.
* Utility classes to extract CSS information.
* Note: Requires JavaFX 23+
*
*/
public class CssInternal {
Oliver-Loeffler marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -247,25 +245,12 @@ private static Set<String> getStyleClasses(final URL url) {
return styleClasses;
}
if (s == null) {
// The parsed CSS file was empty. No parsing occured.
// The parsed CSS file was empty. No parsing occurred.
return styleClasses;
}
for (Rule r : s.getRules()) {
for (Selector ss : r.getSelectors()) {
if (ss instanceof SimpleSelector) {
SimpleSelector simple = (SimpleSelector) ss;
styleClasses.addAll(simple.getStyleClasses());
} else {
if (ss instanceof CompoundSelector) {
CompoundSelector cs = (CompoundSelector) ss;
for (Selector selector : cs.getSelectors()) {
if (selector instanceof SimpleSelector) {
SimpleSelector simple = (SimpleSelector) selector;
styleClasses.addAll(simple.getStyleClasses());
}
}
}
}
styleClasses.addAll(ss.getStyleClassNames());
}
}
return styleClasses;
Expand Down