net.sf.borg.model
Class CheckListModel

java.lang.Object
  extended by net.sf.borg.model.Model
      extended by net.sf.borg.model.CheckListModel

public class CheckListModel
extends Model

The CheckList Model manages the CheckList Entities. CheckLists are keyed by a name. CheckLists contain simple text and have stayed simple to be able to sync with the simple checkList functionality of a Palm Pilot.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.borg.model.Model
Model.ChangeEvent, Model.Listener
 
Method Summary
 void delete(String name, boolean undo)
          Delete a checkList by name
 void export(Writer fw)
          Export to XML
 CheckList getCheckList(String name)
          Gets a checkList by name.
 Collection<CheckList> getCheckLists()
          Gets all checkLists.
 CheckListDB getDB()
          Gets the dB.
 String getExportName()
          get the root XML element name for this model's XML representation
 String getInfo()
          return user readable information about the model
 Collection<String> getNames()
          Gets all checkList names.
static CheckListModel getReference()
          Gets the singleton.
 void importXml(InputStream is)
          Import xml.
 void refresh()
          Refresh listeners
 void saveCheckList(CheckList checkList)
          Save a checkList.
 void saveCheckList(CheckList checkList, boolean undo)
          Save a checkList.
 
Methods inherited from class net.sf.borg.model.Model
addListener, getExistingModels, refreshListeners, refreshListeners, remove, removeListener, removeListeners, sync, syncModels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getReference

public static CheckListModel getReference()
Gets the singleton.

Returns:
the singleton

getDB

public CheckListDB getDB()
Gets the dB.

Returns:
the dB

getCheckLists

public Collection<CheckList> getCheckLists()
                                    throws Exception
Gets all checkLists.

Returns:
all checkLists
Throws:
Exception - the exception

getNames

public Collection<String> getNames()
                            throws Exception
Gets all checkList names.

Returns:
the checkList names
Throws:
Exception - the exception

delete

public void delete(String name,
                   boolean undo)
Delete a checkList by name

Parameters:
name - the checkList name
undo - true if we are executing an undo

saveCheckList

public void saveCheckList(CheckList checkList)
Save a checkList.

Parameters:
checkList - the checkList

saveCheckList

public void saveCheckList(CheckList checkList,
                          boolean undo)
Save a checkList.

Parameters:
checkList - the checkList
undo - true if we are executing an undo

getCheckList

public CheckList getCheckList(String name)
                       throws Exception
Gets a checkList by name.

Parameters:
name - the checkList name
Returns:
the checkList
Throws:
Exception - the exception

export

public void export(Writer fw)
            throws Exception
Export to XML

Specified by:
export in class Model
Parameters:
fw - the writer to write XML to
Throws:
Exception - the exception

importXml

public void importXml(InputStream is)
               throws Exception
Import xml.

Specified by:
importXml in class Model
Parameters:
is - the input stream containing the XML
Throws:
Exception - the exception

refresh

public void refresh()
Refresh listeners


getExportName

public String getExportName()
Description copied from class: Model
get the root XML element name for this model's XML representation

Specified by:
getExportName in class Model
Returns:
the XML root element name

getInfo

public String getInfo()
               throws Exception
Description copied from class: Model
return user readable information about the model

Specified by:
getInfo in class Model
Returns:
user readable information String
Throws:
Exception


Generated December 30 2011 by mbb using Apache Ant(TM) version 1.8.2 compiled on December 20 2010 and Java version 1.6.0_30 from Sun Microsystems Inc. on Linux i386 3.0.0-14-generic-pae