コード例 #1
0
 protected void buildBox(Listcell cell) {
   Hbox hbox = new Hbox();
   hbox.setWidths("130px,,");
   hbox.setAlign("center");
   buildLabel(hbox);
   hbox.setParent(cell);
 }
コード例 #2
0
ファイル: WFileImport.java プロジェクト: makezjdq/adempiere-1
  /** Load Format */
  private void cmd_loadFormat() {
    //	clear panel
    previewPanel.getChildren().clear();

    ListItem listitem = pickFormat.getSelectedItem();

    String formatName = (String) listitem.getValue();

    if (formatName.equals(s_none)) return;

    m_format = ImpFormat.load(formatName);

    if (m_format == null) {
      FDialog.error(m_WindowNo, this, formatName);
      return;
    }

    //	pointers

    int size = m_format.getRowCount();
    m_labels = new Label[size];
    m_fields = new Textbox[size];

    for (int i = 0; i < size; i++) {
      ImpFormatRow row = m_format.getRow(i);

      m_labels[i] = new Label(row.getColumnName());

      Hbox hbox = new Hbox();
      hbox.setWidth("100%");
      hbox.setWidths("30%, 70%");
      hbox.setStyle("padding-bottom: 3px");

      hbox.appendChild(m_labels[i].rightAlign());

      int length = row.getEndNo() - row.getStartNo();

      if (length <= 5) length = 5;
      else if (length > 20) length = 20;

      m_fields[i] = new Textbox();
      m_fields[i].setStyle("margin-left: 2px");

      hbox.appendChild(m_fields[i]);

      previewPanel.appendChild(hbox);
    }
    m_record = -1;
    record.setValue("------");
    previewPanel.invalidate();
  } //	cmd_format