Package org.ka2ddo.yaac.gui.pluginstore
Class PluginStoreTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.pluginstore.PluginStoreTableModel
- All Implemented Interfaces:
Serializable
,TableModel
,ColumnSizingTableModel
public final class PluginStoreTableModel
extends AbstractTableModel
implements ColumnSizingTableModel
This table model allows the user to see what officially provided plugins are available and/or
already installed. The list of available plugins is downloaded from the author's website
or SourceForge alternate, and the list of currently installed plugins is obtained from
the plugin management code within YAAC, and the combination (minus the default core plugin)
is displayed as a table.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ConstructorDescriptionCreate a PluginStoreTableModel from the local plugin registry and the list of available plugins from either the author's website or the SourceForge project. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>
getColumnClass
(int columnIndex) Returns Class of column content.int
Returns the number of columns in the model.getColumnName
(int column) Returns the name for the column.int
getColumnWidth
(int columnIndex) Specifies the default initial width of a column from this model.int
Returns the number of rows in the model.getValueAt
(int rowIndex, int columnIndex) Returns the value for the cell atcolumnIndex
androwIndex
.boolean
isCellEditable
(int rowIndex, int columnIndex) Specifies that pushbuttons are usable.boolean
isSizeToFit
(int columnIndex) Specifies whether setWidthToFit() should be enabled on this column.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener, setValueAt
-
Constructor Details
-
PluginStoreTableModel
public PluginStoreTableModel()Create a PluginStoreTableModel from the local plugin registry and the list of available plugins from either the author's website or the SourceForge project.
-
-
Method Details
-
getColumnCount
public int getColumnCount()Returns the number of columns in the model. AJTable
uses this method to determine how many columns it should create and display by default.- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- the number of columns in the model
- See Also:
-
getRowCount
public int getRowCount()Returns the number of rows in the model. AJTable
uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.- Specified by:
getRowCount
in interfaceTableModel
- Returns:
- the number of rows in the model
- See Also:
-
getValueAt
Returns the value for the cell atcolumnIndex
androwIndex
.- Specified by:
getValueAt
in interfaceTableModel
- Parameters:
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queried- Returns:
- the value Object at the specified cell
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) Specifies that pushbuttons are usable.- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
- Parameters:
rowIndex
- the row being queriedcolumnIndex
- the column being queried- Returns:
- boolean true if column can be edited
-
getColumnClass
Returns Class of column content.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
columnIndex
- the column being queried- Returns:
- the Class of data in that column
-
getColumnName
Returns the name for the column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- the column being queried- Returns:
- a string containing the name of
column
-
getColumnWidth
public int getColumnWidth(int columnIndex) Specifies the default initial width of a column from this model. Should only be queried at table creation time.- Specified by:
getColumnWidth
in interfaceColumnSizingTableModel
- Parameters:
columnIndex
- int index of the model's column whose width should be obtained- Returns:
- the width, in the same units used by the TableColumn class's setWidth() method, or -1 to indicate the width should not be forced
-
isSizeToFit
public boolean isSizeToFit(int columnIndex) Specifies whether setWidthToFit() should be enabled on this column.- Specified by:
isSizeToFit
in interfaceColumnSizingTableModel
- Parameters:
columnIndex
- int index of the model's column whose width should be obtained- Returns:
- boolean true if sizeWidthToFit() should be called on this column
-