Exemple #1
0
  BaseGrid<BusiObject> create_bcode_contact_Grid() {
    CheckBoxSelectionModel<BusiObject> cbs = new CheckBoxSelectionModel<BusiObject>();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());

    ColumnConfig C3 = new ColumnConfig("enname", "英文名称", 80);
    C3.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C3);
    ColumnConfig C4 = new ColumnConfig("cnname", "中文名称", 80);
    C4.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C4);
    ColumnConfig C5 = new ColumnConfig("tel", "电话", 80);
    C5.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C5);
    ColumnConfig C6 = new ColumnConfig("Relationship", "关系", 80);
    BaseComboBoxX bc6 = new BaseComboBoxX("name", "dictionary", "where type='hr_relationship'");
    C6.setEditor(bc6.getCellEditor());
    columns.add(C6);

    ColumnModel cm = new ColumnModel(columns);
    bcode_contact_grid = new BaseGrid<BusiObject>(getStore(), cm, true, true);
    cbs.setSelectionMode(SelectionMode.SINGLE);
    bcode_contact_grid.setSelectionModel(cbs);
    bcode_contact_grid.setHeight(410);
    bcode_contact_grid.setWidth(750);
    return bcode_contact_grid;
  }
Exemple #2
0
  BaseGrid<BusiObject> create_bcode_famify_Grid() {
    CheckBoxSelectionModel<BusiObject> cbs = new CheckBoxSelectionModel<BusiObject>();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());
    ColumnConfig C3 = new ColumnConfig("ChineseName", "中文名", 80);
    C3.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C3);
    ColumnConfig C4 = new ColumnConfig("englishname", "英文名称", 80);
    C4.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C4);
    ColumnConfig C5 = new ColumnConfig("Relationship", "关系", 80);
    BaseComboBoxX bc5 = new BaseComboBoxX("name", "dictionary", "where type='hr_relationship'");
    C5.setEditor(bc5.getCellEditor());

    columns.add(C5);
    ColumnConfig C6 = new ColumnConfig("Birthday", "生日", 80);
    DateField dateField6 = new DateField();
    dateField6.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    C6.setEditor(new CellEditor(dateField6));
    C6.setDateTimeFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    columns.add(C6);
    ColumnConfig C7 = new ColumnConfig("sex", "性别", 80);
    BaseComboBoxX bc7 = new BaseComboBoxX("name", "dictionary", "where type='hr_sex'");
    C7.setEditor(bc7.getCellEditor());
    columns.add(C7);
    ColumnConfig C8 = new ColumnConfig("Nationality", "国籍", 80);
    BaseComboBoxX bc8 = new BaseComboBoxX("name", "dictionary", "where type='hr_Country'");
    C8.setEditor(bc8.getCellEditor());
    columns.add(C8);
    ColumnConfig C9 = new ColumnConfig("PassportNo", "护照编码", 80);
    C9.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C9);
    ColumnConfig C10 = new ColumnConfig("PassportIssueCountry", "护照发出地", 80);
    C10.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C10);
    ColumnConfig C11 = new ColumnConfig("PassportIssueDate", "护照发出日期", 80);
    DateField dateField11 = new DateField();
    dateField11.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    C11.setEditor(new CellEditor(dateField11));
    C11.setDateTimeFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    columns.add(C11);
    ColumnConfig C12 = new ColumnConfig("Occupation", "职业", 80);
    C12.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C12);
    ColumnConfig C13 = new ColumnConfig("Company", "公司", 80);
    C13.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C13);
    ColumnConfig C14 = new ColumnConfig("JobPosition", "职位", 80);
    C14.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C14);

    ColumnModel cm = new ColumnModel(columns);
    bcode_famify_grid = new BaseGrid<BusiObject>(get_bcode_famify_Store(), cm, true, true);
    cbs.setSelectionMode(SelectionMode.SINGLE);
    bcode_famify_grid.setSelectionModel(cbs);
    bcode_famify_grid.setHeight(400);
    return bcode_famify_grid;
  }
Exemple #3
0
  public Widget aa() {
    int armStatus = ArmWrapper.FAILED;
    try {
      ArmWrapper.startTransaction(
          this, "com.base.myproject.client.busi.b2c.manager.ChartTest", "aa", new Object[] {});
      ContentPanel panel = new ContentPanel();
      panel.setAutoHeight(true);
      ToolBar tb = new ToolBar();
      Button addsuit = new Button("从商品库里添加套装商品");
      addsuit.setIconStyle("b2csuit");
      panel.setHeading("商品库,如果加入套装你必须先选择一行(必选)");
      tb.add(addsuit);
      panel.setTopComponent(tb);
      // addsuit.addListener(Events.Select, this);
      panel.setAutoWidth(true);
      CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();
      List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
      columns.add(cbs.getColumn());
      ColumnConfig gcode = new ColumnConfig("gcode", "商品大类编码", 100);
      TextField<String> gcodetext = new TextField<String>();
      gcode.setEditor(new CellEditor(gcodetext));
      columns.add(gcode);
      ColumnConfig gname = new ColumnConfig("discountprice", "商品大类名称", 100);
      TextField<String> gnametext = new TextField<String>();
      gname.setEditor(new CellEditor(gnametext));
      columns.add(gname);

      ColumnConfig treecode = new ColumnConfig("price", "商品分类树编码", 100);

      TextField<String> treecodetext = new TextField<String>();
      treecode.setEditor(new CellEditor(treecodetext));
      columns.add(treecode);

      ColumnConfig b2cgcodecolumn = new ColumnConfig("b2cgcode", "商品编码", 100);
      TextField<String> b2cgcodetext = new TextField<String>();
      b2cgcodecolumn.setEditor(new CellEditor(b2cgcodetext));
      columns.add(b2cgcodecolumn);
      ColumnConfig b2cgname = new ColumnConfig("b2cgname", "商品名称", 100);
      TextField<String> b2cgnametext = new TextField<String>();
      b2cgname.setEditor(new CellEditor(b2cgnametext));
      columns.add(b2cgname);

      ModelType type = new ModelType();
      type.setRoot("records");
      type.setRecordName("record");

      type.addField("gcode");
      type.addField("gname");
      type.addField("b2cgcode");
      type.addField("price");
      type.addField("discountprice");
      type.addField("b2cgname");
      type.addField("mainimagepath");
      type.addField("treecode");
      type.addField("detailimage");

      StoreInfo info = new StoreInfo();

      info.setTablename("b2cgcode");
      info.setKeyname(new String[] {"b2cgcode"});
      info.setSql("select * from b2cgcode");
      BaseStore<JDBCModelData> store = new BaseStore<JDBCModelData>(type, info);

      ChartModel model =
          new ChartModel(
              "Team Sales by Month", "font-size: 14px; font-family: Verdana; text-align: center;");
      model.setBackgroundColour("#fefefe");
      model.setLegend(new Legend(Position.TOP, true));
      model.setScaleProvider(ScaleProvider.ROUNDED_NEAREST_SCALE_PROVIDER);

      BarChart bar = new BarChart(BarStyle.GLASS);
      bar.setColour("#00aa00");
      BarDataProvider barProvider = new BarDataProvider("price", "b2cgname");
      barProvider.bind(store);
      bar.setDataProvider(barProvider);
      //  bar.addChartListener(listener);
      model.addChartConfig(bar);

      bar = new BarChart(BarStyle.GLASS);
      bar.setColour("#ff6600");
      barProvider = new BarDataProvider("discountprice");
      barProvider.bind(store);
      bar.setDataProvider(barProvider);
      // bar.addChartListener(listener);
      model.addChartConfig(bar);

      LineChart line = new LineChart();
      line.setAnimateOnShow(true);
      line.setText("Average");
      line.setColour("#FF0000");
      LineDataProvider lineProvider = new LineDataProvider("discountprice");
      lineProvider.bind(store);
      line.setDataProvider(lineProvider);
      model.addChartConfig(line);

      /*	    PieChart pie = new PieChart();
      PieDataProvider piedataprovider = new PieDataProvider("discountprice");
      piedataprovider.bind(store);
      pie.setDataProvider(piedataprovider);
      model.addChartConfig(pie);*/

      String url = "chart/open-flash-chart.swf";
      final Chart chart = new Chart(url);
      chart.setChartModel(model);
      chart.setHeight("300px");
      ContentPanel cp = new ContentPanel();
      cp.setHeading("Chart");
      cp.add(chart);
      ColumnModel cm = new ColumnModel(columns);
      BaseGrid grid = new BaseGrid(store, cm);
      grid.setHeight("300px");
      cp.add(grid);
      armStatus = ArmWrapper.GOOD;
      return cp;
    } finally {
      ArmWrapper.stopTransaction(
          "com.base.myproject.client.busi.b2c.manager.ChartTest", "aa", armStatus);
    }
  }