Class IlxWComboBox

  • All Implemented Interfaces:
    IlxWConstants, IlxWCSSModelProvider, IlxWDependencyProvider, IlxWJSObject, ActionListener, ItemSelectable, Serializable, EventListener, ListDataListener

    @Deprecated
    public class IlxWComboBox
    extends IlxWComponent
    implements ListDataListener, ItemSelectable, ActionListener
    Deprecated.
    A combo box component.

    The combo box component relies on a model, instance of javax.swing.ComboBoxModel. It may be rendered in several modes, determined by the value of the "mode" CSS style. Possible values for the mode style are:

    • system: renders the combo box as a <select> HTML element. This mode is not supported if the combo box has a renderer or an editor. In this case, the component tries to render itself in the "arrow" mode.
    • link: renders the combo box as a hyperlink which, once clicked pops up a menu just under the link. If the combo box has an editor, this mode is not supported, and the component tries to render itself in "arrow" mode. The combo box may also not support this mode with some Web browsers (Netscape 3 & Netscape 4.7 for instance). In this case, the component tries render itself in the "linkdialog" mode.
    • arrow: renders the combo box as Swing combo box: the current renderer or the current editor is displayed, and an arrow button is displayed to the right. A click on the arrow button pops up a menu with the possible items. The combo box may not support this mode with some Web browsers (Netscape 3 & Netscape 4.7 for instance). In this case, the component tries render itself in the "arrowdialog" mode.
    • linkdialog: Same as the link mode but a dialog box is popped up displaying the available items, instead of a drop down list.
    • arrowdialog: Same as the arrow mode but a dialog box is popped up displaying the available items, instead of a drop down list.
    If no mode is set, the component always first tries to render in system mode. To set the current mode, you can either write a CSS style sheet:
     ComboBox
     {
       mode: arrow;
     }
     
    ... or dynamically set the style on the object:
     myComboBox.getStyle().set("mode", "arrow");
     
    See Also:
    Serialized Form
    • Constructor Detail

      • IlxWComboBox

        public IlxWComboBox​(ComboBoxModel aModel)
        Deprecated.
        Creates an IlxWComboBox that takes its items from an existing ComboBoxModel.
        Parameters:
        aModel - The ComboBoxModel that provides the displayed list of items.
      • IlxWComboBox

        public IlxWComboBox​(Object[] items)
        Deprecated.
        Creates an IlxWComboBox that contains the elements in the specified array.
      • IlxWComboBox

        public IlxWComboBox​(Vector items)
        Deprecated.
        Creates an IlxWComboBox that contains the elements in the specified Vector.
      • IlxWComboBox

        public IlxWComboBox()
        Deprecated.
        Creates an IlxWComboBox with a default data model. Use addItem to add items.
    • Method Detail

      • setModel

        public void setModel​(ComboBoxModel model)
        Deprecated.
        Sets the data model that the IlxWComboBox uses to obtain the list of items.
        Parameters:
        model - The combo box model that provides the displayed list of items.
      • getModel

        public ComboBoxModel getModel()
        Deprecated.
        Returns the data model currently used by the IlxWComboBox.
        Returns:
        The combo box model that provides the displayed list of items.
      • setEditable

        public void setEditable​(boolean aFlag)
        Deprecated.
        Determines whether the IlxWComboBox field is editable.

        An editable IlxWComboBox allows the user to type into the field or select an item from the list to initialize the field, after which it can be edited.

        A non editable IlxWComboBox displays the selected item in the field, but the selection cannot be modified.

        Parameters:
        aFlag - A boolean value, where true indicates that the field is editable.
      • isEditable

        public boolean isEditable()
        Deprecated.
        Returns True if the IlxWComboBox is editable.
        Returns:
        true if the combo box can be edited; false otherwise.
      • setRenderer

        public void setRenderer​(IlxWListCellRenderer renderer)
        Deprecated.
        Sets the renderer that paints the item selected from the list in the IlxWComboBox field.

        The renderer is used if the IlxWComboBox is not editable, otherwise the editor is used to render and edit the selected item.

        The default renderer displays a string, obtained by calling the selected object's toString method. Other renderers can handle graphic images and composite items.

        To display the selected item, aRenderer.getListCellRendererComponent is called, passing the list object and an index of -1.

        Parameters:
        renderer - The ListCellRenderer that displays the selected item.
        See Also:
        setEditor(ilog.webui.dhtml.components.IlxWComboBoxEditor)
      • getRenderer

        public IlxWListCellRenderer getRenderer()
        Deprecated.
        Returns the renderer used to display the selected item in the IlxWComboBox field.
        Returns:
        The list cell renderer that displays the selected item.
      • setEditor

        public void setEditor​(IlxWComboBoxEditor editor)
        Deprecated.
        Sets the editor used to paint and edit the selected item in the IlxWComboBox field.

        The editor is used only if the receiving IlxWComboBox is editable. If not editable, the combo box uses the renderer to render the selected item.

        Parameters:
        editor - The IlxWComboBoxEditor that displays the selected item.
        See Also:
        setRenderer(ilog.webui.dhtml.components.IlxWListCellRenderer)
      • getEditor

        public IlxWComboBoxEditor getEditor()
        Deprecated.
        Returns the editor used to render and edit the selected item in the IlxWComboBox field.
        Returns:
        The combo box editor that displays the selected item.
      • configureEditor

        public void configureEditor​(IlxWComboBoxEditor anEditor,
                                    Object anItem)
        Deprecated.
        Initializes the editor with the specified item.
        Parameters:
        anEditor - The IlxWComboBoxEditor that displays the list item in the combo box field and allows it to be edited.
        anItem - The object to display and edit in the field.
      • setSelectedItem

        public void setSelectedItem​(Object anObject)
        Deprecated.
        Sets the selected item in the IlxWComboBox by specifying the object in the list.

        If anObject is in the list, the list displays with anObject selected. If the object does not exist in the list, the default data model selects the first item in the list.

        Parameters:
        anObject - The list object to select.
      • getSelectedItem

        public Object getSelectedItem()
        Deprecated.
        Returns the currently selected item.
        Returns:
        The currently selected object in the data model.
      • setSelectedIndex

        public void setSelectedIndex​(int index)
        Deprecated.
        Selects the item at index anIndex.
        Parameters:
        index - An int specifying the list item to select, where 0 specifies the first item in the list.
      • getSelectedIndex

        public int getSelectedIndex()
        Deprecated.
        Returns the index of the currently selected item in the list.

        The result is not always defined if the IlxWComboBox box allows selected items that are not in the list. Returns -1 if there is no selected item or if the user specified an item which is not in the list.

        Returns:
        An int specifying the list item that is currently selected 0 specifies the first item in the list, -1 indicates that no item is selected or that the currently selected item is not in the list.
      • addItemListener

        public void addItemListener​(ItemListener listener)
        Deprecated.
        Adds an item listener.

        aListener will receive an event when the selected item changes.

        Specified by:
        addItemListener in interface ItemSelectable
        Parameters:
        listener - The item listener that is to be notified.
      • removeItemListener

        public void removeItemListener​(ItemListener listener)
        Deprecated.
        Removes an item listener.
        Specified by:
        removeItemListener in interface ItemSelectable
        Parameters:
        listener - The item listener to remove.
      • addActionListener

        public void addActionListener​(ActionListener l)
        Deprecated.
        Adds an action listener.

        The listener will receive an action event the user finishes making a selection.

        Parameters:
        l - The action listener that is to be notified.
      • removeActionListener

        public void removeActionListener​(ActionListener l)
        Deprecated.
        Removes an action listener.
        Parameters:
        l - The action listener to remove.
      • setActionCommand

        public void setActionCommand​(String aCommand)
        Deprecated.
        Sets the action command that should be included in the event sent to action listeners.
        Parameters:
        aCommand - A string containing the "command" that is sent to action listeners. The same listener can then do different things depending on the command it receives.
      • getActionCommand

        public String getActionCommand()
        Deprecated.
        Returns the action command that is included in the event sent to action listeners.
        Returns:
        the string containing the command that is sent to action listeners. This command is an arbitrary character string.
      • fireItemStateChanged

        protected void fireItemStateChanged​(ItemEvent e)
        Deprecated.
        Notify all listeners that have registered interest for notification on this event type.
        See Also:
        EventListenerList
      • getItemListeners

        public ItemListener[] getItemListeners()
        Deprecated.
      • fireActionEvent

        protected void fireActionEvent()
        Deprecated.
        Notify all listeners that have registered interest for notification on this event type.
      • getActionListeners

        public ActionListener[] getActionListeners()
        Deprecated.
      • selectedItemChanged

        protected void selectedItemChanged()
        Deprecated.
        This method is called when the selected item changes.

        Its default implementation notifies the item listeners.

      • getSelectedObjects

        public Object[] getSelectedObjects()
        Deprecated.
        Returns an array containing the selected item.
        Specified by:
        getSelectedObjects in interface ItemSelectable
        Returns:
        An array of objects containing one element -- the selected item.
      • setEnabled

        public void setEnabled​(boolean b)
        Deprecated.
        Enables the combo box so that items can be selected.

        When the combo box is disabled, items cannot be selected and values cannot be typed into its field (if it is editable).

        Parameters:
        b - A boolean value, where true enables the component and false disables it.
      • isEnabled

        public boolean isEnabled()
        Deprecated.
        Determines whether this component is enabled.
        Returns:
        true if this component is enabled.
        See Also:
        setEnabled(boolean)
      • getItemCount

        public int getItemCount()
        Deprecated.
        Returns the number of items in the list.
        Returns:
        an int equal to the number of items in the list.
      • getItemAt

        public Object getItemAt​(int index)
        Deprecated.
        Returns the list item at the specified index.
        Parameters:
        index - An int indicating the list position, where the first item starts at zero.
        Returns:
        the Object at that list position.
      • getAction

        public IlxWAction getAction()
        Deprecated.
        Gets the action that will be called when the user selects an item in the combo box.

        By default, this action is a Java action (IlxWJavaAction) of which the perform method calls setSelectedItem on the combo box.

        If the given action is a Java action (IlxWJavaAction), the argument array passed to the perform method is a 1-length array containing the selected item. If the given action is a JS action (IlxWJSAction), the argument array passed when calling the associated function is a 1-length array containing the string representation of the selected item.

        Returns:
        the action to perform when the user selects an item.
        See Also:
        setAction(ilog.webui.dhtml.components.IlxWAction)
      • setAction

        public void setAction​(IlxWAction action)
        Deprecated.
        Sets the action that will be called when the user selects an item in the combo box.
        Parameters:
        action - The action to perform when the user selects an item from the list.
        See Also:
        getAction()
      • setOnChangeJSAction

        public void setOnChangeJSAction​(String onChangeAction)
        Deprecated.
      • getOnChangeJSAction

        public String getOnChangeJSAction()
        Deprecated.
      • update

        public void update​(Element elt)
        Deprecated.