Methods Summary |
---|
public java.util.Enumeration | children()
return new RootNode.IteratorEnumeration(children.iterator());
|
public boolean | getAllowsChildren()
return !isLeaf();
|
public javax.swing.tree.TreeNode | getChildAt(int ind)
return (TreeNode)getChildren().get(ind);
|
public int | getChildCount()
return getChildren().size();
|
private synchronized java.util.ArrayList | getChildren()
if( children == null ) {
load();
}
return children;
|
public com.imaginary.bank.CustomerFacade | getCustomer()
return customer;
|
public int | getIndex(javax.swing.tree.TreeNode chld)
return getChildren().indexOf(chld);
|
public javax.swing.tree.TreeNode | getParent()
return parent;
|
public boolean | isLeaf()
if( parent instanceof AccountNode ) {
return true;
}
else {
return false;
}
|
private void | load()
TellerApp.notifyWait();
try {
if( customer == null ) {
CustomerHome home;
children = new ArrayList();
try {
String[] pre = { "firstName", "lastName" };
SearchCriteria sc;
Iterator it;
home = (CustomerHome)BaseHome.getInstance(Identifier.currentIdentifier(),
Customer.class);
sc = new SearchCriteria(pre);
it = home.find(Identifier.currentIdentifier(), sc).iterator();
while( it.hasNext() ) {
CustomerFacade cust = (CustomerFacade)it.next();
children.add(new CustomerNode(this, cust));
}
}
catch( RemoteException e ) {
e.printStackTrace();
return;
}
catch( FindException e ) {
e.printStackTrace();
return;
}
catch( TransactionException e ) {
e.printStackTrace();
return;
}
}
else {
Iterator it;
children = new ArrayList();
try {
it = customer.getAccounts().iterator();
}
catch( RemoteException e ) {
e.printStackTrace();
return;
}
while( it.hasNext() ) {
AccountFacade acct = (AccountFacade)it.next();
children.add(new AccountNode(this, acct));
}
}
}
finally {
TellerApp.notifyResume();
}
|
public java.lang.String | toString()
if( customer == null ) {
return "Customers";
}
else {
try {
TellerApp.notifyWait();
return (customer.getLastName() + ", " +
customer.getFirstName());
}
catch( RemoteException e ) {
e.printStackTrace();
return "ERROR";
}
finally {
TellerApp.notifyResume();
}
}
|