org.odftoolkit.simple.form
Class ComboBox

java.lang.Object
  extended by org.odftoolkit.simple.Component
      extended by org.odftoolkit.simple.form.FormControl
          extended by org.odftoolkit.simple.form.ComboBox

public class ComboBox
extends FormControl

This class represents the form control of Combo Box, provides methods to get/set the form properties and the style formatting of this control.

Since:
0.8

Field Summary
 
Fields inherited from class org.odftoolkit.simple.form.FormControl
drawingShape, formElement, mElement, mFormProperties
 
Method Summary
 void addItem(String item)
          Add a list item to this combo box.
 void addItems(String[] items)
          Add a group of list items to this combo box
 String getCurrentValue()
          Get the current value of this control, it override the default value.
 String getDataField()
          Get the data field referenced by this combo box
 ArrayList<String> getEntries()
          Get the list entries if they are initiated through a list of string.
 boolean getFormDropdown()
          Get the visibility of the drop-down list
 String getId()
          Get the control id.
static ComboBox getInstanceOf(FormComboboxElement element)
          Get an instance of combo box by an instance of FormComboboxElement, while searching the document content to make a bind with the DrawControl which already reference to this check box.
 String getListSource()
          Get the source of this data list.
 FormTypeDefinition.FormListSourceType getListSourceType()
          Get the source type of the data list.
 String getName()
          Get the control name.
static Iterator<FormControl> getSimpleIterator(Form container)
          Get a simple iterator for combo boxes.
 String getValue()
          Get the default value of this control.
 void setControlImplementation(String controlImpl)
          Set the implementation of this control.
 void setCurrentValue(String currentValue)
          Set the current value of this control, it override the default value.
 void setDataField(String dataField)
          Set the data field referenced by this combo box
 void setFormDropdown(boolean isDropDown)
          Set the visibility of the drop-down list
 void setId(String id)
          Set the control id.
 void setListSource(String listSource)
          Set the source of this data list.
 void setListSourceType(FormTypeDefinition.FormListSourceType type)
          Set the source type of the data list.
 void setName(String name)
          Set the control name.
 void setValue(String defaultValue)
          Set the default value of this control, it will be override by current value.
 
Methods inherited from class org.odftoolkit.simple.form.FormControl
getDrawControl, getOdfElement, getRectangle, remove, setAnchorType, setFormProperty, setRectangle
 
Methods inherited from class org.odftoolkit.simple.Component
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstanceOf

public static ComboBox getInstanceOf(FormComboboxElement element)
Get an instance of combo box by an instance of FormComboboxElement, while searching the document content to make a bind with the DrawControl which already reference to this check box.

Parameters:
element - - an instance of FormComboboxElement
Returns:
an instance of combo box

setControlImplementation

public void setControlImplementation(String controlImpl)
Description copied from class: FormControl
Set the implementation of this control.

Specified by:
setControlImplementation in class FormControl
Parameters:
controlImpl - - the implementation description of this control

getId

public String getId()
Description copied from class: FormControl
Get the control id.

Specified by:
getId in class FormControl
Returns:
the control id.

setId

public void setId(String id)
Description copied from class: FormControl
Set the control id.

Specified by:
setId in class FormControl
Parameters:
id - -the control id.

getName

public String getName()
Description copied from class: FormControl
Get the control name.

Specified by:
getName in class FormControl
Returns:
the control name.

setName

public void setName(String name)
Description copied from class: FormControl
Set the control name.

Specified by:
setName in class FormControl
Parameters:
name - - the control name.

setFormDropdown

public void setFormDropdown(boolean isDropDown)
Set the visibility of the drop-down list

Parameters:
isDropDown - - specify if the drop-down list is visible

getFormDropdown

public boolean getFormDropdown()
Get the visibility of the drop-down list

Returns:
true means the drop-down list is visible; false means invisible

addItem

public void addItem(String item)
Add a list item to this combo box.

Parameters:
item - - a list item

addItems

public void addItems(String[] items)
Add a group of list items to this combo box

Parameters:
items - -a group of list items

getEntries

public ArrayList<String> getEntries()
Get the list entries if they are initiated through a list of string.

Returns:
the list entries

setListSourceType

public void setListSourceType(FormTypeDefinition.FormListSourceType type)
Set the source type of the data list.

Parameters:
type - - the source type of this list

getListSourceType

public FormTypeDefinition.FormListSourceType getListSourceType()
Get the source type of the data list.

Returns:
the source type of this list

setListSource

public void setListSource(String listSource)
Set the source of this data list.

Parameters:
listSource - - the source of this data list.

getListSource

public String getListSource()
Get the source of this data list.

Returns:
the source of this data list.

setDataField

public void setDataField(String dataField)
Set the data field referenced by this combo box

Parameters:
dataField - - the data field referenced by this combo box

getDataField

public String getDataField()
Get the data field referenced by this combo box

Returns:
the data field referenced by this combo box

setValue

public void setValue(String defaultValue)
Set the default value of this control, it will be override by current value.

Parameters:
value - - default value

getValue

public String getValue()
Get the default value of this control.

Returns:
default value

setCurrentValue

public void setCurrentValue(String currentValue)
Set the current value of this control, it override the default value.

Parameters:
currentValue - - current value

getCurrentValue

public String getCurrentValue()
Get the current value of this control, it override the default value.

Returns:
current value

getSimpleIterator

public static Iterator<FormControl> getSimpleIterator(Form container)
Get a simple iterator for combo boxes.

Parameters:
container - - an instance of form where to traverse the combo boxes s


Copyright © 2010-2017 The Apache Software Foundation. All Rights Reserved.