jgnash.ui.components
Class AutoCompleteFactory

java.lang.Object
  extended by jgnash.ui.components.AutoCompleteFactory

public class AutoCompleteFactory
extends java.lang.Object

This factory class generates AutoCompleteTextFields that share a common model to reduce the amount of overhead.

Version:
$Id$
Author:
Craig Cavanaugh, Don Brown

Nested Class Summary
private static class AutoCompleteFactory.MemoModel
           
private static class AutoCompleteFactory.PayeeAccountModel
          This model stores the transaction with the payee field value.
private static class AutoCompleteFactory.PayeeModel
          This model stores the transaction with the payee field value.
private static class AutoCompleteFactory.TransactionModel
           
 
Field Summary
private static java.lang.String AUTO_COMPLETE
           
private static boolean autoComplete
           
private static AutoCompleteModel memoModel
           
 
Constructor Summary
private AutoCompleteFactory()
           
 
Method Summary
static javax.swing.JTextField getMemoField()
          Returns an auto-complete field that knows about transaction memos.
static javax.swing.JTextField getPayeeField(Account account)
          Returns an auto-complete field that knows about transaction payees.
static boolean isEnabled()
          Returns the status of auto completion
static void setEnabled(boolean auto)
          Sets the availability of the auto-completion ability
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

memoModel

private static AutoCompleteModel memoModel

autoComplete

private static boolean autoComplete

AUTO_COMPLETE

private static final java.lang.String AUTO_COMPLETE
See Also:
Constant Field Values
Constructor Detail

AutoCompleteFactory

private AutoCompleteFactory()
Method Detail

setEnabled

public static void setEnabled(boolean auto)
Sets the availability of the auto-completion ability

Parameters:
auto - enabled state

isEnabled

public static boolean isEnabled()
Returns the status of auto completion

Returns:
true is auto completion is enabled, false otherwise

getMemoField

public static javax.swing.JTextField getMemoField()
Returns an auto-complete field that knows about transaction memos.

Returns:
A plain JTextField or an AutoCompleteTextField.

getPayeeField

public static javax.swing.JTextField getPayeeField(Account account)
Returns an auto-complete field that knows about transaction payees.

Parameters:
account - account this payee field will match
Returns:
A plain JTextField or an AutoCompleteTextField.