public void handleEvent(Event arg0) {
TableItem[] itens = accountsTable.getSelection();
if (itens.length > 0) {
try {
String nameAccount = accountsTable.getSelection()[0].getText(1);
Account account = (Account) system.query(new GetAccountByName(nameAccount));
new AccountDialog(getParent().getShell(), getMySelf(), account).open();
} catch (Exception e) {
logger.error("GetAccountByName Exception: ", e);
}
}else{
setErrorMessage("Voc� deve selecionar uma conta para editar.");
}
}
});
data = new FormData();
data.top = new FormAttachment(addAccountButton, 5);
data.right = new FormAttachment(100, -10);
data.width = 80;
editAccountButton.setLayoutData(data);
transferAccountButton = new Button(area.getComponentsComposite(), SWT.PUSH);
transferAccountButton.setText("Transfer�ncia");
transferAccountButton.setEnabled(system.hasAccess("Transfer�ncia de Contas"));
transferAccountButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event arg0) {
try {
TableItem[] itens = accountsTable.getSelection();
if (itens.length > 0) {
Account account = (Account) system.query(new GetAccountByName(accountsTable.getSelection()[0].getText(1)));
if(account.isActive())
new TransferBetweenAccountsDialog(getParent().getShell(), getMySelf(), accountsTable.getSelection()[0].getText(0)).open();
else
setErrorMessage("Voc� deve selecionar uma conta ativa.");
}else{
setErrorMessage("Selecione uma conta para efetuar uma transfer�ncia.");
}
} catch (Exception e) {
logger.error("GetAccountByName exception: ", e);
}
}
});
data = new FormData();
data.top = new FormAttachment(editAccountButton, 5);
data.right = new FormAttachment(100, -10);
data.width = 80;
transferAccountButton.setLayoutData(data);
extractAccountButton = new Button(area.getComponentsComposite(), SWT.PUSH);
extractAccountButton.setText("Movimenta��o");
extractAccountButton.setEnabled(system.hasAccess("Movimenta��o de Contas"));
extractAccountButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event arg0) {
try {
Account account = (Account) system.query(new GetAccountByName(accountsTable.getSelection()[0].getText(1)));
GDWindowControl.getInstance().openFlowBankAccountControlCenter(account);
} catch (Exception e) {
logger.error("GetAccountByName Exception: ",e);
}
}