Example #1
0
  /**
   * Static Init
   *
   * @throws Exception
   */
  private void zkInit() throws Exception {
    //
    form.appendChild(mainPanel);
    mainPanel.appendChild(mainLayout);
    mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
    mainLayout.setHeight("100%");
    mainLayout.setWidth("99%");
    parameterPanel.appendChild(parameterLayout);
    //
    labelBankAccount.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
    fieldBankAccount.addActionListener(this);
    labelBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fieldBPartner.addActionListener(this);
    bRefresh.addActionListener(this);
    labelPayDate.setText(Msg.translate(Env.getCtx(), "PayDate"));
    labelPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule"));
    fieldPaymentRule.addActionListener(this);
    labelDtype.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
    fieldDtype.addActionListener(this);
    //
    labelBankBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance"));
    labelBalance.setText("0");
    onlyDue.setText(Msg.getMsg(Env.getCtx(), "OnlyDue"));
    dataStatus.setText(" ");
    dataStatus.setPre(true);
    //
    bGenerate.addActionListener(this);
    bCancel.addActionListener(this);
    //
    North north = new North();
    north.setStyle("border: none");
    mainLayout.appendChild(north);
    north.appendChild(parameterPanel);

    Rows rows = parameterLayout.newRows();
    Row row = rows.newRow();
    row.appendChild(labelBankAccount.rightAlign());
    row.appendChild(fieldBankAccount);
    row.appendChild(labelBankBalance.rightAlign());
    Panel balancePanel = new Panel();
    balancePanel.appendChild(labelCurrency);
    balancePanel.appendChild(labelBalance);
    row.appendChild(balancePanel);
    row.appendChild(new Space());

    row = rows.newRow();
    row.appendChild(labelBPartner.rightAlign());
    row.appendChild(fieldBPartner);
    row.appendChild(new Space());
    row.appendChild(onlyDue);
    row.appendChild(new Space());

    row = rows.newRow();
    row.appendChild(labelDtype.rightAlign());
    row.appendChild(fieldDtype);
    row.appendChild(new Space());
    row.appendChild(new Space());
    row.appendChild(new Space());

    row = rows.newRow();
    row.appendChild(labelPayDate.rightAlign());
    row.appendChild(fieldPayDate.getComponent());
    row.appendChild(labelPaymentRule.rightAlign());
    row.appendChild(fieldPaymentRule);
    row.appendChild(bRefresh);

    South south = new South();
    south.setStyle("border: none");
    mainLayout.appendChild(south);
    southPanel = new Panel();
    southPanel.appendChild(dataStatus);
    south.appendChild(southPanel);
    Center center = new Center();
    mainLayout.appendChild(center);
    center.appendChild(miniTable);
    //
    commandPanel.addButton(bGenerate);
    commandPanel.getButton(ConfirmPanel.A_OK).setVisible(false);
  } //  jbInit
Example #2
0
  /** execute export action */
  public void export() {
    exporterMap = new HashMap<String, IGridTabExporter>();
    extensionMap = new HashMap<String, String>();
    List<IGridTabExporter> exporterList =
        EquinoxExtensionLocator.instance().list(IGridTabExporter.class).getExtensions();
    for (IGridTabExporter exporter : exporterList) {
      String extension = exporter.getFileExtension();
      if (!extensionMap.containsKey(extension)) {
        extensionMap.put(extension, exporter.getFileExtensionLabel());
        exporterMap.put(extension, exporter);
      }
    }

    if (winExportFile == null) {
      winExportFile = new Window();
      winExportFile.setTitle(
          Msg.getMsg(Env.getCtx(), "Export") + ": " + panel.getActiveGridTab().getName());
      winExportFile.setWidth("450px");
      winExportFile.setClosable(true);
      winExportFile.setBorder("normal");
      winExportFile.setStyle("position:absolute");
      winExportFile.setSclass("popup-dialog");
      winExportFile.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "exportAction");

      cboType.setMold("select");

      cboType.getItems().clear();
      for (Map.Entry<String, String> entry : extensionMap.entrySet()) {
        cboType.appendItem(entry.getKey() + " - " + entry.getValue(), entry.getKey());
      }

      cboType.setSelectedIndex(0);
      cboType.addActionListener(this);

      Vbox vb = new Vbox();
      vb.setWidth("100%");
      winExportFile.appendChild(vb);

      Vlayout vlayout = new Vlayout();
      vlayout.setSclass("dialog-content");
      vb.appendChild(vlayout);

      Grid grid = GridFactory.newGridLayout();
      vlayout.appendChild(grid);

      Columns columns = new Columns();
      Column column = new Column();
      column.setHflex("min");
      columns.appendChild(column);
      column = new Column();
      column.setHflex("1");
      columns.appendChild(column);
      grid.appendChild(columns);

      Rows rows = new Rows();
      grid.appendChild(rows);

      Row row = new Row();
      rows.appendChild(row);
      row.appendChild(new Label(Msg.getMsg(Env.getCtx(), "FilesOfType")));
      row.appendChild(cboType);
      cboType.setHflex("1");

      row = new Row();
      rows.appendChild(row);
      row.appendChild(new Space());
      chkCurrentRow.setLabel(Msg.getMsg(Env.getCtx(), "ExportCurrentRowOnly"));
      chkCurrentRow.setSelected(true);
      row.appendChild(chkCurrentRow);

      selectionTabRow = new Row();
      rows.appendChild(selectionTabRow);

      LayoutUtils.addSclass("dialog-footer", confirmPanel);
      vb.appendChild(confirmPanel);
      confirmPanel.addActionListener(this);
    }
    displayExportTabSelection();
    panel.getComponent().getParent().appendChild(winExportFile);
    panel.showBusyMask(winExportFile);
    LayoutUtils.openOverlappedWindow(panel.getComponent(), winExportFile, "middle_center");
    winExportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this);
    winExportFile.addEventListener("onExporterException", this);
  }