--- old/modules/controls/src/main/java/javafx/scene/control/PopupControl.java 2016-06-03 11:04:05.025423577 -0700 +++ new/modules/controls/src/main/java/javafx/scene/control/PopupControl.java 2016-06-03 11:04:04.869423578 -0700 @@ -49,11 +49,15 @@ import javafx.css.CssMetaData; import javafx.css.PseudoClass; import com.sun.javafx.css.StyleManager; +import com.sun.javafx.scene.NodeHelper; +import com.sun.javafx.scene.ParentHelper; import javafx.css.Styleable; import javafx.css.StyleableStringProperty; import javafx.css.converter.StringConverter; import com.sun.javafx.scene.control.Logging; +import com.sun.javafx.scene.layout.PaneHelper; import com.sun.javafx.stage.PopupWindowHelper; +import com.sun.javafx.util.Utils; import javafx.css.StyleableProperty; import javafx.stage.Window; import sun.util.logging.PlatformLogger; @@ -270,12 +274,12 @@ bridge.getChildren().clear(); } - // calling impl_reapplyCSS() as the styleable properties may now + // calling NodeHelper.reapplyCSS() as the styleable properties may now // be different, as we will now be able to return styleable properties - // belonging to the skin. If impl_reapplyCSS() is not called, the + // belonging to the skin. If NodeHelper.reapplyCSS() is not called, the // getCssMetaData() method is never called, so the // skin properties are never exposed. - bridge.impl_reapplyCSS(); + NodeHelper.reapplyCSS(bridge); // DEBUG: Log that we've changed the skin final PlatformLogger logger = Logging.getControlsLogger(); @@ -1108,6 +1112,11 @@ private final PopupControl popupControl = PopupControl.this; + { + // To initialize the class helper at the begining each constructor of this class + CSSBridgeHelper.initHelper(this); + } + /** * Requests a layout pass to be performed before the next scene is * rendered. This is batched up asynchronously to happen once per @@ -1136,45 +1145,31 @@ return PopupControl.this.getStyleableParent(); } - /** - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version - */ - @Deprecated - protected void setSkinClassName(String skinClassName) { /* no-op - retain for binary compatibility */ } - @Override public List> getCssMetaData() { return PopupControl.this.getCssMetaData(); } - /** - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version - */ - @Deprecated - @Override public List impl_getAllParentStylesheets() { + List getAllParentStylesheets() { Styleable styleable = getStyleableParent(); if (styleable instanceof Parent) { - return ((Parent)styleable).impl_getAllParentStylesheets(); + return ParentHelper.getAllParentStylesheets((Parent)styleable); } return null; } - /** - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version + /* + * Note: This method MUST only be called via its accessor method. */ - @Deprecated - @Override protected void impl_processCSS() { - super.impl_processCSS(); + private void doProcessCSS() { + CSSBridgeHelper.superProcessCSS(this); if (getSkin() == null) { // try to create default skin final Skin defaultSkin = createDefaultSkin(); if (defaultSkin != null) { skinProperty().set(defaultSkin); - super.impl_processCSS(); + CSSBridgeHelper.superProcessCSS(this); } else { final String msg = "The -fx-skin property has not been defined in CSS for " + this + " and createDefaultSkin() returned null."; @@ -1189,5 +1184,37 @@ } } + + /* + * Used to access internal methods of CSSBridge. + */ + static final class CSSBridgeHelper extends PaneHelper { + private static final CSSBridgeHelper theInstance; + + static { + theInstance = new CSSBridgeHelper(); + } + + private static CSSBridgeHelper getInstance() { + return theInstance; + } + + public static void initHelper(CSSBridge cssBridge) { + setHelper(cssBridge, getInstance()); + } + + public static void superProcessCSS(Node node) { + ((CSSBridgeHelper) getHelper(node)).superProcessCSSImpl(node); + } + + void superProcessCSSImpl(Node node) { + super.processCSSImpl(node); + } + + protected void processCSSImpl(Node node) { + ((CSSBridge) node).doProcessCSS(); + } + + } }