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)
Creates a combo-box with the specified parent and name.

Method Summary
public void addItem(String item)
Appends an item to the drop-down list.
public CATNotification getComboActivatedNotification()
The combo-box activated notification.
public boolean getEditable()
Determines whether this combo-box is editable or not.
public boolean getEnable()
Determines whether this combo-box is enabled or not.
public String getItem(int index)
Returns the item at specified index.
public int getItemCount()
Returns the number of combo-box items.
public String[] getItemList()
Returns the list of combo-box items as a string array.
public Enumeration getItems()
Returns the list of combo-box items as a string enumeration.
public CATITranslator getItemTranslator()
Returns the item translator.
public String getSelection()
Returns the current combo-box selection.
public int getSelectionIndex()
Returns the current combo-box selection index (in the drop-down list).
public void insertItem(String item, int index)
Inserts an item in the list.
public void removeItem(int index)
Removes an item from the list.
public void removeItem(String item)
Removes an item from the list.
public void setEditable(boolean iEditable)
Enables/disables editing in the combo-box (default is disabled).
public void setEnable(boolean iEnable)
Enables or disables this combo-box.
public void setItemList(String[] iItems)
Sets the list of combo-box items as a string array.
public void setItems(Enumeration iEnum)
Sets the list of combo-box items as a string enumeration.
public void setItems(String[] itemsTab)
Sets the list of combo-box items as a string array.
public void setItemTranslator(CATITranslator iTranslator)
Sets an item translator for this combo-box.
public void setSelection(int index)
Sets the current combo-box selection from the given item index.
public void setSelection(String iSelection)
Sets the current combo-box selection.


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

addItem

    public void addItem(String item)

Appends an item to the drop-down list.

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

getComboActivatedNotification

    public CATNotification getComboActivatedNotification()

The combo-box activated notification.

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

Return:
The combo-box activated notification.

getEditable

    public boolean getEditable()

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

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

getEnable

    public boolean getEnable()

Determines whether this combo-box is enabled or not.

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

getItem

    public String getItem(int index)

Returns the item at specified index.

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

getItemCount

    public int getItemCount()

Returns the number of combo-box items.

Return:
The number of combo-box items.

getItemList

    public String[] getItemList()

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

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

getItems

    public Enumeration getItems()

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

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

getItemTranslator

    public CATITranslator getItemTranslator()

Returns the item translator.

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

getSelection

    public String getSelection()

Returns the current combo-box selection.

Return:
The current selected item's name.

getSelectionIndex

    public 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.

Return:
The current selected item's index.

insertItem

    public 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

    public void removeItem(int index)

Removes an item from the list.

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

removeItem

    public void removeItem(String item)

Removes an item from the list.

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

setEditable

    public 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.

setEnable

    public 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.

setItemList

    public 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.

setItems

    public 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

    public 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.

setItemTranslator

    public 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).

setSelection

    public 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.

setSelection

    public 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.


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