Package com.dassault_systemes.catjdialog

   
Class CATComboBox

 
Class Hierarchy
java.lang.Object
  |
  +-com.dassault_systemes.catjdialog.CATCallbackSource
        |
        +-com.dassault_systemes.catjdialog.CATDialog
              |
              +-com.dassault_systemes.catjdialog.CATLeafElement
                    |
                    +-com.dassault_systemes.catjdialog.CATComboBox
Class Location

Framework : CATJDialog

Module : CATJDialog

Class Description

public class CATComboBox

The combo-box graphical component.

Description:

This component presents a drop-down list of selectable items. It may be editable (the user can type in text) or not (the user can only select proposed items from the list). The application can be notified when its selected item changes.

CATComboBox Properties:

CATComboBox Notifications:

Field Summary

Constructor Summary
CATComboBox(CATDialog iDialog, String iName)

Method Summary
CATNotification getComboActivatedNotification()
void setItemTranslator(CATITranslator iTranslator)
CATITranslator getItemTranslator()
boolean getEnable()
void setEnable(boolean iEnable)
boolean getEditable()
void setEditable(boolean iEditable)
String getSelection()
int getSelectionIndex()
String[] getItemList()
void setItemList(String[] iItems)
Enumeration getItems()
int getItemCount()
void setItems(Enumeration iEnum)
void setItems(String[] itemsTab)
String getItem(int index)
void addItem(String item)
void insertItem(String item, int index)
void removeItem(String item)
void removeItem(int index)
void setSelection(String iSelection)
void setSelection(int index)


Field Detail

Constructor Detail

CATComboBox

    CATComboBox(CATDialog iDialog, String iName)

Creates a combo-box with the specified parent and name.

Parameters:
iParent
The parent component.
iName
This combo-box name. Here are some rules for this name:
  • It is set in the constructor, and cannot be changed afterwards.
  • The name must be unique for the parent (2 children with the same name are not allowed).
  • The name may not contain any ot the following characters: '.' (dot), ' ' (blank), '_' (underscore)

Method Detail

getComboActivatedNotification

    CATNotification getComboActivatedNotification()

The combo-box activated notification.

This notification is sent when the combo-box selection is changed.

Returns:
The combo-box activated notification.

setItemTranslator

    void setItemTranslator(CATITranslator iTranslator)

Sets an item translator for this combo-box.

When a combo-box has such a translator, items are considered as internal tags, that are translated before being displayed to the user.

Note: editable combo-boxes do not support item translators!

Parameters:
iTranslator
The item translator object (null unsets translation).

getItemTranslator

    CATITranslator getItemTranslator()

Returns the item translator.

Returns:
The item translator object (null if none).

getEnable

    boolean getEnable()

Determines whether this combo-box is enabled or not.

Returns:
true if this combo-box is enabled; false otherwise.

setEnable

    void setEnable(boolean iEnable)

Enables or disables this combo-box.

A disabled combo-box selection can't be changed by the user and doesn't fire its ComboActivated notification.

Parameters:
iEnable
If true, this checkbox is enabled; otherwise it is disabled.

getEditable

    boolean getEditable()

Determines whether this combo-box is editable or not. Default is not editable.

Returns:
true if this combo-box is enabled; false otherwise.

setEditable

    void setEditable(boolean iEditable)

Enables/disables editing in the combo-box (default is disabled).

An editable combo-box allows the user to type in its own textual values, and select items for the drop-down list. An editable combo-box does not send any ComboActivated notification. It should be associated with a button to notify that the user is done with filling its value.

Parameters:
iEnable
If true, editing in this combo-box is enabled; otherwise it is disabled.

getSelection

    String getSelection()

Returns the current combo-box selection.

Returns:
The current selected item's name.

getSelectionIndex

    int getSelectionIndex()

Returns the current combo-box selection index (in the drop-down list).

Note: this method might return an irrelevant value in the case of an editable combo-box.

Returns:
The current selected item's index.

getItemList

    String[] getItemList()

Returns the list of combo-box items as a string array.

Returns:
A String array containing the current drop-down items.

setItemList

    void setItemList(String[] iItems)

Sets the list of combo-box items as a string array.

Parameters:
iItems
A String array to replace the current drop-down items.

getItems

    Enumeration getItems()

Returns the list of combo-box items as a string enumeration.

Returns:
A String Enumeration containing the current drop-down items.

getItemCount

    int getItemCount()

Returns the number of combo-box items.

Returns:
The number of combo-box items.

setItems

    void setItems(Enumeration iEnum)

Sets the list of combo-box items as a string enumeration.

Parameters:
iEnum
A String Enumeration to replace the current drop-down items.

setItems

    void setItems(String[] itemsTab)

Sets the list of combo-box items as a string array.

Parameters:
iItems
A String array to replace the current drop-down items.

getItem

    String getItem(int index)

Returns the item at specified index.

Parameters:
The
item index to retreive.
Returns:
The item name.

addItem

    void addItem(String item)

Appends an item to the drop-down list.

Parameters:
item
The item name to append to the drop-down list.

insertItem

    void insertItem(String item, int index)

Inserts an item in the list.

Parameters:
item
The item name to insert to the drop-down list.
index
The position at which the item should be inserted.

removeItem

    void removeItem(String item)

Removes an item from the list.

Parameters:
item
The item name to remove from the drop-down list.

removeItem

    void removeItem(int index)

Removes an item from the list.

Parameters:
index
The index of the item to remove from the drop-down list.

setSelection

    void setSelection(String iSelection)

Sets the current combo-box selection.

Parameters:
item
The item name from the drop-down list to select in the combo-box.

setSelection

    void setSelection(int index)

Sets the current combo-box selection from the given item index.

Parameters:
index
The index of the item from the drop-down list to select in the combo-box.


Copyright © 2000, Dassault Systèmes. All rights reserved