예제 #1
0
  private void mostrar() {
    MessageBox.hide();
    Record rec = lista.getPanel().getSelectionModel().getSelected();
    if (rec != null) {
      CoreProxy<FinRetorno> proxy = new CoreProxy<FinRetorno>(classe);
      proxy.selecionar(
          rec.getAsInteger("finRetornoId"),
          new AsyncCallback<FinRetorno>() {
            public void onSuccess(FinRetorno result) {
              arquivo = result.getFinRetornoArquivo();
              analisar();
            }

            public void onFailure(Throwable caught) {
              arquivo = null;
              boletos.getStore().removeAll();
            }
          });
    } else {
      if (cmbConta.getStore().getRecords().length == 1) {
        cmbConta.setValue(cmbConta.getStore().getRecordAt(0).getAsString("finContaId"));
      }
    }
    cmbConta.focus();
  }
예제 #2
0
 public void showScreen(String historyToken) {
   if (historyToken == null || historyToken.equals("")) {
     appTabPanel.activate(0);
   } else {
     Record record = store.getById(historyToken);
     if (record != null) {
       ShowcasePanel panel = (ShowcasePanel) record.getAsObject("screen");
       String title = record.getAsString("title");
       String iconCls = record.getAsString("iconCls");
       showScreen(panel, title, iconCls, historyToken);
     }
   }
 }
 // parse the product info when it has been loaded
 @Override
 protected void onStoreLoad(Store store, Record[] records) {
   super.onStoreLoad(store, records);
   // 0 indexed record is the permission records
   Record r = getStore().getRecordAt(1);
   String value = r.getAsString(ProductInfoForInvoiceLookupConfiguration.OUT_UNIT_PRICE);
   if (value != null) {
     unitPrice = new BigDecimal(value);
   }
   description = r.getAsString(ProductInfoForInvoiceLookupConfiguration.OUT_DESCRIPTION);
   invoiceItemTypeId =
       r.getAsString(ProductInfoForInvoiceLookupConfiguration.OUT_INVOICE_ITEM_TYPE_ID);
 }
예제 #4
0
  private void novoModulo(SisModulo sisModulo) {
    Record rec = super.getRegistro(MODULOS, sisModulo.getSisModuloClasse());

    if (rec != null) {
      TreeNode nodeModulo = new TreeNode(rec.getAsString("nome"));
      nodeModulo.setChecked(false);
      nodeModulo.setUserObject(sisModulo);
      nodeModulo.setIconCls(rec.getAsString("imagem"));
      nodeModulo.setTooltip(rec.getAsString("descricao"));
      for (SisFuncao sis_funcao : sisModulo.getSisFuncoes()) {
        novaFuncao(nodeModulo, sis_funcao);
      }
      treeAcesso.getRoot().appendChild(nodeModulo);
    }
  }
예제 #5
0
  public Panel getAccordionNav() {
    Panel accordion = new Panel();
    accordion.setTitle("Accordion");
    accordion.setLayout(new AccordionLayout(true));

    Store store = getStore();

    Record[] records = store.getRecords();
    for (int i = 0; i < records.length; i++) {
      Record record = records[i];

      String id = record.getAsString("id");
      final String category = record.getAsString("category");
      String title = record.getAsString("title");
      final String iconCls = record.getAsString("iconCls");

      String thumbnail = record.getAsString("thumbnail");
      String qtip = record.getAsString("qtip");

      final ShowcasePanel panel = (ShowcasePanel) record.getAsObject("screen");

      if (category == null) {
        Panel categoryPanel = new Panel();
        categoryPanel.setAutoScroll(true);
        categoryPanel.setLayout(new FitLayout());
        categoryPanel.setId(id + "-acc");
        categoryPanel.setTitle(title);
        categoryPanel.setIconCls(iconCls);
        accordion.add(categoryPanel);
      } else {
        Panel categoryPanel = (Panel) accordion.findByID(category + "-acc");
        TreePanel treePanel = (TreePanel) categoryPanel.findByID(category + "-acc-tree");
        TreeNode root = null;
        if (treePanel == null) {
          treePanel = new TreePanel();
          treePanel.setAutoScroll(true);
          treePanel.setId(category + "-acc-tree");
          treePanel.setRootVisible(false);
          root = new TreeNode();
          treePanel.setRootNode(root);
          categoryPanel.add(treePanel);
        } else {
          root = treePanel.getRootNode();
        }

        TreeNode node = new TreeNode();
        node.setText(title);
        node.setId(id);
        if (iconCls != null) node.setIconCls(iconCls);
        if (qtip != null) node.setTooltip(qtip);
        root.appendChild(node);

        addNodeClickListener(node, panel, iconCls);
      }
    }

    return accordion;
  }
예제 #6
0
  public void mostrarDados() {
    Record rec = lista.getPanel().getSelectionModel().getSelected();
    if (rec != null) {
      getForm().loadRecord(rec);
      dtCadastro = rec.getAsDate("pokerPagarCadastrado");
      dtRealizado = rec.getAsDate("pokerPagarRealizado");
      pago = rec.getAsBoolean("pokerPagarAtivo");
    } else {
      dtCadastro = new Date();
    }
    cmbForma.focus(true);

    if (duplicar) {
      hdnCod.setValue("0");
      hdnForma.setValue("0");
      cmbForma.setRawValue("");
      duplicar = false;
    }
  }
예제 #7
0
  private TreeNode novaAcao(TreeNode nodeFuncao, SisAcao sisAcao, TreeNode anterior) {
    Record rec = super.getRegistro(ACOES, sisAcao.getSisAcaoClasse());

    if (rec != null) {
      TreeNode nodeAcao = new TreeNode(rec.getAsString("nome"));
      nodeAcao.setChecked(false);
      nodeAcao.setUserObject(sisAcao);
      nodeAcao.setIconCls(rec.getAsString("imagem"));
      nodeAcao.setTooltip(rec.getAsString("descricao"));

      if (anterior == null) {
        nodeFuncao.appendChild(nodeAcao);
      } else {
        anterior.appendChild(nodeAcao);
      }

      return nodeAcao;
    } else {
      return null;
    }
  }
예제 #8
0
  private void novaFuncao(TreeNode nodeModulo, SisFuncao sisFuncao) {
    Record rec = super.getRegistro(FUNCOES, sisFuncao.getSisFuncaoClasse());

    if (rec != null) {
      TreeNode nodeFuncao = new TreeNode(rec.getAsString("nome"));
      nodeFuncao.setChecked(false);
      nodeFuncao.setUserObject(sisFuncao);
      nodeFuncao.setIconCls(rec.getAsString("imagem"));
      nodeFuncao.setTooltip(rec.getAsString("descricao"));

      int ant = -1;
      TreeNode nodeAcao = null;
      for (SisAcao sis_acao : sisFuncao.getSisAcoes()) {
        if (ant != sis_acao.getSisAcaoOrdem()) {
          nodeAcao = novaAcao(nodeFuncao, sis_acao, null);
          ant = sis_acao.getSisAcaoOrdem();
        } else {
          novaAcao(nodeFuncao, sis_acao, nodeAcao);
        }
      }
      nodeModulo.appendChild(nodeFuncao);
    }
  }
예제 #9
0
  public TreePanel getTreeNav() {
    treePanel = new TreePanel();
    treePanel.setTitle("Tree View");
    treePanel.setId("nav-tree");
    treePanel.setWidth(180);
    treePanel.setCollapsible(true);
    treePanel.setAnimate(true);
    treePanel.setEnableDD(false);
    treePanel.setAutoScroll(true);
    treePanel.setContainerScroll(true);
    treePanel.setRootVisible(false);
    treePanel.setBorder(false);
    treePanel.setTopToolbar(getFilterToolbar());

    TreeNode root = new TreeNode("Showcase Explorer");
    treePanel.setRootNode(root);

    CreditsPanel creditsPanel = new CreditsPanel();

    TreeNode creditsNode = new TreeNode("Credits");
    creditsNode.setIconCls("credits-icon");
    creditsNode.setId("credits");
    root.appendChild(creditsNode);
    addNodeClickListener(creditsNode, creditsPanel, "credits-icon");

    Store store = getStore();

    Record[] records = store.getRecords();
    for (int i = 0; i < records.length; i++) {
      Record record = records[i];

      String id = record.getAsString("id");
      final String category = record.getAsString("category");
      String title = record.getAsString("title");
      final String iconCls = record.getAsString("iconCls");

      String thumbnail = record.getAsString("thumbnail");
      String qtip = record.getAsString("qtip");

      final ShowcasePanel panel = (ShowcasePanel) record.getAsObject("screen");

      TreeNode node = new TreeNode(title);
      node.setId(id);
      if (iconCls != null) node.setIconCls(iconCls);
      if (qtip != null) node.setTooltip(qtip);
      if (category == null || category.equals("")) {
        root.appendChild(node);
      } else {
        Node categoryNode =
            root.findChildBy(
                new NodeTraversalCallback() {
                  public boolean execute(Node node) {
                    return node.getId().equals(category);
                  }
                });

        if (categoryNode != null) {
          categoryNode.appendChild(node);
        }
      }
      addNodeClickListener(node, panel, iconCls);
    }
    treeFilter = new TreeFilter(treePanel);
    treePanel.expandAll();
    return treePanel;
  }