Class PropertiesTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- de.alpharogroup.swing.table.model.properties.PropertiesTableModel
-
- All Implemented Interfaces:
java.io.Serializable,javax.swing.table.TableModel
public class PropertiesTableModel extends javax.swing.table.AbstractTableModelThe classPropertiesTableModel.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropertiesTableModel()Instantiates a newPropertiesTableModel.PropertiesTableModel(java.util.Properties properties)Instantiates a newPropertiesTableModel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String key, java.lang.String value)Adds the row from the given key and value.voidadd(java.util.Properties properties)Adds the given Properties.voidclear()Removes all data from this table model.java.lang.Stringget(int row)Gets the value from the given index.java.lang.Stringget(java.lang.String key)Gets the Object from the given key.java.lang.Class<?>getColumnClass(int columnIndex)intgetColumnCount()java.lang.StringgetColumnName(int columnIndex)java.util.PropertiesgetData()Gets the data.intgetRowCount()java.lang.ObjectgetValueAt(int rowIndex, int columnIndex)java.lang.Stringremove(java.lang.String key)Removes the Object from the given key.voidsetData(java.util.Properties properties)Sets the new properties.protected voidsetProperties(java.util.Properties properties)Sets the properties.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Constructor Detail
-
PropertiesTableModel
public PropertiesTableModel()
Instantiates a newPropertiesTableModel.
-
PropertiesTableModel
public PropertiesTableModel(java.util.Properties properties)
Instantiates a newPropertiesTableModel.- Parameters:
properties- the properties to set.
-
-
Method Detail
-
add
public void add(java.util.Properties properties)
Adds the given Properties.- Parameters:
properties- the properties to add.
-
add
public void add(java.lang.String key, java.lang.String value)Adds the row from the given key and value.- Parameters:
key- the keyvalue- the value
-
clear
public void clear()
Removes all data from this table model.
-
get
public java.lang.String get(int row)
Gets the value from the given index.- Parameters:
row- The index from the row to get.- Returns:
- the row from the given index.
-
get
public java.lang.String get(java.lang.String key)
Gets the Object from the given key.- Parameters:
key- the key- Returns:
- the Object from the given key.
-
getColumnClass
public java.lang.Class<?> getColumnClass(int columnIndex)
- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classjavax.swing.table.AbstractTableModel
-
getColumnCount
public int getColumnCount()
-
getColumnName
public java.lang.String getColumnName(int columnIndex)
- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classjavax.swing.table.AbstractTableModel
-
getData
public java.util.Properties getData()
Gets the data.- Returns:
- the data
-
getRowCount
public int getRowCount()
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
-
remove
public java.lang.String remove(java.lang.String key)
Removes the Object from the given key.- Parameters:
key- the key- Returns:
- the removed Object or null if the object is not in the tablemodel.
-
setData
public void setData(java.util.Properties properties)
Sets the new properties.- Parameters:
properties- the new properties
-
setProperties
protected void setProperties(java.util.Properties properties)
Sets the properties.- Parameters:
properties- the new properties
-
-