jgnash.ui.components
Class AccountListComboBox.AbstractModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by jgnash.ui.components.AccountListComboBox.AbstractModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.ComboBoxModel, javax.swing.ListModel
Direct Known Subclasses:
AccountListComboBox.AccountTypeModel, AccountListComboBox.ChildrenModel, AccountListComboBox.ChildrenTypeModel, AccountListComboBox.DefaultModel, AccountListComboBox.FullModel, AccountListComboBox.ParentTypeModel, FilteredAccountListComboBox.FilteredModel
Enclosing class:
AccountListComboBox

protected abstract static class AccountListComboBox.AbstractModel
extends javax.swing.AbstractListModel
implements javax.swing.ComboBoxModel

See Also:
Serialized Form

Field Summary
(package private)  java.util.List<Account> accounts
           
(package private)  Account baseAccount
           
private  java.lang.Object lock
           
(package private)  java.lang.Object selectedItem
           
private static long serialVersionUID
           
(package private)  java.util.Set<AccountType> types
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
AccountListComboBox.AbstractModel()
           
AccountListComboBox.AbstractModel(Account exclude)
           
AccountListComboBox.AbstractModel(Account exclude, java.util.Set<AccountType> types)
           
 
Method Summary
private  void clear()
           
 java.lang.Object getElementAt(int index)
          Returns the value at the specified index.
 java.lang.Object getSelectedItem()
          Returns the selected item
 int getSize()
          Returns the length of the list.
protected  void loadAccounts()
           
protected abstract  void loadChildren(Account acc, java.util.List<Account> array)
           
 void messagePosted(Message event)
           
 void setSelectedItem(java.lang.Object anItem)
          Set the selected item.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

accounts

java.util.List<Account> accounts

baseAccount

Account baseAccount

selectedItem

java.lang.Object selectedItem

types

java.util.Set<AccountType> types

lock

private final java.lang.Object lock
Constructor Detail

AccountListComboBox.AbstractModel

public AccountListComboBox.AbstractModel()

AccountListComboBox.AbstractModel

public AccountListComboBox.AbstractModel(Account exclude,
                                         java.util.Set<AccountType> types)

AccountListComboBox.AbstractModel

public AccountListComboBox.AbstractModel(Account exclude)
Method Detail

loadAccounts

protected void loadAccounts()

loadChildren

protected abstract void loadChildren(Account acc,
                                     java.util.List<Account> array)

getElementAt

public java.lang.Object getElementAt(int index)
Returns the value at the specified index.

Specified by:
getElementAt in interface javax.swing.ListModel
Parameters:
index - the requested index
Returns:
the value at index

getSelectedItem

public java.lang.Object getSelectedItem()
Returns the selected item

Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel
Returns:
The selected item or null if there is no selection

getSize

public int getSize()
Returns the length of the list.

Specified by:
getSize in interface javax.swing.ListModel
Returns:
the length of the list

setSelectedItem

public void setSelectedItem(java.lang.Object anItem)
Set the selected item. The implementation of this method should notify all registered ListDataListeners that the contents have changed.

Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel
Parameters:
anItem - the list object to select or null to clear the selection

clear

private void clear()

messagePosted

public void messagePosted(Message event)