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 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 CustomerNode ) {
return true;
}
else {
return false;
}
|
private void | load()
TellerApp.notifyWait();
try {
if( account == null ) {
AccountHome home;
children = new ArrayList();
try {
String[] pre = { "number" };
SearchCriteria sc;
Iterator it;
home = (AccountHome)BaseHome.getInstance(Identifier.currentIdentifier(),
Account.class);
sc = new SearchCriteria(pre);
it = home.find(Identifier.currentIdentifier(), sc).iterator();
while( it.hasNext() ) {
AccountFacade acct = (AccountFacade)it.next();
children.add(new AccountNode(this, acct));
}
}
catch( RemoteException e ) {
e.printStackTrace();
return;
}
catch( FindException e ) {
e.printStackTrace();
return;
}
catch( TransactionException e ) {
e.printStackTrace();
return;
}
}
else {
CustomerFacade cust;
children = new ArrayList();
try {
cust = account.getCustomer();
}
catch( RemoteException e ) {
e.printStackTrace();
return;
}
children.add(new CustomerNode(this, cust));
}
}
finally {
TellerApp.notifyResume();
}
|
public java.lang.String | toString()
if( account == null ) {
return "Accounts";
}
else {
TellerApp.notifyWait();
try {
return ("" + account.getNumber());
}
catch( RemoteException e ) {
e.printStackTrace();
return "ERROR";
}
finally {
TellerApp.notifyResume();
}
}
|