|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.TableColumn | +--dyntable.EntityTableColumn
$Id: EntityTableColumn.java,v 1.0 2005/09/25 jDynTable@gmx.de $
This class represents columns that are used with EntityTable.
The columns have attributes which determine how they behave and how
they are drawn onto the screen. Column-based sorting of rows in the table can
be enabled or disabled on a column by column basis. Similarly columns
can be hidden or visible to the user. Columns can also be locked, meaning
that they are always visible
even if the user pans through the other table columns.
The column also allows the user to specify one or both of a TableCellEditor
and a TableCellRenderer. The editor is responsible for editing
of the cell values within this column and it must be specified when
either custom behaviour is needed or a custom datatype must be edited.
The renderer is responsible for drawing the cell onto the screen.
When an editor and/or renderer is not provided, they are chosen based
on the Class parameter in the constructor. If the class is not provided
then a default editor and renderer will be used.
The following are some examples of what editors and renderers are used
by default (if no editor or renderer is provided):
Class Type or Type of Object | Editor | Renderer |
String.class | JTextField | JLabel |
Numbers | JTextField | JLabel |
Boolean.class | JCheckBox | JCheckBox |
Field Summary | |
---|---|
static int |
EDIT_LOCKED
Symbolic constant representing the column being edit locked. |
static int |
HIDDEN
Symbolic constant representing the column being hidden. |
static int |
RIGHT_ALIGNMENT_SORTABLE
Symbolic constant representing the column being right alignment sortable. |
static int |
SCROLL_LOCKED
Symbolic constant representing the column being scroll locked. |
static int |
UNSORTABLE
Symbolic constant representing the column being unsortable. |
Fields inherited from class javax.swing.table.TableColumn |
---|
CELL_RENDERER_PROPERTY, COLUMN_WIDTH_PROPERTY, HEADER_RENDERER_PROPERTY, HEADER_VALUE_PROPERTY |
Constructor Summary | |
---|---|
EntityTableColumn()
Constructs a new EntityTableColumn. |
|
EntityTableColumn(java.lang.Class columnClass)
Constructs a column without name of the given class. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass)
Constructs a column with the given name of the given class. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass,
int width)
Constructs a column with the given name, class, and width. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass,
int width,
int attrs)
Constructs a column with the given name, column class, width, and attributes. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass,
int width,
javax.swing.table.TableCellEditor editor)
Constructs a column with the given name, class, width, and cell editor. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass,
int width,
javax.swing.table.TableCellEditor editor,
int attrs)
Constructs a column with the given attributes. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass,
int width,
javax.swing.table.TableCellEditor editor,
javax.swing.table.TableCellRenderer renderer)
Constructs a column with the given attributes. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass,
int width,
javax.swing.table.TableCellEditor editor,
javax.swing.table.TableCellRenderer renderer,
int attrs)
Constructs a column with the given attributes. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass,
int width,
javax.swing.table.TableCellRenderer renderer)
Constructs a column with the given attributes. |
|
EntityTableColumn(java.lang.String columnName,
java.lang.Class columnClass,
int width,
javax.swing.table.TableCellRenderer renderer,
int attrs)
Constructs a column with the given attributes. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Returns true if this column has the same name as the specified column. |
javax.swing.table.TableCellEditor |
getCellEditor()
Returns the cell editor for this column. |
java.lang.Class |
getColumnClass()
Returns the class of this column. |
java.lang.String |
getName()
Returns the name of this column. |
boolean |
isEditable()
Returns true if the column is editable, false otherwise. |
boolean |
isHidden()
Returns true if this column is hidden, false otherwise. |
boolean |
isLocked()
Returns true if the column is locked, false otherwise. |
boolean |
isSortable()
Returns true if the column is sortable, false otherwise. |
void |
setColumnClass(java.lang.Class c)
Sets the class of this column. |
void |
setEditable(boolean newValue)
Enables or disables column editing. |
void |
setHidden(boolean newValue)
Hides or unhides this column. |
void |
setLocked(boolean newValue)
Enables or disables column locking. |
void |
setName(java.lang.String n)
Sets the name of the column. |
void |
setSortable(boolean newValue)
Enables or disables column sorting. |
Methods inherited from class javax.swing.table.TableColumn |
---|
addPropertyChangeListener, disableResizedPosting, enableResizedPosting, getCellRenderer, getHeaderRenderer, getHeaderValue, getIdentifier, getMaxWidth, getMinWidth, getModelIndex, getPreferredWidth, getPropertyChangeListeners, getResizable, getWidth, removePropertyChangeListener, setCellEditor, setCellRenderer, setHeaderRenderer, setHeaderValue, setIdentifier, setMaxWidth, setMinWidth, setModelIndex, setPreferredWidth, setResizable, setWidth, sizeWidthToFit |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SCROLL_LOCKED
public static final int UNSORTABLE
public static final int HIDDEN
public static final int EDIT_LOCKED
public static final int RIGHT_ALIGNMENT_SORTABLE
Constructor Detail |
public EntityTableColumn()
public EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass)
columnName
- the String name of the columncolumnClass
- the class of the columnpublic EntityTableColumn(java.lang.Class columnClass)
columnClass
- the class of the columnpublic EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass, int width)
columnName
- the String name of the columncolumnClass
- the class of the columnwidth
- the width of the columnpublic EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass, int width, int attrs)
columnName
- the String name of the columncolumnClass
- the class of the columnwidth
- the width of the columnattrs
- the attributes of the columnpublic EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass, int width, javax.swing.table.TableCellEditor editor)
columnName
- the String name of the columncolumnClass
- the class of the columnwidth
- the width of the columneditor
- the TableCellEditor for this columnpublic EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass, int width, javax.swing.table.TableCellEditor editor, int attrs)
columnName
- the name of the columncolumnClass
- the class of the columnwidth
- the width of the columneditor
- the TableCellEditor for this columnattrs
- the attributes of the column eg SCROLL_LOCKEDpublic EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass, int width, javax.swing.table.TableCellRenderer renderer)
columnName
- the String name of the columncolumnClass
- the class of the columnwidth
- the width of the columnrenderer
- the TableCellRenderer used to render the columnpublic EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass, int width, javax.swing.table.TableCellRenderer renderer, int attrs)
columnName
- the String name of the columncolumnClass
- the class of the columnwidth
- the width of the columnrenderer
- the TableCellRenderer used to render the columnattrs
- the attributes of the column eg SCROLL_LOCKEDpublic EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass, int width, javax.swing.table.TableCellEditor editor, javax.swing.table.TableCellRenderer renderer)
columnName
- the String name of the columncolumnClass
- the class of the columnwidth
- the width of the columneditor
- the TableCellEditor for this columnrenderer
- the TableCellRenderer used to render the columnpublic EntityTableColumn(java.lang.String columnName, java.lang.Class columnClass, int width, javax.swing.table.TableCellEditor editor, javax.swing.table.TableCellRenderer renderer, int attrs)
columnName
- the String name of the columncolumnClass
- the class of the columnwidth
- the width of the columneditor
- the TableCellEditor for this columnrenderer
- the TableCellRenderer used to render the columnattrs
- the attributes of the column eg SCROLL_LOCKEDMethod Detail |
public java.lang.String getName()
public void setName(java.lang.String n)
n
- the String representing the new namepublic java.lang.Class getColumnClass()
public void setColumnClass(java.lang.Class c)
c
- the new classpublic boolean isLocked()
public void setLocked(boolean newValue)
newValue
- locked if true, unlocked otherwisepublic boolean isSortable()
public void setSortable(boolean newValue)
newValue
- enables sorting if true, otherwise disables itpublic boolean isHidden()
public void setHidden(boolean newValue)
newValue
- hidden if true, visible otherwisepublic boolean isEditable()
public void setEditable(boolean newValue)
newValue
- editable if true, read-only otherwisepublic javax.swing.table.TableCellEditor getCellEditor()
getCellEditor
in class javax.swing.table.TableColumn
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the other object to compare with
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |