org.jbudget.gui.budget
Class BudgetSelectorModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by org.jbudget.gui.budget.BudgetSelectorModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.ListModel

public class BudgetSelectorModel
extends javax.swing.AbstractListModel

A list model for selecting budget.

Author:
petrov
See Also:
Serialized Form

Field Summary
private  java.util.List<Pair<java.lang.Integer,java.lang.String>> availableBudgets
           
private  EventDispatcher.BudgetListener listener
           
private  boolean showUnused
          if true only unused budgets are shown
private  boolean wasDisposed
          Guard variable
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
BudgetSelectorModel(boolean showUnused)
          Creates a new instance of BudgetSelectorModel
 
Method Summary
 void dispose()
          Frees resources
 void finalize()
           
 java.lang.Object getElementAt(int i)
          Returns the element at the appropriate location
 int getSize()
          Returns the number of available budgets
private  void initialize()
          Gets a list of available budgets from the DataManager
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showUnused

private final boolean showUnused
if true only unused budgets are shown


availableBudgets

private java.util.List<Pair<java.lang.Integer,java.lang.String>> availableBudgets

listener

private EventDispatcher.BudgetListener listener

wasDisposed

private boolean wasDisposed
Guard variable

Constructor Detail

BudgetSelectorModel

public BudgetSelectorModel(boolean showUnused)
Creates a new instance of BudgetSelectorModel

Method Detail

dispose

public void dispose()
Frees resources


finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

initialize

private void initialize()
Gets a list of available budgets from the DataManager


getElementAt

public java.lang.Object getElementAt(int i)
Returns the element at the appropriate location


getSize

public int getSize()
Returns the number of available budgets