Package org.jfree.ui.about
Class SystemPropertiesTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.jfree.ui.SortableTableModel
-
- org.jfree.ui.about.SystemPropertiesTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
public class SystemPropertiesTableModel extends SortableTableModel
A sortable table model containing the system properties.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SystemPropertiesTableModel.SystemProperty
Useful class for holding the name and value of a system property.protected static class
SystemPropertiesTableModel.SystemPropertyComparator
A class for comparing SystemProperty objects.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
nameColumnLabel
Localised name column label.private java.util.List
properties
Storage for the properties.private java.lang.String
valueColumnLabel
Localised property column label.
-
Constructor Summary
Constructors Constructor Description SystemPropertiesTableModel()
Creates a new table model using the properties of the current Java Virtual Machine.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
Returns the number of columns in the table model.java.lang.String
getColumnName(int column)
Returns the name of the specified column.int
getRowCount()
Returns the number of rows in the table model (that is, the number of system properties).java.lang.Object
getValueAt(int row, int column)
Returns the value at the specified row and column.boolean
isSortable(int column)
Returns true for the first column, and false otherwise - sorting is only allowed on the first column.void
sortByColumn(int column, boolean ascending)
Sorts on the specified column.-
Methods inherited from class org.jfree.ui.SortableTableModel
getSortingColumn, isAscending, setAscending
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Method Detail
-
isSortable
public boolean isSortable(int column)
Returns true for the first column, and false otherwise - sorting is only allowed on the first column.- Overrides:
isSortable
in classSortableTableModel
- Parameters:
column
- the column index.- Returns:
- true for column 0, and false for all other columns.
-
getRowCount
public int getRowCount()
Returns the number of rows in the table model (that is, the number of system properties).- Returns:
- the row count.
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the table model. In this case, there are two columns: one for the property name, and one for the property value.- Returns:
- the column count (always 2 in this case).
-
getColumnName
public java.lang.String getColumnName(int column)
Returns the name of the specified column.- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
- Parameters:
column
- the column index.- Returns:
- the column name.
-
getValueAt
public java.lang.Object getValueAt(int row, int column)
Returns the value at the specified row and column. This method supports the TableModel interface.- Parameters:
row
- the row index.column
- the column index.- Returns:
- the value.
-
sortByColumn
public void sortByColumn(int column, boolean ascending)
Sorts on the specified column.- Overrides:
sortByColumn
in classSortableTableModel
- Parameters:
column
- the column index.ascending
- a flag that controls the sort order.
-
-