java.lang.Object
javax.swing.AbstractListModel
org.scopemvc.view.swing.SAbstractListModel
org.scopemvc.view.swing.SComboBoxModel
- All Implemented Interfaces:
- javax.swing.ComboBoxModel, javax.swing.ListModel, org.scopemvc.view.util.ModelBindable, org.scopemvc.core.ModelChangeListener, Refreshable, java.io.Serializable
- public final class SComboBoxModel
- extends SAbstractListModel
- implements javax.swing.ComboBoxModel
- Version:
- $Revision: 1.7 $ $Date: 2002/01/26 09:46:20 $
| Methods inherited from class org.scopemvc.view.swing.SAbstractListModel |
getBoundModel, getElementAt, getManager, getSelector, getShownModel, getSize, getSizeSelector, getViewValue, isSorted, modelChanged, setComparator, setListModel, setSelector, setSelectorString, setShownModel, setSizeSelector, setSizeSelectorString, setSorted, setSorted, updateFromProperty, validationFailed, validationSuccess |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
private static final org.apache.commons.logging.Log LOG
_jdk1_3fixIgnoreSetSelectedItem
private boolean _jdk1_3fixIgnoreSetSelectedItem
selectionDelegate
private SComboBoxModel.SelectionBoundModel selectionDelegate
selectionBoundModel
private SwingBoundModel selectionBoundModel
combo
private javax.swing.JComboBox combo
- Owning combo.
selectedItem
private java.lang.Object selectedItem
- Need to hold this here in case the model decides to
veto some values: UI can hold invalid values whereas
model can't.
SComboBoxModel
public SComboBoxModel(javax.swing.JComboBox inCombo)
setSelectedItem
public void setSelectedItem(java.lang.Object inItem)
- Description copied from interface:
javax.swing.ComboBoxModel
- Sets the selected item in the combo box. Classes implementing this
interface should fire a javax.swing.event.ListDataEvent to all registered
javax.swing.event.ListDataListeners to indicate that the selection has changed.
- Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel
getSelectedItem
public java.lang.Object getSelectedItem()
- Description copied from interface:
javax.swing.ComboBoxModel
- Returns the currently selected item in the combo box.
- Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel
jdk1_3fixIgnoreSetSelectedItem
void jdk1_3fixIgnoreSetSelectedItem(boolean inIgnore)
- This method is bug fix for JDK 1.2.x,1.3.x bug: after setting
model combobox sets element 0 as selected. This is violation
of MVC paradigm - model describes some state and should not
be modified by view. JDK 1.4 beta has this bug fixed.
Model should be instance of SComboBoxModel to fix take effect
.
setBoundModel
public void setBoundModel(java.lang.Object inModel)
- Overrides:
setBoundModel in class SAbstractListModel
getBoundSelectionModel
public final java.lang.Object getBoundSelectionModel()
setBoundSelectionModel
public final void setBoundSelectionModel(java.lang.Object inModel)
getSelectionSelector
public final org.scopemvc.core.Selector getSelectionSelector()
setSelectionSelector
public final void setSelectionSelector(org.scopemvc.core.Selector inSelector)
setSelectionSelectorString
public final void setSelectionSelectorString(java.lang.String inSelectorString)
refresh
public void refresh()
- Description copied from interface:
Refreshable
- Update the widget with the current state of the bound model.
Probably something like this:
Object propertyValue = boundModel.getPropertyValue();
boolean propertyReadOnly = boundModel.getPropertyReadOnly();
updateFromProperty(propertyValue, propertyReadOnly);
- Specified by:
refresh in interface Refreshable- Overrides:
refresh in class SAbstractListModel
fireContentsChanged
void fireContentsChanged()