The Gravy Framework

Class SelectionModel

Object
   |
   +--OObject
         |
         +--Observer
               |
               +--Model
                     |
                     +--ScalarModel
                           |
                           +--SelectionModel
Direct Known Subclasses:
AccountSelectionModel

class SelectionModel
extends ScalarModel


This class encapsulates the data model for a selector which indicates the currently selected item in a specified Collection data model. This means that the range of legal values for this model's value is [0..Collection.getCount()-1] plus a "nothing selected" value.
See:

Author: Bruce Wallace (PolyGlotInc.com)
Defined in mvc.js

Version: 1.0


Constructor Summary
SelectionModel ()
           
 
Method Summary
 void _select(<Object> k)
           select the specified Collection item but dont publish
 void _unselect( )
           select the zero-th item (NOT "nothing selected") but dont publish
 Object getCount( )
           return the size of our Collection model
 String getDescription(i)
           return the currently selected Collection item formatted as description
 int getIndex( )
           return the index into the Collection model of the current selection
 Object getItem(<Object> i)
           return the specified item in our Collection
 Collection getList( )
           return our Collection model
 Object getSelection( )
           return the currently selected Collection item
 String getSelectionStr( )
           return the currently selected Collection item formatted as string
 void konstructor( <Object> collModel, <String> optName )
          
 void reselect( )
           re-select the current value and publish
 void select(<Object> k)
           select the specified Collection item and publish
 void unselect( )
           select the zero-th item (NOT "nothing selected") and publish
 void update( )
           handle Collection model update event by "unselect"ing
 
Methods inherited from class ScalarModel
_setValue, setValue, getValue, _setValidity, getValidity
   
Methods inherited from class Model
dumpSubscribers, toString, dirty, clean, neverChanged, publish, GET, _SET, SET, updateStamp, BeginTransaction, EndTransaction, addObserver, delObserver, notifyObservers
   
Methods inherited from class Observer
subscribe
 

Constructor Detail

SelectionModel

SelectionModel()

Method Detail

_select

void _select(<Object> k)

_unselect

void _unselect( )

getCount

Object getCount( )

getDescription

String getDescription(i)

getIndex

int getIndex( )

getItem

Object getItem(<Object> i)

getList

Collection getList( )

getSelection

Object getSelection( )

getSelectionStr

String getSelectionStr( )

konstructor

void konstructor( <Object> collModel, <String> optName )

reselect

void reselect( )

select

void select(<Object> k)

unselect

void unselect( )

update

void update( )

The Gravy Framework

Documentation generated by JSDoc on Fri Mar 17 06:40:21 2006