Class fvaswing.components.input.FvComboInput

Implemented Interfaces

FvInputComponent

Description

Use a JComboBox as input component.

Example using classic instanciation

 
   var input : FvComboInput = new FvComboInput( );
   input.setListData( [ "january", "february" ] );
   
   FvInputComponentDialog.show( input, "Choose your month", this, _onInputResult );
 

Example using static create() instanciation

 
   var combo : JComboBox = new JComboBox( [ "january", "february" ] );
   
   var input : FvSliderInput = FvComboInput.create( combo );
   
   FvInputComponentDialog.show( input, "Choose your year", this, _onInputResult );
 

See Also

Method Index

new FvComboInput()
create(), getContainer(), getModel(), getValue(), isValid(), setListData(), setModel(), setValue(), setValueIndex(), toString()

Constructor Detail

FvComboInput

public function FvComboInput()

Constructor.

Method Detail

create

static public function create(combobox:JComboBox):FvComboInput

Creates and returns a FvComboInput with passed-in combobox component.

setModel

public function setModel(model:ListModel):Void

Sets the list model to provide the data to combobox.

getModel

public function getModel():ListModel

Returns combobox data model.

setListData

public function setListData(data:Array):Void

set a array to be the list data, but array is not a List Model. So when the array content was changed, you should call updateListView to update the JList(the list for combo box).But this is not a good way, its slow. So suggest you to create a ListMode eg. VectorListMode, When you modify ListMode, it will automatic update JList.

See Also

getContainer

public function getContainer():Component

Returns JCombobox component to add into a FvInputComponentDialog dialog.

Specified By

getContainer() in fvaswing.components.input.FvInputComponent

setValue

public function setValue(o:Object):Void

Sets combobox selected item.

setValueIndex

public function setValueIndex(index:Number):Void

Sets combobox selected index.

getValue

public function getValue()

Returns combobox selected index.

Specified By

getValue() in fvaswing.components.input.FvInputComponent

isValid

public function isValid():Boolean

Returns true if input is valid.

Specified By

isValid() in fvaswing.components.input.FvInputComponent

toString

public function toString():String

Returns string representation.