1 15 package org.apache.tapestry.contrib.table.model.simple; 16 17 import java.io.Serializable ; 18 19 import org.apache.tapestry.contrib.table.model.ITableColumnModel; 20 import org.apache.tapestry.contrib.table.model.ITableDataModel; 21 import org.apache.tapestry.contrib.table.model.ITableModel; 22 import org.apache.tapestry.contrib.table.model.ITableSessionStateManager; 23 24 31 public class SimpleTableSessionStateManager 32 implements ITableSessionStateManager 33 { 34 private ITableDataModel m_objDataModel; 35 private ITableColumnModel m_objColumnModel; 36 37 public SimpleTableSessionStateManager( 38 ITableDataModel objDataModel, 39 ITableColumnModel objColumnModel) 40 { 41 m_objDataModel = objDataModel; 42 m_objColumnModel = objColumnModel; 43 } 44 45 48 public Serializable getSessionState(ITableModel objModel) 49 { 50 SimpleTableModel objSimpleModel = (SimpleTableModel) objModel; 51 return objSimpleModel.getState(); 52 } 53 54 57 public ITableModel recreateTableModel(Serializable objState) 58 { 59 if (objState == null) 60 return null; 61 SimpleTableState objSimpleState = (SimpleTableState) objState; 62 return new SimpleTableModel( 63 m_objDataModel, 64 m_objColumnModel, 65 objSimpleState); 66 } 67 68 } 69 | Popular Tags |