/*
* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javafx.scene.control;
import javafx.collections.MapChangeListener;
import javafx.css.PseudoClass;
import javafx.beans.property.*;
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.event.EventType;
import javafx.scene.AccessibleAction;
import javafx.scene.AccessibleAttribute;
/**
* Abstract base class for ComboBox-like controls. A ComboBox typically has
* a button that, when clicked, will pop up some means of allowing a user
* to select one or more values (depending on the implementation). This base
* class makes no assumptions about what happens when the {@link #show()} and
* {@link #hide()} methods are called, however commonly this results in either
* a popup or dialog appearing that allows for the user to provide the
* required information.
*
*
A ComboBox has a {@link #valueProperty() value} property that represents
* the current user input. This may be based on a selection from a drop-down list,
* or it may be from user input when the ComboBox is
* {@link #editableProperty() editable}.
*
*
An {@link #editableProperty() editable} ComboBox is one which provides some
* means for an end-user to provide input for values that are not otherwise
* options available to them. For example, in the {@link ComboBox} implementation,
* an editable ComboBox provides a {@link TextField} that may be typed into.
* As mentioned above, when the user commits textual input into the textfield
* (commonly by pressing the Enter keyboard key), the
* {@link #valueProperty() value} property will be updated.
*
*
The purpose of the separation between this class and, say, {@link ComboBox}
* is to allow for ComboBox-like controls that do not necessarily pop up a list
* of items. Examples of other implementations include color pickers, calendar
* pickers, etc. The {@link ComboBox} class provides the default, and most commonly
* expected implementation. Refer to that classes javadoc for more information.
*
* @see ComboBox
* @param The type of the value that has been selected or otherwise
* entered in to this ComboBox.
* @since JavaFX 2.1
*/
public abstract class ComboBoxBase extends Control {
/***************************************************************************
* *
* Static properties and methods *
* *
**************************************************************************/
/**
*
Called prior to the ComboBox showing its popup/display after the user
* has clicked or otherwise interacted with the ComboBox.
* @since JavaFX 2.2
*/
public static final EventType ON_SHOWING =
new EventType(Event.ANY, "COMBO_BOX_BASE_ON_SHOWING");
/**
*
Called after the ComboBox has shown its popup/display.
* @since JavaFX 2.2
*/
public static final EventType ON_SHOWN =
new EventType(Event.ANY, "COMBO_BOX_BASE_ON_SHOWN");
/**
*
Called when the ComboBox popup/display will be hidden.
* @since JavaFX 2.2
*/
public static final EventType ON_HIDING =
new EventType(Event.ANY, "COMBO_BOX_BASE_ON_HIDING");
/**
*
Called when the ComboBox popup/display has been hidden.
* @since JavaFX 2.2
*/
public static final EventType ON_HIDDEN =
new EventType(Event.ANY, "COMBO_BOX_BASE_ON_HIDDEN");
/***************************************************************************
* *
* Constructors *
* *
**************************************************************************/
/**
* Creates a default ComboBoxBase instance.
*/
public ComboBoxBase() {
getStyleClass().add(DEFAULT_STYLE_CLASS);
// Fix for RT-29885
getProperties().addListener((MapChangeListener