1 |
/* TableColumnModel.java -- |
/* TableColumnModel.java -- |
2 |
Copyright (C) 2002, 2004 Free Software Foundation, Inc. |
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
40 |
|
|
41 |
import java.util.Enumeration; |
import java.util.Enumeration; |
42 |
|
|
43 |
|
import javax.swing.JTable; |
44 |
import javax.swing.ListSelectionModel; |
import javax.swing.ListSelectionModel; |
45 |
import javax.swing.event.TableColumnModelListener; |
import javax.swing.event.TableColumnModelListener; |
46 |
|
|
47 |
/** |
/** |
48 |
* TableColumnModel public interface |
* The interface used by {@link JTable} to access the columns in the table |
49 |
|
* view. |
50 |
|
* |
51 |
* @author Andrew Selkirk |
* @author Andrew Selkirk |
52 |
*/ |
*/ |
53 |
public interface TableColumnModel |
public interface TableColumnModel |
54 |
{ |
{ |
55 |
/** |
/** |
56 |
* addColumn |
* Adds a column to the model. |
57 |
* @param column TableColumn |
* |
58 |
|
* @param column the new column (<code>null</code> not permitted). |
59 |
|
* |
60 |
|
* @throws IllegalArgumentException if <code>column</code> is |
61 |
|
* <code>null</code>. |
62 |
*/ |
*/ |
63 |
void addColumn(TableColumn column); |
void addColumn(TableColumn column); |
64 |
|
|
65 |
/** |
/** |
66 |
* removeColumn |
* Removes a column from the model. If <code>column</code> is not defined |
67 |
|
* in the model, this method does nothing. |
68 |
|
* |
69 |
* @param column TableColumn |
* @param column TableColumn |
70 |
*/ |
*/ |
71 |
void removeColumn(TableColumn column); |
void removeColumn(TableColumn column); |
72 |
|
|
73 |
/** |
/** |
74 |
* moveColumn |
* Moves a column. |
75 |
|
* |
76 |
* @param columnIndex Index of column to move |
* @param columnIndex Index of column to move |
77 |
* @param newIndex New index of column |
* @param newIndex New index of column |
78 |
*/ |
*/ |
85 |
void setColumnMargin(int margin); |
void setColumnMargin(int margin); |
86 |
|
|
87 |
/** |
/** |
88 |
* getColumnCount |
* Returns the number of columns in the model. |
89 |
* @return Column count |
* |
90 |
|
* @return The column count |
91 |
*/ |
*/ |
92 |
int getColumnCount(); |
int getColumnCount(); |
93 |
|
|
98 |
Enumeration getColumns(); |
Enumeration getColumns(); |
99 |
|
|
100 |
/** |
/** |
101 |
* getColumnIndex |
* Returns the index of the {@link TableColumn} with the given identifier. |
102 |
* @param columnIdentifier Column id |
* |
103 |
|
* @param identifier the identifier (<code>null</code> not permitted). |
104 |
|
* |
105 |
|
* @return The index of the {@link TableColumn} with the given identifier. |
106 |
|
* |
107 |
|
* @throws IllegalArgumentException if <code>identifier</code> is |
108 |
|
* <code>null</code> or there is no column with that identifier. |
109 |
*/ |
*/ |
110 |
int getColumnIndex(Object columnIdentifier); |
int getColumnIndex(Object columnIdentifier); |
111 |
|
|
112 |
/** |
/** |
113 |
* getColumn |
* Returns the <code>TableColumn</code> at the specified index. |
114 |
* @param columnIndex Index of column |
* |
115 |
|
* @param columnIndex the column index. |
116 |
|
* |
117 |
|
* @return The table column. |
118 |
*/ |
*/ |
119 |
TableColumn getColumn(int columnIndex); |
TableColumn getColumn(int columnIndex); |
120 |
|
|
121 |
/** |
/** |
122 |
* getColumnMargin |
* Returns the column margin. |
123 |
* @return Column margin |
* |
124 |
|
* @return The column margin. |
125 |
*/ |
*/ |
126 |
int getColumnMargin(); |
int getColumnMargin(); |
127 |
|
|