cmu.survey.editor.data.table
Class SurveyTable

java.lang.Object
  extended by org.browsecode.helpers.reorderablelistpanel.ReorderableListModelWithOrderIndexStub<Page>
      extended by cmu.survey.editor.data.table.SurveyTable
All Implemented Interfaces:
Survey, ReorderableListModel<Page>

public class SurveyTable
extends ReorderableListModelWithOrderIndexStub<Page>
implements Survey


Nested Class Summary
 class SurveyTable.ReorderablePage
           
 
Nested classes/interfaces inherited from class org.browsecode.helpers.reorderablelistpanel.ReorderableListModelWithOrderIndexStub
ReorderableListModelWithOrderIndexStub.ReorderableObject<E2>
 
Field Summary
protected  java.util.Vector<Page> deletedPages
           
protected  java.util.Vector<ReorderableListModelWithOrderIndexStub.ReorderableObject<Page>> pages
           
 
Fields inherited from class org.browsecode.helpers.reorderablelistpanel.ReorderableListModelWithOrderIndexStub
ABSTRACTION_ERROR, undoableEditListeners
 
Fields inherited from interface org.browsecode.helpers.reorderablelistpanel.ReorderableListModel
INSERTED_FROM_DELETED_HERE, INSERTED_FROM_ELSEWHERE
 
Constructor Summary
SurveyTable(java.util.Vector<Page> pagesLoaded, DataBitStorageTable tableStorage)
           
 
Method Summary
protected  void deleteItem(ReorderableListModelWithOrderIndexStub.ReorderableObject<Page> justDeleted)
          If an object is deleted from the list, this method is fired and should be used to keep track of which items should not be saved anymore and deleted when this set is saved.
protected  java.lang.String getItemsName()
          For undos and presentation names -- so we can say what we're moving/deleting/inserting
protected  java.util.Vector<ReorderableListModelWithOrderIndexStub.ReorderableObject<Page>> getItemsVector()
          Should return a non-cloned version of the list of items -- the vector will be changed to reflect the order, etc.
 Page getNewItem()
          Creates a new item for the list, but does not insert it into the list.
protected  ReorderableListModelWithOrderIndexStub.ReorderableObject<Page> getNewItem(int indexAt)
          Should not insert item, but should get a new one and return it.
 Page getNewPage()
           
 QuestionDataBitSet getNewQuestion(java.lang.String type, boolean scaleChoices)
           
 java.util.List<Page> getPages()
           
protected  ReorderableListModelWithOrderIndexStub.ReorderableObject<Page> getReorderableObjectFor(Page reorderableItem)
           
 DataBitStorageTable getTableStorage()
           
 boolean hasBeenModified()
           
 boolean isLoginPage(Page page)
          Generally returns whether this is the first page in the list.
 boolean save()
          Returns false if it does not save correctly, or if there was an error in saving.
protected  boolean undeleteItem(ReorderableListModelWithOrderIndexStub.ReorderableObject<Page> aboutToUndelete)
          Undelete an item that was just deleted using deleteItem().
 
Methods inherited from class org.browsecode.helpers.reorderablelistpanel.ReorderableListModelWithOrderIndexStub
addReorderableChangeListener, addUndoableEditListener, canItemBeMovedElsewhere, deleteItem, deleteItemProtected, fireUndoableEdit, fireUndoableEdit, getHasBeenChanged, getItemCount, getVectorOfReorderableItems, insertNewItemAt, insertNewItemAtProtected, iterator, moveItemElsewhere, moveItemElsewhereProtected, moveItemToIndex, moveItemToIndexProtected, removeReorderableChangeListener, removeUndoableEditListener, resetHasBeenChanged, setCachedReorderableItems, shouldFireUndoableEdits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cmu.survey.editor.data.Survey
addUndoableEditListener, removeUndoableEditListener
 
Methods inherited from interface org.browsecode.helpers.reorderablelistpanel.ReorderableListModel
addReorderableChangeListener, canItemBeMovedElsewhere, deleteItem, getItemCount, insertNewItemAt, iterator, moveItemElsewhere, moveItemToIndex, removeReorderableChangeListener
 

Field Detail

pages

protected java.util.Vector<ReorderableListModelWithOrderIndexStub.ReorderableObject<Page>> pages

deletedPages

protected java.util.Vector<Page> deletedPages
Constructor Detail

SurveyTable

public SurveyTable(java.util.Vector<Page> pagesLoaded,
                   DataBitStorageTable tableStorage)
Method Detail

getTableStorage

public DataBitStorageTable getTableStorage()

hasBeenModified

public boolean hasBeenModified()
Specified by:
hasBeenModified in interface Survey

getItemsVector

protected java.util.Vector<ReorderableListModelWithOrderIndexStub.ReorderableObject<Page>> getItemsVector()
Description copied from class: ReorderableListModelWithOrderIndexStub
Should return a non-cloned version of the list of items -- the vector will be changed to reflect the order, etc.

Overrides:
getItemsVector in class ReorderableListModelWithOrderIndexStub<Page>
Returns:
Vector

getItemsName

protected java.lang.String getItemsName()
Description copied from class: ReorderableListModelWithOrderIndexStub
For undos and presentation names -- so we can say what we're moving/deleting/inserting

Overrides:
getItemsName in class ReorderableListModelWithOrderIndexStub<Page>

getPages

public java.util.List<Page> getPages()
Specified by:
getPages in interface Survey

isLoginPage

public boolean isLoginPage(Page page)
Description copied from interface: Survey
Generally returns whether this is the first page in the list.

Specified by:
isLoginPage in interface Survey
Returns:

deleteItem

protected void deleteItem(ReorderableListModelWithOrderIndexStub.ReorderableObject<Page> justDeleted)
Description copied from class: ReorderableListModelWithOrderIndexStub
If an object is deleted from the list, this method is fired and should be used to keep track of which items should not be saved anymore and deleted when this set is saved.

Overrides:
deleteItem in class ReorderableListModelWithOrderIndexStub<Page>

undeleteItem

protected boolean undeleteItem(ReorderableListModelWithOrderIndexStub.ReorderableObject<Page> aboutToUndelete)
Description copied from class: ReorderableListModelWithOrderIndexStub
Undelete an item that was just deleted using deleteItem(). Return true if it works and is implemented, return false if it doesn't work or isn't implemented. Implemented for now as a convenience to those who

Overrides:
undeleteItem in class ReorderableListModelWithOrderIndexStub<Page>

getNewItem

protected ReorderableListModelWithOrderIndexStub.ReorderableObject<Page> getNewItem(int indexAt)
Description copied from class: ReorderableListModelWithOrderIndexStub
Should not insert item, but should get a new one and return it. The item made with this will not necessarily be inserted, and even if it is, it might be inserted into another ReorderableSQLSet. This can be overrided if an item created at a parti

Overrides:
getNewItem in class ReorderableListModelWithOrderIndexStub<Page>

getNewQuestion

public QuestionDataBitSet getNewQuestion(java.lang.String type,
                                         boolean scaleChoices)
Specified by:
getNewQuestion in interface Survey

getNewPage

public Page getNewPage()
Specified by:
getNewPage in interface Survey

save

public boolean save()
Description copied from interface: Survey
Returns false if it does not save correctly, or if there was an error in saving. (It is assumed to have reported the bug or prompted the user to report a bug).

Specified by:
save in interface Survey
Returns:

getNewItem

public Page getNewItem()
Description copied from class: ReorderableListModelWithOrderIndexStub
Creates a new item for the list, but does not insert it into the list. Required for getNewItem(int), which does the job correctly if you implement this.;

Overrides:
getNewItem in class ReorderableListModelWithOrderIndexStub<Page>
Returns:

getReorderableObjectFor

protected ReorderableListModelWithOrderIndexStub.ReorderableObject<Page> getReorderableObjectFor(Page reorderableItem)
Overrides:
getReorderableObjectFor in class ReorderableListModelWithOrderIndexStub<Page>