001 // Copyright 2004, 2005 The Apache Software Foundation
002 //
003 // Licensed under the Apache License, Version 2.0 (the "License");
004 // you may not use this file except in compliance with the License.
005 // You may obtain a copy of the License at
006 //
007 // http://www.apache.org/licenses/LICENSE-2.0
008 //
009 // Unless required by applicable law or agreed to in writing, software
010 // distributed under the License is distributed on an "AS IS" BASIS,
011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 // See the License for the specific language governing permissions and
013 // limitations under the License.
014
015 package org.apache.tapestry.contrib.table.components;
016
017 import org.apache.tapestry.IComponent;
018 import org.apache.tapestry.contrib.table.model.IAdvancedTableColumnSource;
019 import org.apache.tapestry.contrib.table.model.ITableColumnModel;
020
021 /**
022 * Service used to generate a {@link org.apache.tapestry.contrib.table.model.ITableColumnModel}from
023 * a string description.
024 *
025 * @author Howard M. Lewis Ship
026 * @since 4.0
027 */
028 public interface TableColumnModelSource
029 {
030 /**
031 * Generate a table column model out of the description string provided. Entries in the
032 * description string are separated by commas. Each column entry is of the format name,
033 * name:expression, or name:displayName:expression. An entry prefixed with ! represents a
034 * non-sortable column. If the whole description string is prefixed with *, it represents
035 * columns to be included in a Form.
036 *
037 * @param strDesc
038 * the description of the column model to be generated
039 * @param objComponent
040 * the component ordering the generation
041 * @param objColumnSettingsContainer
042 * the component containing the column settings
043 * @return a table column model based on the provided parameters
044 */
045 public ITableColumnModel generateTableColumnModel(IAdvancedTableColumnSource objColumnSource,
046 String strDesc, IComponent objComponent, IComponent objColumnSettingsContainer);
047 }