apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TabPaneDesignInfoX.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization


  15  *    the documentation and/or other materials provided with the distribution.
  16  *  - Neither the name of Oracle Corporation nor the names of its
  17  *    contributors may be used to endorse or promote products derived
  18  *    from this software without specific prior written permission.
  19  *
  20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31  */
  32 package com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver;
  33 
  34 import com.oracle.javafx.scenebuilder.kit.util.Deprecation;
  35 import com.sun.javafx.scene.control.skin.TabPaneSkin;
  36 import java.util.Iterator;
  37 import java.util.Set;
  38 import javafx.geometry.BoundingBox;
  39 import javafx.geometry.Bounds;
  40 import javafx.geometry.Point2D;
  41 import javafx.scene.Node;
  42 import javafx.scene.control.Tab;
  43 import javafx.scene.control.TabPane;
  44 
  45 /**
  46  * @treatAsPrivate
  47  * A temporary class that should extend TabDesignInfo and adds
  48  * some additional verbs for managing TabPane at design time.
  49  * This could potentially move to TabDesignInfo some day.
  50  *
  51  */
  52 public class TabPaneDesignInfoX /* extends TabDesignInfo */ {
  53 
  54 
  55     /**


  73             Node n = it.next();
  74             if (n.getProperties().get(Tab.class) == tab) {
  75                 result = n;
  76             }
  77         }
  78 
  79         return result;
  80     }
  81     
  82     /**
  83      * Returns the node representing the content area in the TabPane skin.
  84      * @param tabPane
  85      * @param tab
  86      * @return 
  87      */
  88     public Node getContentNode(TabPane tabPane) {
  89         assert tabPane != null;
  90         
  91         final Node result;
  92        
  93         if (tabPane.getSkin() != null) {
  94             assert tabPane.getSkin() instanceof TabPaneSkin;
  95             final TabPaneSkin tabPaneSkin = (TabPaneSkin) tabPane.getSkin();
  96             result = tabPaneSkin.getSelectedTabContentRegion();







  97         } else {
  98             result = null;
  99         }
 100 
 101         return result;
 102     }
 103     
 104     
 105     /**
 106      * Returns the node representing the pulldown menu in the TabPane skin.
 107      */
 108     public Node getControlMenuNode(TabPane tabPane) {
 109         assert tabPane != null;
 110         
 111         // Looks for the sub node which matches the '.control-buttons-tab' selector
 112         return tabPane.lookup(".control-buttons-tab"); //NOI18N
 113     }
 114     
 115     
 116     /**




  15  *    the documentation and/or other materials provided with the distribution.
  16  *  - Neither the name of Oracle Corporation nor the names of its
  17  *    contributors may be used to endorse or promote products derived
  18  *    from this software without specific prior written permission.
  19  *
  20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31  */
  32 package com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver;
  33 
  34 import com.oracle.javafx.scenebuilder.kit.util.Deprecation;
  35 import javafx.scene.control.skin.TabPaneSkin;
  36 import java.util.Iterator;
  37 import java.util.Set;
  38 import javafx.geometry.BoundingBox;
  39 import javafx.geometry.Bounds;
  40 import javafx.geometry.Point2D;
  41 import javafx.scene.Node;
  42 import javafx.scene.control.Tab;
  43 import javafx.scene.control.TabPane;
  44 
  45 /**
  46  * @treatAsPrivate
  47  * A temporary class that should extend TabDesignInfo and adds
  48  * some additional verbs for managing TabPane at design time.
  49  * This could potentially move to TabDesignInfo some day.
  50  *
  51  */
  52 public class TabPaneDesignInfoX /* extends TabDesignInfo */ {
  53 
  54 
  55     /**


  73             Node n = it.next();
  74             if (n.getProperties().get(Tab.class) == tab) {
  75                 result = n;
  76             }
  77         }
  78 
  79         return result;
  80     }
  81     
  82     /**
  83      * Returns the node representing the content area in the TabPane skin.
  84      * @param tabPane
  85      * @param tab
  86      * @return 
  87      */
  88     public Node getContentNode(TabPane tabPane) {
  89         assert tabPane != null;
  90 
  91         final Node result;
  92        
  93 //        if (tabPane.getSkin() != null) {
  94 //            assert tabPane.getSkin() instanceof TabPaneSkin;
  95 //            final TabPaneSkin tabPaneSkin = (TabPaneSkin) tabPane.getSkin();
  96 //            result = tabPaneSkin.getSelectedTabContentRegion();
  97 //        } else {
  98 //            result = null;
  99 //        }
 100 
 101         Tab selectedTab = tabPane.getSelectionModel().getSelectedItem();
 102         if (selectedTab != null) {
 103             result = selectedTab.getContent();
 104         } else {
 105             result = null;
 106         }
 107 
 108         return result;
 109     }
 110     
 111     
 112     /**
 113      * Returns the node representing the pulldown menu in the TabPane skin.
 114      */
 115     public Node getControlMenuNode(TabPane tabPane) {
 116         assert tabPane != null;
 117         
 118         // Looks for the sub node which matches the '.control-buttons-tab' selector
 119         return tabPane.lookup(".control-buttons-tab"); //NOI18N
 120     }
 121     
 122     
 123     /**