com.bigzip.plugin
Class ColumnInfo

java.lang.Object
  |
  +--com.bigzip.plugin.ColumnInfo
Direct Known Subclasses:
DateColumn, DoublePrecisionColumn, NumberColumn

public class ColumnInfo
extends java.lang.Object

Archive plugin's provide ColumnInfo objects to describe the extra column in the file table. The class defaults to a non-sortable, non-editable column that will use toString() on each cell to render it in a column with no heading.


Field Summary
static java.lang.String COMMON_CLASS_PROPERTY
           
static java.lang.String EDITABLE_PROPERTY
           
static java.lang.String EDITOR_PROPERTY
           
static java.lang.String HEADING_PROPERTY
           
static java.lang.String MAXIMUM_WIDTH_PROPERTY
           
static java.lang.String MINIMUM_WIDTH_PROPERTY
           
static java.lang.String PREFERRED_WIDTH_PROPERTY
           
static java.lang.String RENDERER_PROPERTY
           
static java.lang.String RESIZABLE_PROPERTY
           
static java.lang.String SORTABLE_PROPERTY
           
static java.lang.String SORTER_PROPERTY
           
 
Constructor Summary
ColumnInfo()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a listener to object.
protected  void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Fires a property change event to all the registered listeners.
 java.lang.Class getCommonClass()
          Returns a reference to the most common class for the information to be displayed in the column.
 javax.swing.table.TableCellEditor getEditor()
           
 java.lang.String getHeading()
           
 int getMaximumWidth()
           
 int getMinimumWidth()
           
 int getPreferredWidth()
           
 javax.swing.table.TableCellRenderer getRenderer()
           
 DataSorter getSorter()
           
 boolean isEditable()
           
 boolean isResizable()
           
 boolean isSortable()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a registered listener from the list of listenered to be notified when a change occurs in the object.
 void setCommonClass(java.lang.Class commonClass)
          Sets the most common class for the column.
 void setEditable(boolean editable)
          Sets whether the cells in the column are editable.
 void setEditor(javax.swing.table.TableCellEditor editor)
          Sets the editor to be used for editing cells in the column.
 void setHeading(java.lang.String heading)
          Sets the label to be used in the heading for the column.
 void setMaximumWidth(int maximumWidth)
          Sets the maximum width.
 void setMinimumWidth(int minimumWidth)
          Sets the minimum width.
 void setPreferredWidth(int preferredWidth)
          Sets the preferred width.
 void setRenderer(javax.swing.table.TableCellRenderer renderer)
          Sets the renderer to be used for displaying information in the cells in a column.
 void setResizable(boolean resizable)
          Sets whether the column can be resized by the user.
 void setSortable(boolean sortable)
          Sets whether the column can be sorted.
 void setSorter(DataSorter sorter)
          Sets the sorter to be used when the column is sorted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMON_CLASS_PROPERTY

public static final java.lang.String COMMON_CLASS_PROPERTY

EDITABLE_PROPERTY

public static final java.lang.String EDITABLE_PROPERTY

EDITOR_PROPERTY

public static final java.lang.String EDITOR_PROPERTY

HEADING_PROPERTY

public static final java.lang.String HEADING_PROPERTY

MAXIMUM_WIDTH_PROPERTY

public static final java.lang.String MAXIMUM_WIDTH_PROPERTY

MINIMUM_WIDTH_PROPERTY

public static final java.lang.String MINIMUM_WIDTH_PROPERTY

PREFERRED_WIDTH_PROPERTY

public static final java.lang.String PREFERRED_WIDTH_PROPERTY

RENDERER_PROPERTY

public static final java.lang.String RENDERER_PROPERTY

RESIZABLE_PROPERTY

public static final java.lang.String RESIZABLE_PROPERTY

SORTABLE_PROPERTY

public static final java.lang.String SORTABLE_PROPERTY

SORTER_PROPERTY

public static final java.lang.String SORTER_PROPERTY
Constructor Detail

ColumnInfo

public ColumnInfo()
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to object. The listener will be notified of changes to the properties of the object.
Parameters:
listener - The PropertyChangeListener to be notified.

firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Fires a property change event to all the registered listeners.
Parameters:
propertyName - The name of the property that has changed.
oldValue - The previous value of the property.
newValue - The new value of the property.

getCommonClass

public java.lang.Class getCommonClass()
Returns a reference to the most common class for the information to be displayed in the column. The user interface will use this information to provide the best rendering it can if not renderer is provided.
Returns:
The most common class.

getEditor

public javax.swing.table.TableCellEditor getEditor()
Returns:
The editor that will be used to edit a cell in the column, null if a default editor or no editor is to be used.
See Also:
isEditable()

getHeading

public java.lang.String getHeading()
Returns:
The label to be used in the heading for the column.

getMaximumWidth

public int getMaximumWidth()
Returns:
The maximum width that the column can become.

getMinimumWidth

public int getMinimumWidth()
Returns:
The minimum width that the column can become.

getPreferredWidth

public int getPreferredWidth()
Returns:
The preferred column width.

getRenderer

public javax.swing.table.TableCellRenderer getRenderer()
Returns:
The renderer that will be used to display information in the cells of the column, or null if a default renderer is to be used.

getSorter

public DataSorter getSorter()
Returns:
The sorter that will be used to sort the information in the column or null if the default string collator is to be used or the column is not sortable.
See Also:
isSortable()

isEditable

public boolean isEditable()
Returns:
True if the column is editable. The editor provided by getEditor() will be used to allow the editing or a default editor will be used if getEditor() returns null.

isResizable

public boolean isResizable()
Returns:
True if the user can resize the column.

isSortable

public boolean isSortable()
Returns:
True if the column is sortable. The sorter proviced by getSorter() will be used to allow the sorting of the column or the default string collator will be used if getSorter() returns null.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a registered listener from the list of listenered to be notified when a change occurs in the object.
Parameters:
listener - The PropertyChangeListener to be removed.

setCommonClass

public void setCommonClass(java.lang.Class commonClass)
Sets the most common class for the column.
Parameters:
commonClass - The most common class.

setEditable

public void setEditable(boolean editable)
Sets whether the cells in the column are editable.
Parameters:
editable - True if the cells are editable.

setEditor

public void setEditor(javax.swing.table.TableCellEditor editor)
Sets the editor to be used for editing cells in the column.
Parameters:
columnClass - The editor, null if the column is not editable or if the default editor is to be used.

setHeading

public void setHeading(java.lang.String heading)
Sets the label to be used in the heading for the column.
Parameters:
heading - The column's heading.

setMaximumWidth

public void setMaximumWidth(int maximumWidth)
Sets the maximum width.
Parameters:
maxWidth - The maximum width the column can become.

setMinimumWidth

public void setMinimumWidth(int minimumWidth)
Sets the minimum width.
Parameters:
minWidth - The minimum width the column can become.

setPreferredWidth

public void setPreferredWidth(int preferredWidth)
Sets the preferred width.
Parameters:
preferredWidth - The preferred column width.

setRenderer

public void setRenderer(javax.swing.table.TableCellRenderer renderer)
Sets the renderer to be used for displaying information in the cells in a column.
Parameters:
renderer - The cell renderer for the column or null if a default renderer if to be used.

setResizable

public void setResizable(boolean resizable)
Sets whether the column can be resized by the user.
Parameters:
resizable - True if the user can resize the column.

setSortable

public void setSortable(boolean sortable)
Sets whether the column can be sorted.
Parameters:
sortable - True if the column is sortable.

setSorter

public void setSorter(DataSorter sorter)
Sets the sorter to be used when the column is sorted.
Parameters:
sorter - The column sorter or null if the default string collator is to be used.