コード例 #1
0
  private Table getHouseholdFactBaseCubeTable() throws SQLException {
    Table householdFactBaseCubeTable = new Table();
    householdFactBaseCubeTable.setSizeFull();
    householdFactBaseCubeTable.setImmediate(true);
    householdFactBaseCubeTable.setColumnCollapsingAllowed(true);

    householdFactBaseCubeTable.addContainerProperty("ACCOUNT CITY", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("BRANCH CITY", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("FISCAL QUARTER", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("STATUS REASON", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("PRIMARY BALANCE", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("TRANSACTION COUNT", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("ACCOUNT COUNT", String.class, null);

    DecimalFormat formatDecimal = new DecimalFormat("#.##");

    ResultSet resultSet = bankService.viewHouseholdBaseCube();
    int i = 1;
    while (resultSet.next()) {
      householdFactBaseCubeTable.addItem(
          new Object[] {
            resultSet.getObject(1).toString(),
            resultSet.getObject(2).toString(),
            resultSet.getObject(3).toString(),
            resultSet.getObject(4).toString(),
            formatDecimal.format((Double) resultSet.getObject(5)).toString(),
            resultSet.getObject(6).toString().replace(".0", ""),
            resultSet.getObject(7).toString().replace(".0", "")
          },
          new Integer(i));
      i++;
    }

    return householdFactBaseCubeTable;
  }
コード例 #2
0
  @SuppressWarnings("deprecation")
  private Table getFractionTable(Map<Integer, ProteinBean> proteinFractionAvgList) {
    Table table = new Table();
    table.setStyleName(Reindeer.TABLE_STRONG + " " + Reindeer.TABLE_BORDERLESS);
    table.setHeight("150px");
    table.setWidth("100%");
    table.setSelectable(true);
    table.setColumnReorderingAllowed(true);
    table.setColumnCollapsingAllowed(true);
    table.setImmediate(true); // react at once when something is selected
    table.addContainerProperty(
        "Fraction Index",
        Integer.class,
        null,
        "Fraction Index",
        null,
        com.vaadin.ui.Table.ALIGN_CENTER);
    table.addContainerProperty(
        "# Peptides ", Integer.class, null, "# Peptides ", null, com.vaadin.ui.Table.ALIGN_CENTER);
    table.addContainerProperty(
        "# Spectra ", Integer.class, null, "# Spectra", null, com.vaadin.ui.Table.ALIGN_CENTER);
    table.addContainerProperty(
        "Average Precursor Intensity",
        Double.class,
        null,
        "Average Precursor Intensity",
        null,
        com.vaadin.ui.Table.ALIGN_CENTER);
    /* Add a few items in the table. */
    int x = 0;
    for (int index : proteinFractionAvgList.keySet()) {
      ProteinBean pb = proteinFractionAvgList.get(index);
      table.addItem(
          new Object[] {
            new Integer(index),
            pb.getNumberOfPeptidePerFraction(),
            pb.getNumberOfSpectraPerFraction(),
            pb.getAveragePrecursorIntensityPerFraction()
          },
          new Integer(x + 1));
      x++;
    }
    for (Object propertyId : table.getSortableContainerPropertyIds()) {
      table.setColumnExpandRatio(propertyId.toString(), 1.0f);
    }

    return table;
  }
コード例 #3
0
  public void setTablePropertiesList() {

    setVisibleTablePropertiesList("refno", "norek", "trdate", "posting");

    tableList.setColumnCollapsingAllowed(true);
    try {
      tableList.setColumnCollapsed("refno", true);
      tableList.setColumnCollapsed("amount", true);

    } catch (Exception ex) {
    }

    // ALIGNMENT
    tableList.setColumnAlignment("invoicedate", Align.CENTER);
    tableList.setColumnAlignment("trdate", Align.CENTER);
    tableList.setColumnAlignment("posting", Align.CENTER);
    tableList.setColumnAlignment("amountafterdisc", Align.RIGHT);
    tableList.setColumnAlignment("amountafterdiscafterppn", Align.RIGHT);
    tableList.setColumnAlignment("amountpay", Align.RIGHT);

    // SET HEADER
    tableList.setColumnHeader("refno", "REF");
    tableList.setColumnHeader("norek", "NO. DOC");
    tableList.setColumnHeader("trdate", "MULAI BERLAKU");
    tableList.setColumnHeader("posting", "POSTING");

    tableList.setColumnHeader("podate", "PO. DATE");
    tableList.setColumnHeader("amount", "AMOUNT");
    tableList.setColumnHeader("amountafterdisc", "DPP");
    tableList.setColumnHeader("amountafterdiscafterppn", "DPP+PPN");
    tableList.setColumnHeader("amountpay", "AMOUNTPAY");

    //		tableList.setColumnExpandRatio("nopo", 1);
    //		tableList.setColumnExpandRatio("invoiceno", 4);
    //		tableList.setColumnExpandRatio("invoicedate", 10);
    //		tableList.setColumnExpandRatio("pprice", 5);
    //		tableList.setColumnExpandRatio("podate", 4);
    //		tableList.setColumnExpandRatio("amount", 4);
    //		tableList.setColumnExpandRatio("amountpay", 4);
    //		tableList.setColumnExpandRatio("podate", 4);
    //		tableList.setColumnExpandRatio("amount", 4);
    //		tableList.setColumnExpandRatio("amountpay", 4);

  }
コード例 #4
0
  public Table buildTable(TimingsTableDataHolder holder) {
    Table table = new Table();
    table.setWidth("100%");
    table.setPageLength(0);
    table.addStyleName("pq");
    table.setSortEnabled(false);
    table.setFooterVisible(true);
    table.setColumnCollapsingAllowed(true);
    table.setColumnCollapsible(columnNames[0], false);
    table.setColumnCollapsible(columnNames[1], false);
    table.setColumnCollapsible(columnNames[3], false);

    table.setColumnAlignment(columnNames[0], Table.Align.LEFT);
    for (String name : columnNames) {
      table.addContainerProperty(name, String.class, null);
      table.setColumnExpandRatio(name, 2);
    }
    fillTable(table, holder.getTotal(), holder.getRows());

    return table;
  }
コード例 #5
0
  /** 初始化表格 * */
  private void initRightTable(Table table, Container container) {
    table.setSizeFull();
    table.setHeight(100, Unit.PERCENTAGE);
    table.setContainerDataSource(container);
    table.setVisibleColumns(Constants.COMPLAIN_TYPE_COL);
    table.setColumnHeaders(Constants.COMPLAIN_TYPE_COL_HEADERS_CHINESE);

    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.addItemClickListener(
        new ItemClickListener() {

          @Override
          public void itemClick(ItemClickEvent event) {
            // MouseButton.LEFT 左键单击
            if (event.getButtonName().equals(MouseButton.LEFT.getName())) {
              createWindow(event.getItem());
            }
          }
        });
  }
コード例 #6
0
  private Table getHouseholdFactBaseCubeTable() throws SQLException {
    Table householdFactBaseCubeTable = new Table();
    householdFactBaseCubeTable.setSizeFull();
    householdFactBaseCubeTable.setImmediate(true);
    householdFactBaseCubeTable.setColumnCollapsingAllowed(true);

    householdFactBaseCubeTable.addContainerProperty("ACCOUNT CITY", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("HOUSEHOLD STATE", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("PRODUCT TYPE", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("BRANCH CITY", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("PRIMARY BALANCE", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("TRANSACTION COUNT", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("ACCOUNT COUNT", String.class, null);

    DecimalFormat formatDecimal = new DecimalFormat("#.##");

    ResultSet resultSet =
        bankService.viewHouseholdBaseCubeFourDims(
            "a.account_city", "h.household_state", "p.type", "b.branch_city");
    int i = 1;
    while (resultSet.next()) {
      householdFactBaseCubeTable.addItem(
          new Object[] {
            resultSet.getObject(1).toString(),
            resultSet.getObject(2).toString(),
            resultSet.getObject(3).toString(),
            resultSet.getObject(4).toString(),
            formatDecimal.format((Double) resultSet.getObject(5)).toString(),
            resultSet.getObject(6).toString().replace(".0", ""),
            resultSet.getObject(7).toString().replace(".0", "")
          },
          new Integer(i));
      i++;
    }

    return householdFactBaseCubeTable;
  }
コード例 #7
0
  public void setTablePropertiesDetil() {
    setVisibleTablePropertiesDetil(
        "id",
        "nourut",
        "fproductBean.pcode",
        "fproductBean.pname",
        "fproductBean.packaging",
        "fproductBean.pprice",
        "fproductBean.ppriceafterppn",
        "fproductBean.pprice2",
        "fproductBean.pprice2afterppn",
        "fproductBean.sprice",
        "fproductBean.spriceafterppn",
        "fproductBean.sprice2",
        "fproductBean.sprice2afterppn",
        "pprice",
        "ppriceafterppn",
        "pprice2",
        "pprice2afterppn",
        "sprice",
        "spriceafterppn",
        "sprice2",
        "sprice2afterppn",
        "ppricebefore",
        "pprice2before",
        "spricebefore",
        "sprice2before",
        "ftpricehBean",
        "fproductBean");

    tableDetil.setColumnCollapsingAllowed(true);

    try {
      tableDetil.setColumnCollapsed("id", true);
      tableDetil.setColumnCollapsed("nourut", true);

      tableDetil.setColumnCollapsed("fproductBean.pprice", true);
      tableDetil.setColumnCollapsed("fproductBean.ppriceafterppn", true);
      tableDetil.setColumnCollapsed("fproductBean.pprice2", true);
      tableDetil.setColumnCollapsed("fproductBean.pprice2afterppn", true);
      tableDetil.setColumnCollapsed("fproductBean.sprice", true);
      tableDetil.setColumnCollapsed("fproductBean.spriceafterppn", true);
      tableDetil.setColumnCollapsed("fproductBean.sprice2", true);
      tableDetil.setColumnCollapsed("fproductBean.sprice2afterppn", true);

      tableDetil.setColumnCollapsed("fproductBean.sprice", true);
      tableDetil.setColumnCollapsed("fproductBean.spriceafterppn", true);
      tableDetil.setColumnCollapsed("fproductBean.sprice2", true);
      tableDetil.setColumnCollapsed("fproductBean.sprice2afterppn", true);

      tableDetil.setColumnCollapsed("pprice", true);
      tableDetil.setColumnCollapsed("pprice2", true);
      tableDetil.setColumnCollapsed("sprice", true);
      tableDetil.setColumnCollapsed("sprice2", true);

      tableDetil.setColumnCollapsed("ppricebefore", true);
      tableDetil.setColumnCollapsed("pprice2before", true);
      tableDetil.setColumnCollapsed("spricebefore", true);
      tableDetil.setColumnCollapsed("sprice2before", true);

      tableDetil.setColumnCollapsed("ftpricehBean", true);
      tableDetil.setColumnCollapsed("fproductBean", true);

    } catch (Exception ex) {
    }

    // ALIGNMENT
    tableDetil.setColumnAlignment("id", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.pprice", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.ppriceafterppn", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.pprice2", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.pprice2afterppn", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.sprice", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.spriceafterppn", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.sprice2", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.sprice2afterppn", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.pcode", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.pcode", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.pcode", Align.RIGHT);
    tableDetil.setColumnAlignment("fproductBean.pcode", Align.RIGHT);

    tableDetil.setColumnAlignment("pprice", Align.RIGHT);
    tableDetil.setColumnAlignment("ppriceafterppn", Align.RIGHT);
    tableDetil.setColumnAlignment("pprice2", Align.RIGHT);
    tableDetil.setColumnAlignment("pprice2afterppn", Align.RIGHT);
    tableDetil.setColumnAlignment("pprice2", Align.RIGHT);
    tableDetil.setColumnAlignment("sprice", Align.RIGHT);
    tableDetil.setColumnAlignment("spriceafterppn", Align.RIGHT);
    tableDetil.setColumnAlignment("sprice2", Align.RIGHT);
    tableDetil.setColumnAlignment("sprice2afterppn", Align.RIGHT);

    tableDetil.setColumnAlignment("ppricebefore", Align.RIGHT);
    tableDetil.setColumnAlignment("pprice2before", Align.RIGHT);
    tableDetil.setColumnAlignment("spricebefore", Align.RIGHT);
    tableDetil.setColumnAlignment("sprice2before", Align.RIGHT);

    // SET HEADER
    tableDetil.setColumnHeader("id", "ID");
    tableDetil.setColumnHeader("nourut", "No.");
    tableDetil.setColumnHeader("fproductBean.pcode", "KODE");
    tableDetil.setColumnHeader("fproductBean.pname", "NAMA PRODUK");
    tableDetil.setColumnHeader("fproductBean.packaging", "PACKAGING");
    tableDetil.setColumnHeader("fproductBean.pprice", "H.BELI ACTUAL");
    tableDetil.setColumnHeader("fproductBean.ppriceafterppn", "H.BELI+PPN ACTUAL");
    tableDetil.setColumnHeader("fproductBean.pprice2", "H.BELI+PPN ACTUAL");
    tableDetil.setColumnHeader("fproductBean.pprice2afterppn", "H.BELIPCS+PPN ACTUAL");
    tableDetil.setColumnHeader("fproductBean.sprice", "H.JUAL+PPN ACTUAL");
    tableDetil.setColumnHeader("fproductBean.spriceafterppn", "H.JUAL+PPN ACTUAL");
    tableDetil.setColumnHeader("fproductBean.sprice2", "H.JUALPCS ACTUAL");
    tableDetil.setColumnHeader("fproductBean.sprice2afterppn", "H.JUALPCS+PPN ACTUAL");

    tableDetil.setColumnHeader("ppricebefore", "H.BELI SEBELUM");
    tableDetil.setColumnHeader("pprice2before", "H.BELI PCS SEBELUM");
    tableDetil.setColumnHeader("spricebefore", "H.JUAL SEBELUM");
    tableDetil.setColumnHeader("sprice2before", "H.JUALPCS SEBELUM");

    tableDetil.setColumnHeader("pprice", "H.BELI");
    tableDetil.setColumnHeader("ppriceafterppn", "H.BELI+PPN");
    tableDetil.setColumnHeader("pprice2", "H.BELIPCS");
    tableDetil.setColumnHeader("pprice2afterppn", "H.BELIPCS+PPN");
    tableDetil.setColumnHeader("sprice", "H.JUAL");
    tableDetil.setColumnHeader("spriceafterppn", "H.JUAL+PPN");
    tableDetil.setColumnHeader("sprice2", "H.JUALPCS");
    tableDetil.setColumnHeader("sprice2afterppn", "H.JUALPCS+PPN");
    tableDetil.setColumnHeader("ftpricehBean", "PRICEH");
    tableDetil.setColumnHeader("fproductBean", "PRODUCT");

    tableDetil.setColumnExpandRatio("id", 1);
    tableDetil.setColumnExpandRatio("fproductBean.pcode", 4);
    tableDetil.setColumnExpandRatio("fproductBean.pname", 10);
    tableDetil.setColumnExpandRatio("fproductBean.packaging", 5);
    tableDetil.setColumnExpandRatio("pprice", 5);
    tableDetil.setColumnExpandRatio("ppriceafterppn", 5);
    tableDetil.setColumnExpandRatio("pprice2", 5);
    tableDetil.setColumnExpandRatio("pprice2afterppn", 5);
    tableDetil.setColumnExpandRatio("sprice", 5);
    tableDetil.setColumnExpandRatio("spriceafterppn", 5);
    tableDetil.setColumnExpandRatio("sprice2", 5);
    tableDetil.setColumnExpandRatio("sprice2afterppn", 5);
  }