hibergui.assoc
Class M2OEdit_Combo<T>

java.lang.Object
  extended by hibergui.Component<T>
      extended by hibergui.Edit<C>
          extended by hibergui.assoc.AssociationEdit<T,T>
              extended by hibergui.assoc.M2OEdit<T>
                  extended by hibergui.assoc.M2OEdit_Combo<T>
Direct Known Subclasses:
HibernateM2OEdit_Combo

public abstract class M2OEdit_Combo<T>
extends M2OEdit<T>


Nested Class Summary
private static class M2OEdit_Combo.MatchState
           
 
Nested classes/interfaces inherited from class hibergui.Edit
Edit.DefaultComputation<TT>, Edit.EditConstraint
 
Field Summary
private  org.eclipse.swt.widgets.Combo cmb
           
(package private)  java.text.Collator coll
           
private  org.eclipse.swt.widgets.Composite cpt
           
protected  java.lang.String editProp
           
private  int matchIndex
           
private  M2OEdit_Combo.MatchState state
           
private  java.util.List<T> values
           
 
Fields inherited from class hibergui.assoc.M2OEdit
persistentClass
 
Fields inherited from class hibergui.assoc.AssociationEdit
btnAssoc, dlgAssoc
 
Fields inherited from class hibergui.Edit
form, lsn_TRAVERSE, lsn_WIDGET_MOD, value
 
Fields inherited from class hibergui.Component
lsn_WIDGET_FOCUS, lsn_WIDGET_KEY, style
 
Constructor Summary
M2OEdit_Combo(Form<?> form, org.eclipse.swt.widgets.Composite cptParent, int style, java.lang.String prop, java.lang.String name, java.lang.String editProp)
           
 
Method Summary
 void clear()
          Clears the controls of the edit.
protected  org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite cptParent)
          Creates the GUI contents of the component.
 T extract()
          It should do something like that (unfortunately, generic parameter types cannot be instantiated): public final T extract() { T t = new T(); extract(t); return t; }
 void extract(T t)
           
 void fill()
          Fills the controls of the edit with its actual value.
protected  void fillForm(Form<T> f)
          Fills the corresponding fields of the form, according to the content of the editor.
protected  java.lang.String getItemText(T item)
           
 java.lang.String getText()
           
 boolean isEnabled()
           
 void refresh()
           
 void setBackground(org.eclipse.swt.graphics.Color clr)
           
private  void setComboInput(java.util.Collection<T> c)
           
 void setDefault(java.lang.String value)
           
 void setEnabled(boolean b)
           
 boolean setFocus()
           
 
Methods inherited from class hibergui.assoc.M2OEdit
createForm, createForm, findAll, findSuch, setSelection
 
Methods inherited from class hibergui.assoc.AssociationEdit
createAssocDialog, createAssocDialogButton, setEditable
 
Methods inherited from class hibergui.Edit
addConstraint, addConstraint, addModificationListener, addTraverseListener, fireKeyPressed, fireKeyReleased, fireTraversal, fix, get, getDefault, getName, getPropertyName, hasDefault, isDirty, isEditable, isFixed, isValid, markClean, markDirty, markInvalid, markValid, removeConstraint, removeConstraint, removeModificationListener, removeTraverseListener, resetBackground, set, setDefault, setDefault, setDefault, verify
 
Methods inherited from class hibergui.Component
addChangeListener, addControlListener, addFocusListener, addKeyListener, dispose, fireChange, getControl, init, removeChangeListener, removeControlListener, removeFocusListener, removeKeyListener, setLayoutData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cpt

private org.eclipse.swt.widgets.Composite cpt

cmb

private org.eclipse.swt.widgets.Combo cmb

editProp

protected final java.lang.String editProp

values

private java.util.List<T> values

matchIndex

private int matchIndex

state

private M2OEdit_Combo.MatchState state

coll

java.text.Collator coll
Constructor Detail

M2OEdit_Combo

public M2OEdit_Combo(Form<?> form,
                     org.eclipse.swt.widgets.Composite cptParent,
                     int style,
                     java.lang.String prop,
                     java.lang.String name,
                     java.lang.String editProp)
Method Detail

createContents

protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite cptParent)
Description copied from class: Component
Creates the GUI contents of the component. Subclasses should override it.

Specified by:
createContents in class Component<T>
Parameters:
cptParent - The composite which the component will be placed on. The parent of the control of the component.
Returns:
The control of the component containing its GUI elements.

getItemText

protected final java.lang.String getItemText(T item)

getText

public java.lang.String getText()

setComboInput

private void setComboInput(java.util.Collection<T> c)

clear

public void clear()
Description copied from class: Edit
Clears the controls of the edit.

Overrides:
clear in class AssociationEdit<T,T>

fill

public void fill()
Description copied from class: Edit
Fills the controls of the edit with its actual value.

Specified by:
fill in class Edit<T>

extract

public T extract()
Description copied from class: M2OEdit
It should do something like that (unfortunately, generic parameter types cannot be instantiated): public final T extract() { T t = new T(); extract(t); return t; }

Overrides:
extract in class M2OEdit<T>
Returns:
the extracted value

extract

public final void extract(T t)
Specified by:
extract in class M2OEdit<T>

refresh

public void refresh()
Overrides:
refresh in class AssociationEdit<T,T>

setBackground

public void setBackground(org.eclipse.swt.graphics.Color clr)
Overrides:
setBackground in class AssociationEdit<T,T>

setFocus

public boolean setFocus()
Overrides:
setFocus in class AssociationEdit<T,T>

isEnabled

public boolean isEnabled()
Overrides:
isEnabled in class AssociationEdit<T,T>

setEnabled

public void setEnabled(boolean b)
Overrides:
setEnabled in class AssociationEdit<T,T>

setDefault

public void setDefault(java.lang.String value)

fillForm

protected void fillForm(Form<T> f)
Description copied from class: M2OEdit
Fills the corresponding fields of the form, according to the content of the editor. This is only invoked when no object has been set as the input the editor yet.

Overrides:
fillForm in class M2OEdit<T>