de.matthiasmann.twl
Class PropertySheet.ComboBoxEditor<T>

java.lang.Object
  extended by de.matthiasmann.twl.PropertySheet.ComboBoxEditor<T>
All Implemented Interfaces:
PropertySheet.PropertyEditor, java.lang.Runnable
Enclosing class:
PropertySheet

public static class PropertySheet.ComboBoxEditor<T>
extends java.lang.Object
implements PropertySheet.PropertyEditor, java.lang.Runnable


Field Summary
protected  ComboBox<T> comboBox
           
protected  ListModel<T> model
           
protected  Property<T> property
           
 
Constructor Summary
PropertySheet.ComboBoxEditor(Property<T> property, ListModel<T> model)
           
 
Method Summary
protected  int findEntry(T value)
           
 Widget getWidget()
           
 boolean positionWidget(int x, int y, int width, int height)
          Can be used to position the widget in a cell.
 void preDestroy()
           
protected  void resetValue()
           
 void run()
           
 void setSelected(boolean selected)
           
 void valueChanged()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comboBox

protected final ComboBox<T> comboBox

property

protected final Property<T> property

model

protected final ListModel<T> model
Constructor Detail

PropertySheet.ComboBoxEditor

public PropertySheet.ComboBoxEditor(Property<T> property,
                                    ListModel<T> model)
Method Detail

getWidget

public Widget getWidget()
Specified by:
getWidget in interface PropertySheet.PropertyEditor

valueChanged

public void valueChanged()
Specified by:
valueChanged in interface PropertySheet.PropertyEditor

preDestroy

public void preDestroy()
Specified by:
preDestroy in interface PropertySheet.PropertyEditor

setSelected

public void setSelected(boolean selected)
Specified by:
setSelected in interface PropertySheet.PropertyEditor

run

public void run()
Specified by:
run in interface java.lang.Runnable

resetValue

protected void resetValue()

findEntry

protected int findEntry(T value)

positionWidget

public boolean positionWidget(int x,
                              int y,
                              int width,
                              int height)
Description copied from interface: PropertySheet.PropertyEditor
Can be used to position the widget in a cell.

If this method returns false, the table will position the widget itself.

This method is responsible to call setPosition and setSize on the widget or return false.

Specified by:
positionWidget in interface PropertySheet.PropertyEditor
Parameters:
x - the left edge of the cell
y - the top edge of the cell
width - the width of the cell
height - the height of the cell
Returns:
true if the position was changed by this method.