|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.antelmann.util.table.AbstractObjectTableModel<T>
com.antelmann.util.table.MethodTableModel<T>
public class MethodTableModel<T>
a table model that displays/edits a list of objects based on the return value of given method names using reflection. This class also supports fields if no method name is available.
PatternTableModel,
Serialized Form| Field Summary |
|---|
| Fields inherited from class com.antelmann.util.table.AbstractObjectTableModel |
|---|
columnNames, columnTypes |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
MethodTableModel(Class<T> classType,
Collection<? extends T> col,
String... methodNames)
|
|
MethodTableModel(Class<T> classType,
String... methodNames)
|
|
| Method Summary | ||
|---|---|---|
static
|
allEditableFrom(Class<T> type)
|
|
static ArrayList<String> |
allFrom(Class<?> type)
|
|
Class<?> |
getColumnClass(int column)
|
|
int |
getColumnCount()
|
|
String |
getColumnName(int column)
returns the method name which may be altered according to Beans specifications (i.e. |
|
Class<T> |
getModelClass()
returns the class this model is base on |
|
AccessibleObject |
getRepresentationFor(int column)
returns either the method or the field associated with the given column |
|
String |
getSetterMethodName(int column)
|
|
Object |
getValueAt(int row,
int column)
|
|
boolean |
isCellEditable(int row,
int column)
returns true only if there is a method with a presumed setter name with a single argument and return type of void and no further settings apply |
|
boolean |
isColumnEditable(int column)
|
|
boolean |
isEnsureAccessibility()
|
|
boolean |
isReadOnly()
if true, all cells are read-only, regardless of other (column-specific) settings |
|
void |
refreshAll(Collection<? extends T> col,
String... methodNames)
alters both: rows and columns |
|
void |
setEnsureAccessibility(boolean ensureAccessibility)
|
|
void |
setReadOnly(boolean readOnly)
|
|
void |
setReadOnlyColumns(int... columnIndex)
|
|
void |
setReadOnlyColumns(String... columnNames)
|
|
void |
setValueAt(Object value,
int row,
int column)
attempts to use a setter method to set the value |
|
| Methods inherited from class com.antelmann.util.table.AbstractObjectTableModel |
|---|
add, add, clear, contains, getList, getRelevantList, getRelevantListDescription, getRowCount, getRowFor, getRowValue, iterator, moveDown, moveUp, refreshContent, remove, remove, setColumnName, setColumnNames, setColumnType, setColumnTypes, setRowValues, swap |
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
| 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 |
| Constructor Detail |
|---|
public MethodTableModel(Class<T> classType,
String... methodNames)
public MethodTableModel(Class<T> classType,
Collection<? extends T> col,
String... methodNames)
throws IllegalArgumentException
IllegalArgumentException| Method Detail |
|---|
public static <T> String[] allEditableFrom(Class<T> type)
public static ArrayList<String> allFrom(Class<?> type)
public Class<T> getModelClass()
public boolean isEnsureAccessibility()
public void setEnsureAccessibility(boolean ensureAccessibility)
public AccessibleObject getRepresentationFor(int column)
public void refreshAll(Collection<? extends T> col,
String... methodNames)
throws IllegalArgumentException
IllegalArgumentExceptionpublic int getColumnCount()
public Object getValueAt(int row,
int column)
public boolean isReadOnly()
public void setReadOnly(boolean readOnly)
public void setReadOnlyColumns(int... columnIndex)
public void setReadOnlyColumns(String... columnNames)
public boolean isCellEditable(int row,
int column)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModelsetReadOnly(boolean),
setReadOnlyColumns(int...),
setReadOnlyColumns(String...)public boolean isColumnEditable(int column)
public String getColumnName(int column)
getColumnName in interface TableModelgetColumnName in class AbstractObjectTableModel<T>AbstractObjectTableModel.setColumnName(int, String)public Class<?> getColumnClass(int column)
getColumnClass in interface TableModelgetColumnClass in class AbstractObjectTableModel<T>
public void setValueAt(Object value,
int row,
int column)
setValueAt in interface TableModelsetValueAt in class AbstractTableModelpublic String getSetterMethodName(int column)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||