org.formaria.swt
Class ComboBox

java.lang.Object
  extended by Combo
      extended by org.formaria.swt.ComboBox
All Implemented Interfaces:
ListHolder

public class ComboBox
extends Combo
implements ListHolder

A wrapper for the AWT Choice class

Copyright (c) Formaria Ltd.,
License: see license.txt $Revision: 2.2 $


Constructor Summary
ComboBox(java.lang.Object parent)
          Create a new combo box
 
Method Summary
 void addItem(java.lang.Object s)
          Add an item to the drop down list
protected  void checkSubclass()
          Suppress the subclassing exception
 int getSelectedIndex()
          Get the selected index
 java.lang.Object getSelectedObject()
          Get the selected object in the combo
 java.lang.Object[] getSelectedObjects()
          Get the selected objects
 int getSelectionMode()
          Get the list selection mode.
 java.lang.String getToolTip()
          Get the tooltip text
 void select(java.lang.Object o)
          Select an object in the list
 void setDefaultSelection()
          Set the list to its default selection state
 void setSelectedObject(java.lang.Object o)
          Get the selected object
 void setSelectedObjects(java.lang.Object[] values)
          Set the selected objects
 void setToolTip(java.lang.String text)
          Set the tooltip text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.formaria.aria.ListHolder
getItemCount, removeAll, select
 

Constructor Detail

ComboBox

public ComboBox(java.lang.Object parent)
Create a new combo box

Parameters:
parent - parent object
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception


setDefaultSelection

public void setDefaultSelection()
Set the list to its default selection state

Specified by:
setDefaultSelection in interface ListHolder

addItem

public void addItem(java.lang.Object s)
Add an item to the drop down list

Specified by:
addItem in interface ListHolder
Parameters:
s - the new list item

select

public void select(java.lang.Object o)
Select an object in the list

Specified by:
select in interface ListHolder
Parameters:
o - the object to select in the list

getSelectedObject

public java.lang.Object getSelectedObject()
Get the selected object in the combo

Specified by:
getSelectedObject in interface ListHolder
Returns:
the selected object. Normally this is a String

getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Description copied from interface: ListHolder
Get the selected objects

Specified by:
getSelectedObjects in interface ListHolder
Returns:
the selected objects in the list

setSelectedObject

public void setSelectedObject(java.lang.Object o)
Get the selected object

Specified by:
setSelectedObject in interface ListHolder
Parameters:
o - the selected object

setSelectedObjects

public void setSelectedObjects(java.lang.Object[] values)
Set the selected objects

Specified by:
setSelectedObjects in interface ListHolder
Parameters:
values - the selected object

getSelectedIndex

public int getSelectedIndex()
Get the selected index

Specified by:
getSelectedIndex in interface ListHolder
Returns:
the selected index

setToolTip

public void setToolTip(java.lang.String text)
Set the tooltip text

Parameters:
text - the new text

getToolTip

public java.lang.String getToolTip()
Get the tooltip text

Returns:
the existing text if any

getSelectionMode

public int getSelectionMode()
Get the list selection mode. This method returns 0.

Specified by:
getSelectionMode in interface ListHolder
Returns:
  • 0=ListSelectionModel.SINGLE_SELECTION,
  • 1=ListSelectionModel.SINGLE_INTERVAL_SELECTION,
  • 2=ListSelectionModel.MULTIPLE_INTERVAL_SELECTION