|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel edu.northwestern.at.wordhoard.swing.accounts.AccountModel
class AccountModel
Account model.
Each
manage accounts window
has a model which acts as a Swing table model,
manages all communications with the server session, and
maintains the following state information for the window:
Window components register
listeners
on the model to listen for and react appropriately to changes
in the state of the window.
Field Summary |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
AccountModel(WordHoardSession session,
AbstractWindow parentWindow)
Creates a new account model. |
Method Summary | |
---|---|
(package private) void |
addListener(AccountListener listener)
Adds a listener. |
(package private) void |
createAccount()
Creates a new account. |
(package private) void |
deleteAccounts()
Deletes the selected accounts. |
(package private) void |
err(java.lang.Exception e)
Handles an exception. |
int |
getColumnCount()
Gets the number of columns. |
java.lang.String |
getColumnName(int col)
Gets the name of a column. |
(package private) boolean |
getCreatingNewAccount()
Returns true if we are creating a new account. |
int |
getRowCount()
Gets the number of rows. |
(package private) Account |
getSelectedAccount()
Gets the currently selected account. |
(package private) int[] |
getSelection()
Gets the selection. |
java.lang.Object |
getValueAt(int row,
int col)
Gets the value of a cell. |
(package private) void |
init()
Initializes the model. |
(package private) void |
removeListener(AccountListener listener)
Removes a listener. |
(package private) void |
save(java.lang.String username,
java.lang.String name,
java.lang.String password,
boolean nuAccount,
boolean canManageAccounts)
Saves an account. |
void |
selectAccount(int index)
Requests that an account be selected. |
(package private) void |
setSelection(int[] selection)
Sets the selection. |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
AccountModel(WordHoardSession session, AbstractWindow parentWindow) throws java.lang.Exception
session
- Server session.parentWindow
- Parent window.
java.lang.Exception
Method Detail |
---|
public int getRowCount()
public int getColumnCount()
public java.lang.Object getValueAt(int row, int col)
row
- Row index.col
- Column index.
public java.lang.String getColumnName(int col)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
col
- Column index.
void init()
int[] getSelection()
void setSelection(int[] selection)
selection
- Array of indexes of selected accounts. Account getSelectedAccount()
void save(java.lang.String username, java.lang.String name, java.lang.String password, boolean nuAccount, boolean canManageAccounts) throws java.lang.Exception
username
- Username.name
- Name.password
- Password. For an existing account,
a null or empty value leaves the password
unchanged.nuAccount
- True if NU account.canManageAccounts
- True if user is permitted to manage
accounts.
java.lang.Exception
public void selectAccount(int index)
index
- Index of account to be selected. void createAccount()
boolean getCreatingNewAccount()
void deleteAccounts() throws java.lang.Exception
java.lang.Exception
void addListener(AccountListener listener)
listener
- Account listener. void removeListener(AccountListener listener)
listener
- Account listener. void err(java.lang.Exception e)
e
- Exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |