1 15 package org.apache.tapestry.contrib.table.components; 16 17 import org.apache.tapestry.BaseComponent; 18 import org.apache.tapestry.contrib.table.model.ITableColumn; 19 import org.apache.tapestry.contrib.table.model.ITableModel; 20 import org.apache.tapestry.contrib.table.model.ITableModelSource; 21 22 30 public abstract class Table extends BaseComponent implements ITableModelSource 31 { 32 35 public ITableModel getTableModel() 36 { 37 return getTableViewComponent().getTableModel(); 38 } 39 40 46 public void fireObservedStateChange() 47 { 48 getTableViewComponent().fireObservedStateChange(); 49 } 50 51 55 public void reset() 56 { 57 getTableViewComponent().reset(); 58 } 59 60 66 public ITableColumn getTableColumn() 67 { 68 Object objCurrentRow = getTableRow(); 69 70 if (objCurrentRow == null) 72 return getTableColumnsComponent().getTableColumn(); 73 74 return getTableValuesComponent().getTableColumn(); 75 } 76 77 83 public Object getTableRow() 84 { 85 return getTableRowsComponent().getTableRow(); 86 } 87 88 protected TableView getTableViewComponent() 89 { 90 return (TableView) getComponent("tableView"); 91 } 92 93 protected TableColumns getTableColumnsComponent() 94 { 95 return (TableColumns) getComponent("tableColumns"); 96 } 97 98 protected TableRows getTableRowsComponent() 99 { 100 return (TableRows) getComponent("tableRows"); 101 } 102 103 protected TableValues getTableValuesComponent() 104 { 105 return (TableValues) getComponent("tableValues"); 106 } 107 } | Popular Tags |