Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8091601

[CSS] TODO: Really should be able to reference StackPane.StyleableProperties.ALIGNMENT

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 8u40
    • javafx

      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.

            Unassigned Unassigned
            dgrieve David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported: