@Override
  public void initialize() {
    container =
        Panels.content(
            null,
            false,
            Layouts.vBoxLayout(
                VBoxLayout.VBoxLayoutAlign.STRETCH, new Layouts.LayoutOptions(new Padding(10))),
            "x-border-layout-ct");
    container.setScrollMode(Style.Scroll.AUTOY);
    container.addStyleName("contact-details-container");
    add(container);

    saveButton = Forms.button(I18N.CONSTANTS.save(), IconImageBundle.ICONS.save());
    deleteButton = Forms.button(I18N.CONSTANTS.delete(), IconImageBundle.ICONS.remove());
    exportButton = Forms.button(I18N.CONSTANTS.export(), IconImageBundle.ICONS.excel());

    toolBar = new ToolBar();
    toolBar.setAlignment(Style.HorizontalAlignment.LEFT);
    toolBar.setBorders(false);
    toolBar.add(saveButton);
    toolBar.add(deleteButton);
    toolBar.add(exportButton);

    container.setTopComponent(toolBar);
  }
Exemple #2
0
  private Window createGeolocationWindow() {

    final Window w = new Window();
    w.setMinimizable(true);
    w.setMaximizable(true);
    w.setIcon(IconHelper.createStyle("accordion"));
    w.setHeading("Contact list");
    w.setWidth(500);
    w.setHeight(500);
    w.setLayout(new FitLayout());

    ContentPanel cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Localize your friends");
    cp.setScrollMode(Scroll.NONE);
    cp.setLayout(new FitLayout());

    Frame frame = new Frame();
    frame.setUrl("geolocation.html");
    frame.setLayoutData(new FitLayout());
    cp.add(frame);

    w.add(cp);
    return w;
  }
  @Override
  public void initialize() {

    mainPanel = Panels.content("");
    mainPanel.setHeaderVisible(false);

    Label label = new Label(I18N.CONSTANTS.projectCoreSelectVersion());

    mainPanel.add(label);

    amendmentsComboBox1 = new ComboBox<AmendmentDTO>();
    amendmentsComboBox1.setStore(new ListStore<AmendmentDTO>());
    amendmentsComboBox1.setDisplayField("name");
    amendmentsComboBox1.setTriggerAction(ComboBox.TriggerAction.ALL);

    amendmentsComboBox2 = new ComboBox<AmendmentDTO>();
    amendmentsComboBox2.setStore(new ListStore<AmendmentDTO>());
    amendmentsComboBox2.setDisplayField("name");
    amendmentsComboBox2.setTriggerAction(ComboBox.TriggerAction.ALL);

    final LayoutContainer container = Layouts.hBox(HBoxLayoutAlign.TOP);

    container.add(amendmentsComboBox1, Layouts.hBoxData(Margin.LEFT));
    container.add(amendmentsComboBox2, Layouts.hBoxData(Margin.LEFT));

    projectFields = buildGrid();

    mainPanel.setScrollMode(Scroll.AUTO);
    mainPanel.add(container);
    mainPanel.add(projectFields);

    initPopup(mainPanel);
  }
Exemple #4
0
  public ServerEditor() {
    // create content:
    content = new ContentPanel();
    content.setBodyBorder(false);
    content.setHeaderVisible(false);
    content.setScrollMode(Scroll.AUTO);
    //		content.setHeading("Properties");
    content.setButtonAlign(HorizontalAlignment.RIGHT);

    // da toolbar
    ToolBar toolbar = new ToolBar();
    TextToolItem save = new TextToolItem("Save", "icon-save");
    toolbar.add(save);
    toolbar.add(new SeparatorToolItem());
    content.setTopComponent(toolbar);

    tabFolder = new TabPanel();
    tabFolder.setTabScroll(true);

    addTabs(tabFolder);

    RowLayout layout = new RowLayout(Orientation.VERTICAL);
    content.setLayout(layout);
    content.add(tabFolder, new RowData(1, 1));
  }
Exemple #5
0
  /** Creates the south. */
  private void createSouth() {
    BorderLayoutData data =
        new BorderLayoutData(LayoutRegion.SOUTH, Constants.SOUTH_PANEL_DIMENSION + 25);
    // data.setMargins(new Margins(5, 5, 5, 5));
    // data.setHideCollapseTool(false);
    data.setMargins(new Margins(5, 0, 0, 0));
    data.setCollapsible(true);
    data.setSplit(false);

    /*
     * south = new ContentPanel(); south.setBodyBorder(false); south.setAnimCollapse(true);
     * south.setCollapsible(true); south.setLayout(new FitLayout());
     * south.setLayoutOnChange(true); south.setScrollMode(Scroll.AUTOY);
     * south.setHeaderVisible(true);
     * south.setHeading(I18nProvider.getMessages().accordionLabel());
     * south.setMonitorWindowResize(true); south.setLayoutOnChange(true); south.layout();
     */
    south = new ContentPanel();
    south.setBodyBorder(false);
    south.setLayout(new FitLayout());
    south.setScrollMode(Scroll.AUTOY);
    south.setHeaderVisible(true);
    // south.setHeading(I18nProvider.getMessages().accordionLabel());
    south.setMonitorWindowResize(true);
    south.setLayoutOnChange(true);
    south.layout();

    south.addListener(
        Events.Resize,
        new Listener<BaseEvent>() {

          public void handleEvent(BaseEvent be) {
            Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE);
            // Dispatcher.forwardEvent(GeofenceEvents.UPDATE_SOUTH_SIZE);
          }
        });
    south.addListener(
        Events.Move,
        new Listener<BaseEvent>() {

          public void handleEvent(BaseEvent be) {
            Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE);
            // Dispatcher.forwardEvent(GeofenceEvents.UPDATE_SOUTH_SIZE);
          }
        });
    this.tabWidget = new TabWidget();

    south.add(this.tabWidget);

    Dispatcher.forwardEvent(GeofenceEvents.ATTACH_BOTTOM_TAB_WIDGETS, this.tabWidget);

    center.add(south, data);
  }
  private SageAlertViewport() {

    westPanel = new ContentPanel();
    westPanel.setScrollMode(Scroll.AUTOY);
    BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 280);
    westPanel.add(new MenuTreePanel(new MenuDataStore()));
    westPanel.setHeaderVisible(false);
    westPanel.setBottomComponent(new SageAlertToolBar());

    centerPanel = new ContentPanel();
    centerPanel.setLayout(new FitLayout());
    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    centerPanel.setHeaderVisible(false);

    mainWindow = new Window();
    mainWindow.setDraggable(false);
    mainWindow.setHeading("SageAlert v" + Version.getFullVersion());
    mainWindow.setClosable(false);
    mainWindow.setResizable(false);
    mainWindow.setSize(600, 450);
    mainWindow.setLayout(new BorderLayout());
    mainWindow.add(westPanel, westData);
    mainWindow.add(centerPanel, centerData);
    add(mainWindow);
    SettingsServiceAsync rpc = GWT.create(SettingsService.class);
    rpc.isLicensed(
        new AsyncCallback<Boolean>() {

          public void onFailure(Throwable caught) {
            GWT.log("ERROR", caught);
          }

          public void onSuccess(Boolean result) {
            String newHeading = mainWindow.getHeading();
            if (!result) newHeading = newHeading.concat(" (Unlicensed)");
            else newHeading = newHeading.concat(" (Licensed)");
            mainWindow.setHeading(newHeading);
          }
        });
  }
Exemple #7
0
  /** Creates the east. */
  private void createEast() {
    BorderLayoutData data =
        new BorderLayoutData(LayoutRegion.EAST, Constants.EASTH_PANEL_DIMENSION);
    data.setMargins(new Margins(5, 0, 5, 5));
    data.setCollapsible(true);
    data.setSplit(true);
    east = new ContentPanel();
    east.setBodyBorder(false);
    east.setLayout(new AccordionLayout());
    east.setHeading(I18nProvider.getMessages().accordionLabel());
    east.setScrollMode(Scroll.AUTO);

    east.addListener(
        Events.Resize,
        new Listener<BaseEvent>() {

          public void handleEvent(BaseEvent be) {
            Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE);
            // Dispatcher.forwardEvent(GeofenceEvents.UPDATE_SOUTH_SIZE);
          }
        });
    east.addListener(
        Events.Move,
        new Listener<BaseEvent>() {

          public void handleEvent(BaseEvent be) {
            Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE);
            // Dispatcher.forwardEvent(GeofenceEvents.UPDATE_SOUTH_SIZE);
          }
        });
    east.setStyleAttribute("height", "auto");
    east.setStyleAttribute("width", "auto");
    configureAccordionPanel();
    east.setMonitorWindowResize(true);
    east.setLayoutOnChange(true);
    viewport.add(east, data);
  }
Exemple #8
0
  private ContentPanel CreateGcode() {
    ContentPanel panel = new ContentPanel();
    //		panel.setSize(400, 400);
    panel.setAutoHeight(true);
    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("gname", "商品大类名称", 100);
    TextField<String> gnametext = new TextField<String>();
    gname.setEditor(new CellEditor(gnametext));
    columns.add(gname);

    ColumnConfig attrcode = new ColumnConfig("attrcode", "商品大类属性", 100);
    TextField<String> attrcodetext = new TextField<String>();
    attrcode.setEditor(new CellEditor(attrcodetext));
    columns.add(attrcode);

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

    type.addField("gcode");
    type.addField("gname");
    type.addField("attrcode");

    StoreInfo info = new StoreInfo();

    info.setTablename("gcode");
    info.setKeyname(new String[] {"gcode"});
    info.setSql("select * from gcode");
    //		info.setParent(store);// 关联主表
    //		info.setAutoinccolumn("idx"); // 自增字段,如果子表一定需要
    //		info.setLinkparentcolumns(new String[] { "ccode" }); // 关联主表字段
    gcodestore = new BaseStore<JDBCModelData>(type, info);
    //		gudong.setName("gudong");
    //		gudong.setKeyname(new String[] { "ccode", "idx" }); // 主键
    ColumnModel cm = new ColumnModel(columns);
    gcodeegrid = new BaseGrid(gcodestore, cm);

    cbs.setSelectionMode(SelectionMode.SINGLE);

    gcodeegrid.setSelectionModel(cbs);
    gcodeegrid.setAutoHeight(true);
    gcodeegrid.setAutoWidth(true);
    gcodeegrid
        .getSelectionModel()
        .addSelectionChangedListener(
            new SelectionChangedListener() {

              @Override
              public void selectionChanged(SelectionChangedEvent se) {
                if (se.getSelection().size() > 0) {
                  //					attrgroupgrid.getModel()
                  attrgroupgrid.getSelectionModel().deselectAll();
                  //	int attr =
                  // ((BaseModelData)gcodeegrid.getSelectionModel().getSelectedItems().get(0)).get("attrcode");
                  //	System.out.println("size="+attrgroupgrid.getStore().getModels().size());
                  //	for(int i=0;i<((BaseModelData)attrgroupgrid.getModel()).getProperties().size())

                  int size = attrgroupgrid.getStore().getModels().size();
                  int attr =
                      Integer.parseInt(
                          ((BaseModelData) gcodeegrid.getSelectionModel().getSelectedItems().get(0))
                              .get("attrcode")
                              .toString());

                  for (int i = 0; i < size; i++) {
                    int attrcode =
                        Integer.parseInt(attrgroupgrid.getValue(i, "attrcode").toString());
                    if ((attrcode & attr) == attrcode) {
                      attrgroupgrid.getSelectionModel().select(i, true);
                    }
                  }

                } else {
                  attrgroupgrid.getSelectionModel().deselectAll();
                }
              }
            });

    registerStore(gcodestore);
    panel.add(gcodeegrid);
    panel.setScrollMode(Scroll.AUTO);
    return panel;
  }
Exemple #9
0
  /**
   * 商品大类的属性
   *
   * @return
   */
  private ContentPanel CreateGcodeAttr() {
    ContentPanel panel = new ContentPanel();
    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 qty = new ColumnConfig("qty", "商品数量", 100);
    TextField<String> qtytext = new TextField<String>();
    qty.setEditor(new CellEditor(qtytext));
    columns.add(qty);

    ColumnConfig qtyunit = new ColumnConfig("qtyunit", "商品数量单位", 100);
    TextField<String> qtyunittext = new TextField<String>();
    qtyunit.setEditor(new CellEditor(qtyunittext));
    columns.add(qtyunit);

    ColumnConfig discount = new ColumnConfig("discount", "折扣比例", 100);
    TextField<String> discounttext = new TextField<String>();
    discount.setEditor(new CellEditor(discounttext));
    columns.add(discount);
    /*
    ColumnConfig attr = new ColumnConfig("attr", "商品属性", 60);
    TextField<String> attrtext = new TextField<String>();
    attr.setEditor(new CellEditor(attrtext));
    columns.add(attr);

    ColumnConfig attr2 = new ColumnConfig("attr2", "商品属性", 60);
    TextField<String> attr2text = new TextField<String>();
    attr2.setEditor(new CellEditor(attr2text));
    columns.add(attr2);
    ColumnConfig attr3 = new ColumnConfig("attr3", "商品属性", 60);
    TextField<String> attr3text = new TextField<String>();
    attr3.setEditor(new CellEditor(attr3text));
    columns.add(attr3);
    ColumnConfig attr4 = new ColumnConfig("attr4", "商品属性", 60);
    TextField<String> attr4text = new TextField<String>();
    attr4.setEditor(new CellEditor(attr4text));
    columns.add(attr4);
    ColumnConfig attr5 = new ColumnConfig("attr5", "商品属性", 60);
    TextField<String> attr5text = new TextField<String>();
    attr5.setEditor(new CellEditor(attr5text));
    columns.add(attr5);
    ColumnConfig attr6 = new ColumnConfig("attr6", "商品属性", 60);
    TextField<String> attr6text = new TextField<String>();
    attr6.setEditor(new CellEditor(attr6text));
    columns.add(attr6);

    ColumnConfig attr7 = new ColumnConfig("attr7", "商品属性", 60);
    TextField<String> attr7text = new TextField<String>();
    attr7.setEditor(new CellEditor(attr7text));
    columns.add(attr7);

    ColumnConfig attr8 = new ColumnConfig("attr8", "商品属性", 60);
    TextField<String> attr8text = new TextField<String>();
    attr8.setEditor(new CellEditor(attr8text));
    columns.add(attr8);*/

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

    type.addField("gcode");
    type.addField("qty");
    type.addField("qtyunit");
    type.addField("discount");

    /*		type.addField("attr1");
    type.addField("attr2");
    type.addField("attr3");
    type.addField("attr4");
    type.addField("attr5");
    type.addField("attr6");
    type.addField("attr7");
    type.addField("attr8");*/

    StoreInfo info = new StoreInfo();

    info.setTablename("b2cgcodeattr");

    info.setSql("select gcode,qty,qtyunit,discount from b2cgcodeattr");
    info.setParent(gcodestore); // 关联主表
    info.setAutoinccolumn("idx"); // 自增字段,如果子表一定需要
    info.setLinkparentcolumns(new String[] {"gcode"}); // 关联主表字段
    info.setKeyname(new String[] {"gcode", "idx"});
    BaseStore<JDBCModelData> gcodeattr = new BaseStore<JDBCModelData>(type, info);
    //		gudong.setName("gudong");
    //		gudong.setKeyname(new String[] { "ccode", "idx" }); // 主键
    ColumnModel cm = new ColumnModel(columns);
    BaseGrid attrgrid = new BaseGrid(gcodeattr, cm);

    cbs.setSelectionMode(SelectionMode.SINGLE);

    attrgrid.setSelectionModel(cbs);
    attrgrid.setAutoHeight(true);
    // attrgrid.setAutoWidth(true);

    registerStore(gcodeattr);
    attrgrid.setAutoHeight(true);
    panel.add(attrgrid);

    panel.setScrollMode(Scroll.AUTO);
    return panel;
  }
Exemple #10
0
  /**
   * 联系人
   *
   * @return
   */
  public ContentPanel createLinkManPanel() {

    CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();

    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());

    ColumnConfig lname = new ColumnConfig("lname", "姓名", 80);
    TextField<String> text = new TextField<String>();
    lname.setEditor(new CellEditor(text));
    columns.add(lname);

    ColumnConfig dept = new ColumnConfig("dept", "部门", 80);
    TextField<String> depttext = new TextField<String>();
    dept.setEditor(new CellEditor(depttext));
    columns.add(dept);

    ColumnConfig headship = new ColumnConfig("headship", "职务", 80);
    TextField<String> headshiptext = new TextField<String>();
    headship.setEditor(new CellEditor(headshiptext));
    columns.add(headship);

    ColumnConfig passportcode = new ColumnConfig("passportcode", "护照号", 80);
    TextField<String> passportcodetext = new TextField<String>();
    passportcode.setEditor(new CellEditor(passportcodetext));
    columns.add(passportcode);

    ColumnConfig postcode1 = new ColumnConfig("postcode", "邮编", 80);
    TextField<String> postcodetext = new TextField<String>();
    postcode1.setEditor(new CellEditor(postcodetext));
    columns.add(postcode1);
    ColumnModel cm = new ColumnModel(columns);

    ModelType type = new ModelType();
    type.setRoot("records");
    type.setRecordName("record");
    type.setTotalName("totle");
    type.addField("ccode", "ccode");

    type.addField("lname");
    type.addField("headship");
    type.addField("dept");
    type.addField("idx");
    type.addField("addr");
    type.addField("headship");
    type.addField("passportcode");

    type.addField("postcode");
    type.addField("telephone");
    type.addField("mobil");
    type.addField("privatemobil");
    type.addField("fax");
    type.addField("addrtype");

    StoreInfo info = new StoreInfo();

    info.setTablename("ccodelinkman_info");
    info.setSql("select * from ccodelinkman_info");
    info.setParent(store);
    info.setAutoinccolumn("idx");
    info.setLinkparentcolumns(new String[] {"ccode"});
    info.setKeyname(new String[] {"ccode", "idx"});

    BaseStore<JDBCModelData> branchorgadd = new BaseStore<JDBCModelData>(type, info);
    branchorgadd.setName("ccodelinkman_info");
    BaseGrid branchorgaddgrid = new BaseGrid(branchorgadd, cm);
    cbs.setSelectionMode(SelectionMode.SINGLE);
    branchorgaddgrid.setSelectionModel(cbs);
    //   officegrid.setAutoExpandColumn("ccode");
    //  panel.setLayout(new BorderLayout());

    // ----------------------------
    final BaseFormPanel formpanel = new BaseFormPanel(branchorgadd);

    TextField<String> branchtelephone = new TextField<String>();
    branchtelephone.setName("telephone");
    branchtelephone.setFieldLabel("办公电话");

    formpanel.add(branchtelephone);
    final TextField<String> mobil = new TextField<String>();
    mobil.setName("mobil");
    mobil.setFieldLabel("移动电话");

    formpanel.add(mobil);

    final TextField<String> privatemobil = new TextField<String>();
    privatemobil.setName("privatemobil");
    privatemobil.setFieldLabel("私人电话");
    formpanel.add(privatemobil);

    privatemobil.addKeyListener(
        new KeyListener() {
          public void componentKeyUp(ComponentEvent event) {
            mobil.setValue(privatemobil.getValue());
          }
        });

    TextField<String> fax = new TextField<String>();
    fax.setName("fax");
    fax.setFieldLabel("传真");

    formpanel.add(fax);

    TextField<String> addrtype = new TextField<String>();
    addrtype.setName("addrtype");
    addrtype.setFieldLabel("地址类型");

    formpanel.add(addrtype);

    final TextField<String> postcode = new TextField<String>();
    postcode.setName("postcode");
    postcode.setFieldLabel("邮编");

    formpanel.add(postcode);

    TextField<String> addr = new TextField<String>();
    addr.setName("addr");
    addr.setFieldLabel("通讯地址");

    formpanel.add(addr);

    formpanel.setScrollMode(Scroll.AUTO);
    formpanel.inited();

    // 设置联系人界面上半部分的布局
    LayoutContainer top = new LayoutContainer();
    TableLayout tl = new TableLayout(2);
    top.setLayout(tl);
    TableData td = new TableData();
    td.setColspan(1);

    td.setRowspan(1);
    td.setVerticalAlign(VerticalAlignment.TOP);
    //			TableData td2 = new TableData();
    //			td2.setColspan(1);
    //			td2.setRowspan(1);

    //		    branchorgaddgrid.setSize(300, 200);
    //   branchorgaddgrid.setAutoWidth(true);
    branchorgaddgrid.setWidth(420);
    branchorgaddgrid.setAutoHeight(true);
    // formpanel.setSize(300, 380);
    formpanel.setHeaderVisible(false);

    top.add(branchorgaddgrid, td);
    top.add(formpanel, td);

    // ----------------家庭成员ccodecustomersolicitude

    List<ColumnConfig> customercolumns = new ArrayList<ColumnConfig>();

    CheckBoxSelectionModel cbs2 = new CheckBoxSelectionModel();

    customercolumns.add(cbs2.getColumn());
    ColumnConfig leaguertype = new ColumnConfig("leaguertype", "家庭成员", 80);
    TextField<String> leaguertext = new TextField<String>();
    leaguertype.setEditor(new CellEditor(leaguertext));
    customercolumns.add(leaguertype);
    ColumnConfig leaguername = new ColumnConfig("leaguername", "姓名", 80);
    TextField<String> leaguernametext = new TextField<String>();
    leaguername.setEditor(new CellEditor(leaguernametext));
    customercolumns.add(leaguername);

    ColumnModel customercm = new ColumnModel(customercolumns);

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

    customertype.addField("ccode", "ccode");
    customertype.addField("leaguertype");
    customertype.addField("leaguername");
    customertype.addField("idx");
    customertype.addField("birthday");
    customertype.addField("commemorateday");
    customertype.addField("religion");
    customertype.addField("bekeenon");
    customertype.addField("tourexperience");
    customertype.addField("workexperience");
    customertype.addField("occupation");
    customertype.addField("workheadship");
    customertype.addField("remark");

    StoreInfo customerinfo = new StoreInfo();

    customerinfo.setTablename("ccodecustomersolicitude");
    customerinfo.setSql("select * from ccodecustomersolicitude");
    customerinfo.setParent(store);
    customerinfo.setAutoinccolumn("idx");
    customerinfo.setLinkparentcolumns(new String[] {"ccode"});
    customerinfo.setKeyname(new String[] {"ccode", "idx"});

    BaseStore<JDBCModelData> customertypestore =
        new BaseStore<JDBCModelData>(customertype, customerinfo);
    customertypestore.setName("ccodecustomersolicitude");
    BaseGrid customertypegrid = new BaseGrid(customertypestore, customercm);

    cbs2.setSelectionMode(SelectionMode.SINGLE);
    customertypegrid.setSelectionModel(cbs2);
    // ---------------------
    // --
    BaseFormPanel formcustomerpanel = new BaseFormPanel(customertypestore);
    formcustomerpanel.setHeaderVisible(false);

    TextField<String> birthdayc = new TextField<String>();
    birthdayc.setName("birthday");
    birthdayc.setFieldLabel("生日");

    formcustomerpanel.add(birthdayc);

    TextField<String> commemorateday = new TextField<String>();
    commemorateday.setName("commemorateday");
    commemorateday.setFieldLabel("纪念日");

    formcustomerpanel.add(commemorateday);

    TextField religion = new TextField();
    religion.setName("religion");
    religion.setFieldLabel("信仰");
    formcustomerpanel.add(religion);

    TextField bekeenon = new TextField();
    bekeenon.setName("bekeenon");
    bekeenon.setFieldLabel("主要爱好");

    formcustomerpanel.add(bekeenon);

    TextField tourexperience = new TextField();
    tourexperience.setName("tourexperience");
    tourexperience.setFieldLabel("旅游经历");

    formcustomerpanel.add(tourexperience);

    TextField workexperience = new TextField();
    workexperience.setName("workexperience");
    workexperience.setFieldLabel("工作经历");

    formcustomerpanel.add(workexperience);

    TextField occupation = new TextField();
    occupation.setName("occupation");
    occupation.setFieldLabel("职业");

    formcustomerpanel.add(occupation);

    TextField workheadship = new TextField();
    workheadship.setName("workheadship");
    workheadship.setFieldLabel("工作职位");

    formcustomerpanel.add(workheadship);

    TextField remark = new TextField();
    remark.setName("remark");
    remark.setFieldLabel("备注");

    formcustomerpanel.add(remark);
    formcustomerpanel.setScrollMode(Scroll.AUTO);
    formcustomerpanel.inited();
    //			    FormBinding formcustomerBindings = new FormBinding(formcustomerpanel, true);
    //			    formcustomerBindings.setStore(customertypestore);

    // --end

    ContentPanel panel = new ContentPanel();

    panel.setLayout(new TableLayout(2));
    panel.setHeaderVisible(false);

    TableData td1 = new TableData();
    td1.setColspan(2);

    //   panel.add(formpanel,td2);
    customertypegrid.setAutoHeight(true);
    //		    customertypegrid.setAutoWidth(true);
    customertypegrid.setWidth(420);
    //  formcustomerpanel.setSize(300, 300);

    TableData td2 = new TableData();
    td2.setColspan(1);
    td2.setRowspan(1);

    LayoutContainer bottom = new LayoutContainer();

    TableLayout bottomtl = new TableLayout(2);
    bottom.setLayout(bottomtl);
    TableData bottomtd = new TableData();
    bottomtd.setVerticalAlign(VerticalAlignment.TOP);
    bottomtd.setColspan(1);
    bottomtd.setRowspan(1);

    bottom.add(customertypegrid, bottomtd);
    bottom.add(formcustomerpanel, bottomtd);
    FieldSet fieldset = new FieldSet();
    fieldset.setHeading("联系人");
    FieldSet fieldset2 = new FieldSet();
    fieldset2.setHeading("联系人家庭成员信息");
    fieldset.add(top);
    fieldset2.add(bottom);

    panel.add(fieldset, td1);
    panel.add(fieldset2, td1);
    panel.setScrollMode(Scroll.AUTO);
    panel.setAutoHeight(true);
    panel.setAutoWidth(true);
    return panel;
  }
  protected void onRender(Element target, int index) {
    super.onRender(target, index);

    final FitLayout fl = new FitLayout();

    LayoutContainer layoutContainer = new LayoutContainer();
    layoutContainer.setBorders(false);
    layoutContainer.setLayout(fl);

    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(3);

    ContentPanel cpGrid = new ContentPanel();
    cpGrid.setHeaderVisible(true);
    cpGrid.setHeading("Lista Dipendenti.");
    cpGrid.setBorders(false);
    cpGrid.setFrame(true);
    cpGrid.setHeight((h - 65));
    cpGrid.setWidth(w - 250);
    cpGrid.setScrollMode(Scroll.AUTO);
    cpGrid.setLayout(new FitLayout());
    cpGrid.setButtonAlign(HorizontalAlignment.CENTER);
    Resizable r = new Resizable(cpGrid);

    btnPrint = new Button();
    btnPrint.setEnabled(true);
    btnPrint.setIcon(AbstractImagePrototype.create(MyImages.INSTANCE.print24()));
    btnPrint.setIconAlign(IconAlign.TOP);
    btnPrint.setToolTip("Stampa");
    btnPrint.setSize(26, 26);
    btnPrint.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(ButtonEvent ce) {
            SessionManagementService.Util.getInstance()
                .setDatiReportCostiDip(
                    "RIEP.COSTI",
                    store.getModels(),
                    new AsyncCallback<Boolean>() {

                      @Override
                      public void onFailure(Throwable caught) {
                        Window.alert("Error on setNomeReport()");
                      }

                      @Override
                      public void onSuccess(Boolean result) {
                        if (result) fp.submit();
                        else
                          Window.alert(
                              "Problemi durante il settaggio dei parametri in Sessione (http)");
                      }
                    });
          }
        });

    btnAdd = new Button();
    btnAdd.setStyleAttribute("padding-left", "2px");
    btnAdd.setIcon(AbstractImagePrototype.create(MyImages.INSTANCE.add()));
    btnAdd.setIconAlign(IconAlign.TOP);
    btnAdd.setSize(26, 26);
    btnAdd.setToolTip("Nuova Offerta");
    btnAdd.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            RiepilogoCostiDipendentiModel am =
                new RiepilogoCostiDipendentiModel(
                    0, 0, "", "0.00", "", "0", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "",
                    "", "");

            gridRiepilogo.stopEditing();
            store.insert(am, 0);
            gridRiepilogo.startEditing(store.indexOf(am), 0);
          }
        });

    btnConfirm = new Button();
    btnConfirm.setEnabled(true);
    btnConfirm.setIcon(AbstractImagePrototype.create(MyImages.INSTANCE.confirm()));
    btnConfirm.setIconAlign(IconAlign.TOP);
    btnConfirm.setToolTip("Conferma modifiche");
    btnConfirm.setSize(26, 26);
    btnConfirm.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(ButtonEvent ce) {

            RiepilogoCostiDipendentiModel c = new RiepilogoCostiDipendentiModel();

            for (Record record : store.getModifiedRecords()) {

              c = (RiepilogoCostiDipendentiModel) record.getModel();

              AdministrationService.Util.getInstance()
                  .editDatiCostiAzienda(
                      c,
                      new AsyncCallback<Boolean>() {

                        @Override
                        public void onFailure(Throwable caught) {
                          Window.alert("Errore di connessione on insertNewOffertaWithRda();");
                        }

                        @Override
                        public void onSuccess(Boolean result) {
                          if (result) {
                            caricaTabellaDati();
                          } else {
                            Window.alert(
                                "error: Impossibile effettuare l'inserimento/modifica dei dati!");
                          }
                        }
                      });
            }
          }
        });

    if ((ruolo.compareTo("PM") == 0)) {
      btnConfirm.disable();
      btnAdd.disable();
    }

    smplcmbxSede = new SimpleComboBox<String>();
    smplcmbxSede.setFieldLabel("Sede");
    smplcmbxSede.setWidth(65);
    smplcmbxSede.setEmptyText("Sede..");
    smplcmbxSede.setAllowBlank(false);
    smplcmbxSede.add("T");
    smplcmbxSede.add("B");
    smplcmbxSede.setStyleAttribute("padding-left", "2px");
    smplcmbxSede.addListener(
        Events.Select,
        new Listener<BaseEvent>() {
          @Override
          public void handleEvent(BaseEvent be) {
            caricaTabellaDati();
          }
        });

    // caricaTabellaDati();

    cm = new ColumnModel(createColumns());
    gridRiepilogo = new EditorGrid<RiepilogoCostiDipendentiModel>(store, cm);
    gridRiepilogo.setBorders(false);
    gridRiepilogo.setColumnLines(true);
    gridRiepilogo.setStripeRows(true);
    gridRiepilogo.setItemId("grid");
    gridRiepilogo.setSelectionModel(csm);

    fp.setMethod(FormPanel.METHOD_POST);
    fp.setAction(url);
    fp.addSubmitCompleteHandler(new FormSubmitCompleteHandler());
    fp.add(btnPrint);
    ContentPanel cp = new ContentPanel();
    cp.setHeaderVisible(false);
    cp.add(fp);

    ToolBar tlBar = new ToolBar();
    tlBar.add(smplcmbxSede);
    tlBar.add(btnAdd);
    tlBar.add(btnConfirm);
    tlBar.add(new SeparatorToolItem());
    tlBar.add(cp);

    cpGrid.setTopComponent(tlBar);
    cpGrid.add(gridRiepilogo);

    layoutContainer.add(cpGrid, new FitData(3, 3, 3, 3));

    add(layoutContainer);
  }
  private void createGesturePropertyForm() {
    FormPanel gesturePropertyForm = new FormPanel();
    gesturePropertyForm.setLabelAlign(LabelAlign.TOP);
    gesturePropertyForm.setHeaderVisible(false);

    final Text selectedCommand = new Text(SELECTED_COMMAND);

    ContentPanel commandTreeContainer = new ContentPanel();
    commandTreeContainer.setHeaderVisible(false);
    commandTreeContainer.setBorders(false);
    commandTreeContainer.setBodyBorder(false);
    commandTreeContainer.setSize(240, 150);
    commandTreeContainer.setLayout(new FitLayout());
    commandTreeContainer.setScrollMode(Scroll.AUTO);
    if (devicesAndMacrosTree == null) {
      devicesAndMacrosTree = TreePanelBuilder.buildCommandAndMacroTree();
      commandTreeContainer.add(devicesAndMacrosTree);
    }
    devicesAndMacrosTree.collapseAll();
    final AdapterField commandField = new AdapterField(commandTreeContainer);
    commandField.setFieldLabel("Select a command");
    commandField.setBorders(true);
    devicesAndMacrosTree
        .getSelectionModel()
        .addSelectionChangedListener(
            new SelectionChangedListener<BeanModel>() {
              public void selectionChanged(SelectionChangedEvent<BeanModel> se) {
                BeanModel commandModel = se.getSelectedItem();
                if (commandModel.getBean() != null) {
                  UICommandDTO uiCommand = commandModel.getBean();
                  selectedCommand.setText(SELECTED_COMMAND + uiCommand.getDisplayName());
                  selectedGesture.setUiCommandDTO(uiCommand);
                }
              }
            });

    final NavigateFieldSet navigateSet =
        new NavigateFieldSet(selectedGesture.getNavigate(), groups);
    navigateSet.setStyleAttribute("marginTop", "10px");
    navigateSet.setCheckboxToggle(true);
    navigateSet.addListener(
        Events.BeforeExpand,
        new Listener<FieldSetEvent>() {
          @Override
          public void handleEvent(FieldSetEvent be) {
            if (!selectedGesture.getNavigate().isSet()) {
              selectedGesture.getNavigate().setToLogical(ToLogicalType.setting);
            }
            navigateSet.update(selectedGesture.getNavigate());
          }
        });
    navigateSet.addListener(
        Events.BeforeCollapse,
        new Listener<FieldSetEvent>() {
          @Override
          public void handleEvent(FieldSetEvent be) {
            selectedGesture.getNavigate().clear();
          }
        });
    navigateSet.collapse();

    gesturePropertyForm.add(commandField);
    gesturePropertyForm.add(selectedCommand);
    gesturePropertyForm.add(navigateSet);
    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    add(gesturePropertyForm, centerData);

    gestureTypeListView.addListener(
        Events.Select,
        new Listener<ListViewEvent<BeanModel>>() {
          public void handleEvent(ListViewEvent<BeanModel> be) {
            Gesture gesture =
                gestureMaps.get(((Gesture) be.getModel().getBean()).getType().toString());
            if (!gesture.equals(selectedGesture)) {
              selectedGesture = gesture;
              devicesAndMacrosTree.collapseAll();
              if (selectedGesture.getUiCommandDTO() != null) {
                selectedCommand.setText(
                    SELECTED_COMMAND + selectedGesture.getUiCommandDTO().getDisplayName());
              } else {
                selectedCommand.setText(SELECTED_COMMAND);
              }
              if (selectedGesture.getNavigate().isSet()) {
                navigateSet.expand();
                navigateSet.fireEvent(Events.BeforeExpand);
              } else {
                navigateSet.collapse();
              }
            }
          }
        });
  }
  protected void onRender(Element target, int index) {
    super.onRender(target, index);
    final BorderLayout layout = new BorderLayout();
    setLayout(layout);
    setStyleAttribute("padding", "10px");

    ContentPanel north = new ContentPanel();
    ContentPanel west = new ContentPanel();
    ContentPanel center = new ContentPanel();
    center.setHeading("BorderLayout Example");
    center.setScrollMode(Scroll.AUTOX);

    FlexTable table = new FlexTable();
    table.getElement().getStyle().setProperty("margin", "10px");
    table.setCellSpacing(8);
    table.setCellPadding(4);

    for (int i = 0; i < LayoutRegion.values().length; i++) {
      final LayoutRegion r = LayoutRegion.values()[i];
      if (r == LayoutRegion.CENTER) {
        continue;
      }
      SelectionListener<ButtonEvent> sl =
          new SelectionListener<ButtonEvent>() {

            @Override
            public void componentSelected(ButtonEvent ce) {
              String txt = ce.getButton().getText();
              if (txt.equals("Expand")) {
                layout.expand(r);
              } else if (txt.equals("Collapse")) {
                layout.collapse(r);
              } else if (txt.equals("Show")) {
                layout.show(r);
              } else {
                layout.hide(r);
              }
            }
          };
      table.setHTML(i, 0, "<div style='font-size: 12px; width: 100px'>" + r.name() + ":</span>");
      table.setWidget(i, 1, new Button("Expand", sl));
      table.setWidget(i, 2, new Button("Collapse", sl));
      table.setWidget(i, 3, new Button("Show", sl));
      table.setWidget(i, 4, new Button("Hide", sl));
    }
    center.add(table);

    ContentPanel east = new ContentPanel();
    ContentPanel south = new ContentPanel();

    BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 100);
    northData.setCollapsible(true);
    northData.setFloatable(true);
    northData.setHideCollapseTool(true);
    northData.setSplit(true);
    northData.setMargins(new Margins(0, 0, 5, 0));

    BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 150);
    westData.setSplit(true);
    westData.setCollapsible(true);
    westData.setMargins(new Margins(0, 5, 0, 0));

    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    centerData.setMargins(new Margins(0));

    BorderLayoutData eastData = new BorderLayoutData(LayoutRegion.EAST, 150);
    eastData.setSplit(true);
    eastData.setCollapsible(true);
    eastData.setMargins(new Margins(0, 0, 0, 5));

    BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 100);
    southData.setSplit(true);
    southData.setCollapsible(true);
    southData.setFloatable(true);
    southData.setMargins(new Margins(5, 0, 0, 0));

    add(north, northData);
    add(west, westData);
    add(center, centerData);
    add(east, eastData);
    add(south, southData);
  }
Exemple #14
0
  private Window createAccordionWindow() {
    final Window w = new Window();
    w.setMinimizable(true);
    w.setMaximizable(true);
    w.setIcon(IconHelper.createStyle("accordion"));
    w.setHeading("Contact list");
    w.setWidth(200);
    w.setHeight(350);

    ToolBar toolBar = new ToolBar();
    Button item = new Button();
    item.setIcon(IconHelper.createStyle("icon-connect"));
    toolBar.add(item);

    toolBar.add(new SeparatorToolItem());
    w.setTopComponent(toolBar);

    item = new Button();
    item.setIcon(IconHelper.createStyle("icon-user-add"));
    toolBar.add(item);

    item = new Button();
    item.setIcon(IconHelper.createStyle("icon-user-delete"));
    toolBar.add(item);

    w.setLayout(new AccordionLayout());

    ContentPanel cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Online Users");
    cp.setScrollMode(Scroll.AUTO);
    cp.getHeader().addTool(new ToolButton("x-tool-refresh"));

    w.add(cp);

    TreeStore<ModelData> store = new TreeStore<ModelData>();
    TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
    tree.setIconProvider(
        new ModelIconProvider<ModelData>() {

          public AbstractImagePrototype getIcon(ModelData model) {
            if (model.get("icon") != null) {
              return IconHelper.createStyle((String) model.get("icon"));
            } else {
              return null;
            }
          }
        });
    tree.setDisplayProperty("name");

    ModelData m = newItem("Eurecom", null);
    store.add(m, false);
    tree.setExpanded(m, true);

    store.add(m, newItem("Emerson Milton", "user-suit"), false);
    store.add(m, newItem("Christina Blake", "user-girl"), false);
    store.add(m, newItem("Heriberto Rush", "user-kid"), false);
    store.add(m, newItem("Candice Carson", "user-girl"), false);
    store.add(m, newItem("Bell Snedden", "user-kid"), false);
    store.add(m, newItem("Dirk Newman", "user-kid"), false);
    store.add(m, newItem("Chad Andrews", "user-suit"), false);

    m = newItem("Italy", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Benito Meeks", "user-suit"), false);
    store.add(m, newItem("Gail Horton", "user-girl"), false);

    m = newItem("Paris", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Claudio Engle", "user-suit"), false);
    store.add(m, newItem("Sine", "user-girl"), false);

    m = newItem("Hometown", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Hollie Voss", "user-girl"), false);

    cp.add(tree);

    cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Settings");
    cp.setBodyStyleName("pad-text");
    cp.addText("Smape1");
    w.add(cp);

    cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Blocked");
    cp.setBodyStyleName("pad-text");
    cp.addText("Smape2");
    w.add(cp);

    return w;
  }