# HG changeset patch # User Stuart W Marks # Date 1267837083 28800 # Node ID 83e4f0eeeccfbb545a63fc288510e5ef7860d3e2 # Parent 781dbd27e322bde7ce5274d8ed63ed716f35866a RT-3705: add Parent.containsFocus diff -r 781dbd27e322 -r 83e4f0eeeccf javafx-ui-common/src/javafx/scene/Node.fx --- a/javafx-ui-common/src/javafx/scene/Node.fx Fri Mar 05 16:41:30 2010 -0800 +++ b/javafx-ui-common/src/javafx/scene/Node.fx Fri Mar 05 16:58:03 2010 -0800 @@ -2770,7 +2770,10 @@ * @profile common * @defaultvalue false */ - public-read protected var focused:Boolean = false on invalidate { + public-read protected var focused:Boolean = false on replace { + if (parent != null) { + parent.impl_setContainsFocus(focused); + } impl_pseudoClassStateChanged("focused"); } diff -r 781dbd27e322 -r 83e4f0eeeccf javafx-ui-common/src/javafx/scene/Parent.fx --- a/javafx-ui-common/src/javafx/scene/Parent.fx Fri Mar 05 16:41:30 2010 -0800 +++ b/javafx-ui-common/src/javafx/scene/Parent.fx Fri Mar 05 16:58:03 2010 -0800 @@ -540,6 +540,27 @@ /** @treatasprivate */ public function impl_getChildren():Node[] { children } + /*********************************************************************** + * * + * Focus and Traversal * + * * + **********************************************************************/ + + var containsFocus:Boolean = false; + + /** @treatasprivate implementation detail */ + public function impl_setContainsFocus(cf:Boolean):Void { + containsFocus = cf; + if (parent != null) { + parent.impl_setContainsFocus(cf); + } + } + + /** @treatasprivate implementation detail */ + public function impl_getContainsFocus():Boolean { + containsFocus + } + // define focus traversal order // keep it package private for now package function getFirstChild(): Node {