throw new RuntimeException(ex);
}
}
}
else if ("clearButton".equals(event.getActionCommand())) {
this.currentAccount = new Account();
this.title.setText("");
this.description.setText("");
updateParentList();
checkButtonStatus();
tabbedPane.setEnabledAt(1, false);
}
else if ("saveButton".equals(event.getActionCommand())) {
this.currentAccount.setTitle(this.title.getText());
this.currentAccount.setDescription(this.description.getText());
if (parentAccount.getSelectedItem() instanceof TreeAccount) {
this.currentAccount.setParentAccount((Account)parentAccount.getSelectedItem());
}
else {
this.currentAccount.setParentAccount(null);
}
AccountDAO accountDAO = (AccountDAO)this.daoFactory.getDAO("account");
accountDAO.store(this.currentAccount, false);
buildAccountTree();
updateRegisterTableData();
tabbedPane.setEnabledAt(1, true);
}
else if ("deleteButton".equals(event.getActionCommand())) {
AccountDAO accountDAO = (AccountDAO)this.daoFactory.getDAO("account");
accountDAO.delete(this.currentAccount);
this.currentAccount = new Account();
this.title.setText("");
this.description.setText("");
updateParentList();
buildAccountTree();
updateRegisterTableData();