< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/control/skin/ComboBoxPopupControl.java

Print this page




 195 
 196             @Override public Node selectLast(TraversalContext context) {
 197                 return null;
 198             }
 199         }));
 200 
 201         updateEditable();
 202     }
 203 
 204 
 205 
 206     /***************************************************************************
 207      *                                                                         *
 208      * Public API                                                              *
 209      *                                                                         *
 210      **************************************************************************/
 211 
 212     /**
 213      * This method should return the Node that will be displayed when the user
 214      * clicks on the ComboBox 'button' area.


 215      */
 216     protected abstract Node getPopupContent();
 217 
 218     /**
 219      * Subclasses are responsible for getting the editor. This will be removed
 220      * in FX 9 when the editor property is moved up to ComboBoxBase with
 221      * JDK-8130354
 222      *
 223      * Note: ComboBoxListViewSkin should return null if editable is false, even
 224      * if the ComboBox does have an editor set.

 225      */
 226     protected abstract TextField getEditor();
 227 
 228     /**
 229      * Subclasses are responsible for getting the converter. This will be
 230      * removed in FX 9 when the converter property is moved up to ComboBoxBase
 231      * with JDK-8130354.

 232      */
 233     protected abstract StringConverter<T> getConverter();
 234 
 235     /** {@inheritDoc} */
 236     @Override public void show() {
 237         if (getSkinnable() == null) {
 238             throw new IllegalStateException("ComboBox is null");
 239         }
 240 
 241         Node content = getPopupContent();
 242         if (content == null) {
 243             throw new IllegalStateException("Popup node is null");
 244         }
 245 
 246         if (getPopup().isShowing()) return;
 247 
 248         positionAndShowPopup();
 249     }
 250 
 251     /** {@inheritDoc} */




 195 
 196             @Override public Node selectLast(TraversalContext context) {
 197                 return null;
 198             }
 199         }));
 200 
 201         updateEditable();
 202     }
 203 
 204 
 205 
 206     /***************************************************************************
 207      *                                                                         *
 208      * Public API                                                              *
 209      *                                                                         *
 210      **************************************************************************/
 211 
 212     /**
 213      * This method should return the Node that will be displayed when the user
 214      * clicks on the ComboBox 'button' area.
 215      * @return the Node that will be displayed when the user clicks on the
 216      * ComboBox 'button' area
 217      */
 218     protected abstract Node getPopupContent();
 219 
 220     /**
 221      * Subclasses are responsible for getting the editor. This will be removed
 222      * in FX 9 when the editor property is moved up to ComboBoxBase with
 223      * JDK-8130354
 224      *
 225      * Note: ComboBoxListViewSkin should return null if editable is false, even
 226      * if the ComboBox does have an editor set.
 227      * @return the editor
 228      */
 229     protected abstract TextField getEditor();
 230 
 231     /**
 232      * Subclasses are responsible for getting the converter. This will be
 233      * removed in FX 9 when the converter property is moved up to ComboBoxBase
 234      * with JDK-8130354.
 235      * @return the string converter
 236      */
 237     protected abstract StringConverter<T> getConverter();
 238 
 239     /** {@inheritDoc} */
 240     @Override public void show() {
 241         if (getSkinnable() == null) {
 242             throw new IllegalStateException("ComboBox is null");
 243         }
 244 
 245         Node content = getPopupContent();
 246         if (content == null) {
 247             throw new IllegalStateException("Popup node is null");
 248         }
 249 
 250         if (getPopup().isShowing()) return;
 251 
 252         positionAndShowPopup();
 253     }
 254 
 255     /** {@inheritDoc} */


< prev index next >