The Gravey 2.5 Framework

Class MVCSelectionModel

Object
   |
   +--GrvObject
         |
         +--MVCObserver
               |
               +--MVCModel
                     |
                     +--MVCScalarModel
                           |
                           +--MVCSelectionModel
Direct Known Subclasses:
EDOHolderSelectionModel

class MVCSelectionModel
extends MVCScalarModel


This class encapsulates the data model for a selector which indicates the currently selected item in a specified MVCCollection 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.
Version: 2.0

Author: Bruce Wallace (PolyGlotInc.com)
See:

Defined in grvMVC.js


Field Summary
<static>  Object kNothingSelected
          
<static>  Object kPropertyIdSelect
          
 
Constructor Summary
MVCSelectionModel ()
           
 
Method Summary
 void _select(<Object> k,<boolean> optLenient)
           select the specified Collection item but dont publish
 void _selectNothing()
           select "nothing" but dont publish
 void _unselect( )
           select the zero-th item (NOT "nothing selected") but dont publish
 Object getCount( )
           return the size of our MVCCollection model
 String getDescription(i)
           return the specified MVCCollection item formatted as description
 int getIndex( optKey )
           return the index into the MVCCollection model of the specified key (or the current selection if no key specified)
 Object getItem(<Object> i)
           return the specified item in our Collection
 Collection getList( )
           return our Collection model
 Object getMemento()
           return a memento of the current state of "this"
 Object getSelection( )
           return the currently selected MVCCollection item or undefined if nothing selected
 String getSelectionStr( )
           return the currently selected MVCCollection item formatted as string
 boolean hasSelection( )
           return whether there is currently a selection
 void konstructor( <Object> collModel, <String> optName )
          
 void reselect( )
           re-select the current value and publish
 void select(<Object> k,<boolean> optLenient)
           select the specified MVCCollection item and publish
 void selectNothing()
           select "nothing" and publish
 void setMemento(<Object> m)
           update "this" based on the given memento
 void unselect( )
           select the zero-th item (NOT "nothing selected") and publish
 void update( )
           handle MVCCollection model update event by "unselect"ing
 
Methods inherited from class MVCScalarModel
_setValue, setValue, getValue, _setValidity, getValidity
   
Methods inherited from class MVCModel
dumpSubscribers, toString, dirty, clean, publish, GET, _SET, SET, updateStamp, BeginTransaction, EndTransaction, addObserver, delObserver, notifyObservers
   
Methods inherited from class MVCObserver
subscribe
   
Methods inherited from class GrvObject
souper, souper_, isInstanceOf
 

Field Detail

kNothingSelected

<static> Object kNothingSelected

kPropertyIdSelect

<static> Object kPropertyIdSelect

Constructor Detail

MVCSelectionModel

MVCSelectionModel()

Method Detail

_select

void _select(<Object> k,<boolean> optLenient)

_selectNothing

void _selectNothing()

_unselect

void _unselect( )

getCount

Object getCount( )

getDescription

String getDescription(i)

getIndex

int getIndex( optKey )

getItem

Object getItem(<Object> i)

getList

Collection getList( )

getMemento

Object getMemento()

getSelection

Object getSelection( )

getSelectionStr

String getSelectionStr( )

hasSelection

boolean hasSelection( )

konstructor

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

reselect

void reselect( )

select

void select(<Object> k,<boolean> optLenient)

selectNothing

void selectNothing()

setMemento

void setMemento(<Object> m)

unselect

void unselect( )

update

void update( )

The Gravey 2.5 Framework

Documentation generated by JSDoc on Thu Jan 6 12:47:09 2011