KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > nextapp > echo2 > app > table > TableColumnModel


1 /*
2  * This file is part of the Echo Web Application Framework (hereinafter "Echo").
3  * Copyright (C) 2002-2005 NextApp, Inc.
4  *
5  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * Alternatively, the contents of this file may be used under the terms of
18  * either the GNU General Public License Version 2 or later (the "GPL"), or
19  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
20  * in which case the provisions of the GPL or the LGPL are applicable instead
21  * of those above. If you wish to allow use of your version of this file only
22  * under the terms of either the GPL or the LGPL, and not to allow others to
23  * use your version of this file under the terms of the MPL, indicate your
24  * decision by deleting the provisions above and replace them with the notice
25  * and other provisions required by the GPL or the LGPL. If you do not delete
26  * the provisions above, a recipient may use your version of this file under
27  * the terms of any one of the MPL, the GPL or the LGPL.
28  */

29
30 package nextapp.echo2.app.table;
31
32 import java.io.Serializable JavaDoc;
33 import java.util.Iterator JavaDoc;
34
35 import nextapp.echo2.app.event.TableColumnModelListener;
36
37 /**
38  * A representation of the collection of <code>TableColumn</code>s of a
39  * <code>Table</code>.
40  */

41 public interface TableColumnModel
42 extends Serializable JavaDoc {
43     
44     /**
45      * Adds a table column to the end of the model.
46      *
47      * @param column the column to add
48      */

49     public void addColumn(TableColumn column);
50     
51     /**
52      * Adds a listener to be notified of updates to this
53      * <code>TableColumnModel</code>.
54      *
55      * @param l the listener to add
56      */

57     public void addColumnModelListener(TableColumnModelListener l);
58
59     /**
60      * Returns the <code>TableColumn</code> at the specified index.
61      *
62      * @param columnIndex the index
63      * @return the column
64      */

65     public TableColumn getColumn(int columnIndex);
66     
67     /**
68      * Returns the number of columns in the column model.
69      *
70      * @return the number of columns
71      */

72     public int getColumnCount();
73     
74     /**
75      * Returns the index of the table column with the given identifier.
76      *
77      * @param identifier the identifier
78      * @return the index
79      * @throws IllegalArgumentException if the value of <code>identifier</code>
80      * is null or if the no column was found with the given identifier
81      */

82     public int getColumnIndex(Object JavaDoc identifier);
83     
84     /**
85      * Returns an <code>Iterator</code> over the columns of the column model.
86      *
87      * @return the <code>Iterator</code>
88      */

89     public Iterator JavaDoc getColumns();
90     
91     /**
92      * Moves a table column to a new index within the model.
93      *
94      * @param columnIndex the index of the column to move
95      * @param newIndex the new index of the specified column
96      */

97     public void moveColumn(int columnIndex, int newIndex);
98     
99     /**
100      * Remove a table column from the model.
101      *
102      * @param column the column to remove
103      */

104     public void removeColumn(TableColumn column);
105     
106     /**
107      * Removes a listener from being notified of updates to this
108      * <code>TableColumnModel</code>.
109      *
110      * @param l the listener to remove
111      */

112     public void removeColumnModelListener(TableColumnModelListener l);
113 }
114
Popular Tags