1 15 package org.apache.tapestry.contrib.table.components; 16 17 import org.apache.hivemind.ApplicationRuntimeException; 18 import org.apache.tapestry.BaseComponent; 19 import org.apache.tapestry.IRequestCycle; 20 import org.apache.tapestry.contrib.table.model.ITableModelSource; 21 22 29 public abstract class AbstractTableViewComponent extends BaseComponent 30 { 31 public ITableModelSource getTableModelSource() 32 { 33 IRequestCycle objCycle = getPage().getRequestCycle(); 34 35 ITableModelSource objSource = 36 (ITableModelSource) objCycle.getAttribute( 37 ITableModelSource.TABLE_MODEL_SOURCE_ATTRIBUTE); 38 39 if (objSource == null) 40 throw new ApplicationRuntimeException( 41 "The component " 42 + getId() 43 + " must be contained within an ITableModelSource component, such as TableView", 44 this, 45 null, 46 null); 47 48 return objSource; 49 } 50 51 } 52 | Popular Tags |