Exemple #1
0
  private StockBroker fillAndRegisterBroker(Broker broker) throws CoreException {
    if (StringCheck.isEmpty(txtCorretora.getText())) {
      throw new UIException(9300);
    }

    StockBroker logged = ContextHolderUI.getStockBrokerLogged();
    StockBroker added = action.addStockBroker(logged);
    ContextHolderUI.setStockBrokerSelected(added);

    broker.setStockBroker(added);

    /* Set<Broker> brokers = added.getBrokers();

    if (logged.getBrokers() == null) {
        brokers = new TreeSet<Broker>();
    }

    if (!brokers.contains(broker)) {
        brokers.add(broker);
    }*/

    broker.setName(txtCorretora.getText());

    String valueFixed = txtFixa.getText();

    if (StringCheck.isEmpty(valueFixed)) {
      throw new UIException(9304);
    }
    FixedTax tax = new FixedTax();
    tax.setFixed(true);
    try {
      tax.setValue(numberFormatter.parse(valueFixed.trim()).doubleValue());
    } catch (Exception e) {
      DialogUtil.errorMessage(
          dialogShell,
          "Dados Inválidos",
          "O formato dos valores está incorreto. Favor corrigir e tentar novamente.");
      return null;
    }
    broker.setTax(tax);

    action.addBroker(broker);

    return added;
  }
 public String getKey(Object receiver, AWComponent component) {
   WizardAction action = (WizardAction) receiver;
   return action.getName();
 }