|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JTable | +--util.swing.JAbstractTable
A JTable
that prefers models that are lists of records. A JAbstractTable
always must
be used together with an AbstractTableModel
.
Also JAbstractTable
supports one selection observer which is basically an int value that
will always contain the index of the currently selected record in the table. Setting up such an observer is
quite straightforward:
int[] anSelection = new int[1]; JAbstractTable jat = new JAbstractTable (...); jat.setSelectionObserver (anSelection);
To use this observer write code like the following:
... Object oSelectedRecord = ((util.swing.AbstractTableModel) jat.getModel()).getRecord (anSelection[0]); if (oSelectedRecord != null) { ... }
Note that although you only use the actual int value, you still have to set up an array of int values. The current selection will always be written to the first element in this array, no matter how long the actual array is.
Note: This class is not meant to be serialized!
AbstractTableModel
,
TableEntryDescriptor
, Serialized FormInner classes inherited from class javax.swing.JTable |
JTable.AccessibleJTable |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
JAbstractTable(AbstractTableModel atm)
Construct a new JAbstractTable that is based on an AbstractTableModel . |
Method Summary | |
void |
setSelectionObserver(int[] anSelection)
Set a selection observer for this table. |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setLayout,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public JAbstractTable(AbstractTableModel atm)
AbstractTableModel
.atm
- the TableModel to be used with this table.Method Detail |
public void setSelectionObserver(int[] anSelection)
anSelection
- the selection observer
|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |