|
Preferences Editor | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
de.jppietsch.prefedit.PreferencesTableModel
A table model to display a Preferences
as a table where each entry is
a row. The keys are in column 0 and the values are in column 2.
Field Summary | |
private static String[] |
EMPTY_KEYS
Description of the Field |
private static int |
KEY_COLUMN
Description of the Field |
private Preferences |
preferences
Description of the Field |
private RscBundle |
rsc
Resource bundle which delivers column names etc. |
static int |
VALUE_COLUMN
Description of the Field |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
PreferencesTableModel()
|
Method Summary | |
int |
getColumnCount()
Gets the columnCount attribute of the PreferencesTableModel object |
String |
getColumnName(int aColumnIndex)
Returns the name of a column from the resource bundle's
resources Rsc.KEY_COLUMN_NAME and Rsc.VALUE_COLUMN_NAME . |
int |
getRowCount()
Gets the rowCount attribute of the PreferencesTableModel object |
Object |
getValueAt(int aRowIndex,
int aColumnIndex)
Gets the valueAt attribute of the PreferencesTableModel object |
boolean |
isCellEditable(int aRowIndex,
int aColumnIndex)
Returns true for the right column, because the preferences
values are editable, but not their keys. |
private String |
key(int aRowIndex)
Description of the Method |
private String[] |
keys()
Description of the Method |
void |
preferenceChange(PreferenceChangeEvent anEvent)
Fires a table data changed event. |
void |
setPreferences(Preferences somePreferences)
Assigns a preferences node to this table model. |
void |
setValueAt(Object aValue,
int aRowIndex,
int aColumnIndex)
Changes the value of a preference. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int VALUE_COLUMN
private static final int KEY_COLUMN
private static final String[] EMPTY_KEYS
private Preferences preferences
private final RscBundle rsc
Constructor Detail |
public PreferencesTableModel()
Method Detail |
public int getRowCount()
getRowCount
in interface TableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public String getColumnName(int aColumnIndex)
resource bundle's
resources Rsc.KEY_COLUMN_NAME
and Rsc.VALUE_COLUMN_NAME
.
getColumnName
in interface TableModel
aColumnIndex
- KEY_COLUMN
oder VALUE_COLUMN
.
public boolean isCellEditable(int aRowIndex, int aColumnIndex)
true
for the right column, because the preferences
values are editable, but not their keys.
isCellEditable
in interface TableModel
aRowIndex
- Is ignored, there is no difference between the rows.aColumnIndex
- 0
is not editable, but 1
is.
aColumnIndex==1
.public Object getValueAt(int aRowIndex, int aColumnIndex)
getValueAt
in interface TableModel
aRowIndex
- Description of ParameteraColumnIndex
- Description of Parameter
public void setValueAt(Object aValue, int aRowIndex, int aColumnIndex)
setValueAt
in interface TableModel
aValue
- Must be a string.aRowIndex
- Determines the key of the preference to be changed.aColumnIndex
- Must be 1
because that's the values
column's index.public void setPreferences(Preferences somePreferences)
somePreferences
- The preferences object to be displayed or null
if there is none (e.g. for the tree's root node).public void preferenceChange(PreferenceChangeEvent anEvent)
preferenceChange
in interface PreferenceChangeListener
anEvent
- is currently not used, but may be in future.private String key(int aRowIndex)
aRowIndex
- Description of Parameter
private String[] keys()
|
Preferences Editor | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |