예제 #1
0
  /** Dynamic Init */
  private void dynInit() {
    //	Load Formats
    pickFormat.appendItem(s_none, s_none);

    String sql =
        MRole.getDefault()
            .addAccessSQL(
                "SELECT Name FROM AD_ImpFormat",
                "AD_ImpFormat",
                MRole.SQL_FULLYQUALIFIED,
                MRole.SQL_RO);
    try {
      PreparedStatement pstmt = DB.prepareStatement(sql, null);
      ResultSet rs = pstmt.executeQuery();

      while (rs.next()) pickFormat.appendItem(rs.getString(1), rs.getString(1));

      rs.close();
      pstmt.close();
    } catch (SQLException e) {
      log.log(Level.SEVERE, sql, e);
    }

    pickFormat.setSelectedIndex(0);
    pickFormat.addEventListener(Events.ON_SELECT, this);

    Charset charset = Ini.getCharset();

    for (int i = 0; i < fCharset.getItemCount(); i++) {
      ListItem listitem = fCharset.getItemAtIndex(i);
      Charset compare = (Charset) listitem.getValue();

      if (charset == compare) {
        fCharset.setSelectedIndex(i);
        break;
      }
    }

    fCharset.addEventListener(Events.ON_SELECT, this);

    confirmPanel.setEnabled("Ok", false);
  } //	dynInit
예제 #2
0
  /**
   * Static Init
   *
   * @throws Exception
   */
  private void init() throws Exception {
    fResource.setMold("select");
    fResource.addEventListener(Events.ON_SELECT, this);
    delete.addEventListener(Events.ON_CLICK, this);
    confirmPanel.addComponentsLeft(delete);
    confirmPanel.addActionListener(Events.ON_CLICK, this);
    //
    this.appendChild(mainPanel);
    mainPanel.makeNoStrip();
    mainPanel.setStyle("background-color: transparent");

    Rows rows = new Rows();
    mainPanel.appendChild(rows);
    Row row = new Row();
    row.appendChild(LayoutUtils.makeRightAlign(lResource));
    row.appendChild(fResource);
    row.appendChild(new Label(" "));
    rows.appendChild(row);

    row = new Row();
    row.setSpans("1, 2");
    row.appendChild(LayoutUtils.makeRightAlign(lDate));
    Div div = new Div();
    div.appendChild(fDateFrom);
    div.appendChild(fTimeFrom);
    fTimeFrom.setStyle("margin-left: 5px");
    row.appendChild(div);
    rows.appendChild(row);

    row = new Row();
    row.appendChild(LayoutUtils.makeRightAlign(lQty));
    row.appendChild(fQty);
    row.appendChild(lUOM);
    rows.appendChild(row);

    row = new Row();
    row.setSpans("1, 2");
    row.appendChild(LayoutUtils.makeRightAlign(lName));
    row.appendChild(fName);
    fName.setStyle("width: 100%");
    rows.appendChild(row);

    row = new Row();
    row.setSpans("1, 2");
    row.appendChild(LayoutUtils.makeRightAlign(lDescription));
    row.appendChild(fDescription);
    fDescription.setMultiline(true);
    fDescription.setRows(3);
    fDescription.setStyle("width: 100%");
    rows.appendChild(row);

    row = new Row();
    row.setSpans("3");
    row.appendChild(new Label(" "));
    rows.appendChild(row);

    row = new Row();
    row.setSpans("3");
    row.appendChild(confirmPanel);
    rows.appendChild(row);
    //
  } //	jbInit