|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbutler.swing.record.RecordController
public class RecordController
Controls editing of one record. This class keeps tracks of the column editors and does the right thing at save and new operations.
Field Summary | |
---|---|
static java.lang.String |
DELETE_ACTION_COMMAND
|
static java.lang.String |
NEW_ACTION_COMMAND
|
static java.lang.String |
SAVE_ACTION_COMMAND
|
Constructor Summary | |
---|---|
RecordController(Record rec)
|
|
RecordController(Table tab)
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addChangeListener(javax.swing.event.ChangeListener listener)
|
void |
addRecordSelectionListener(RecordSelectionListener listener)
|
ValueEditor |
createEditor(Column col)
Creates and registers a appropiate editor for given column. |
void |
deleteRecord()
|
java.awt.event.ActionListener |
getDeleteListener()
|
java.awt.event.ActionListener |
getNewListener()
|
Record |
getRecord()
|
SaveAction |
getSaveAction()
|
java.awt.event.ActionListener |
getSaveListener()
Deprecated. Use getSaveAction |
Table |
getTable()
|
boolean |
isDirty()
|
boolean |
isRecordEdited()
|
void |
newRecord()
|
void |
recordListSelected(RecordList recList)
|
void |
recordSelected(Record rec)
|
void |
register(Column col,
RecordSelector selector)
Registers an record selector for a pk or fk column. |
void |
register(Column col,
ValueEditor editor)
Registers an editor for a column. |
void |
register(ForeignKey fk,
RecordSelector selector)
Registers an editor for a foreign key. |
void |
register(ManyToManyRelation relation,
RecordSelector selector)
|
void |
save()
|
void |
setListModel(RecordListModel model)
Sets the RecordListModel from which records are picked, if such exists. |
void |
setRecord(Record rec)
|
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SAVE_ACTION_COMMAND
public static final java.lang.String NEW_ACTION_COMMAND
public static final java.lang.String DELETE_ACTION_COMMAND
Constructor Detail |
---|
public RecordController(Table tab) throws java.lang.Exception
java.lang.Exception
public RecordController(Record rec) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public void register(Column col, ValueEditor editor)
col
- Columneditor
- Editorpublic void register(Column col, RecordSelector selector)
col
- Columnselector
- RecordSelectorpublic void register(ForeignKey fk, RecordSelector selector)
fk
- Foreign keyselector
- Record selectorpublic void register(ManyToManyRelation relation, RecordSelector selector)
public ValueEditor createEditor(Column col) throws java.lang.Exception
java.lang.Exception
public void setListModel(RecordListModel model)
public Table getTable()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void save() throws java.lang.Exception
java.lang.Exception
public void newRecord() throws java.lang.Exception
java.lang.Exception
public void deleteRecord() throws java.lang.Exception
java.lang.Exception
public void setRecord(Record rec) throws java.lang.Exception
java.lang.Exception
public Record getRecord()
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
public void recordSelected(Record rec) throws java.lang.Exception
recordSelected
in interface RecordSelectionListener
java.lang.Exception
public void recordListSelected(RecordList recList)
recordListSelected
in interface RecordSelectionListener
public void addChangeListener(javax.swing.event.ChangeListener listener)
public java.awt.event.ActionListener getSaveListener()
public java.awt.event.ActionListener getNewListener()
public java.awt.event.ActionListener getDeleteListener()
public void addRecordSelectionListener(RecordSelectionListener listener)
public boolean isDirty()
public SaveAction getSaveAction()
public boolean isRecordEdited()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |