This code is used in several places:
final String alignmentProperty = ALIGNMENT.getProperty();
for (int n=0, nMax=styleables.size(); n<nMax; n++) {
final CssMetaData<?,?> prop = styleables.get(n);
if (alignmentProperty.equals(prop.getProperty())) styleables.remove(prop);
}
What it does is replace the styleable property of an inherited class with the styleable property of this class. In this particular example, StackPane's has a styleable alignment property but we want the ToolBarSkin's alignment property instead. So the StackPane's alignment property is removed before the ToolBarSkin's is added.
The TODO comment in the code wants StackPane.StyleableProperties.ALIGNMENT to be public so that the code could just be
styleables.remove(StackPane.StyleableProperties.ALIGNMENT)
But there are certainly other ways to handle this which would make the code cleaner and easier to maintain.
final String alignmentProperty = ALIGNMENT.getProperty();
for (int n=0, nMax=styleables.size(); n<nMax; n++) {
final CssMetaData<?,?> prop = styleables.get(n);
if (alignmentProperty.equals(prop.getProperty())) styleables.remove(prop);
}
What it does is replace the styleable property of an inherited class with the styleable property of this class. In this particular example, StackPane's has a styleable alignment property but we want the ToolBarSkin's alignment property instead. So the StackPane's alignment property is removed before the ToolBarSkin's is added.
The TODO comment in the code wants StackPane.StyleableProperties.ALIGNMENT to be public so that the code could just be
styleables.remove(StackPane.StyleableProperties.ALIGNMENT)
But there are certainly other ways to handle this which would make the code cleaner and easier to maintain.
- is blocked by
-
JDK-8091202 CSS Style Object Model in Java
-
- Open
-