void setFieldValue(Rule model, LabelField field) {
   if (model.getLayer() != null) {
     field.setValue(model.getLayer());
   } else {
     field.setValue("*");
   }
 }
 void setFieldValue(Rule model, LabelField field) {
   if (model.getSourceIPRange() != null) {
     field.setValue(model.getSourceIPRange());
   } else {
     field.setValue("*");
   }
 }
 void setFieldValue(Rule model, LabelField field) {
   if ((model.getInstance() != null) && (model.getInstance().getName() != null)) {
     field.setValue(model.getInstance().getName());
   } else {
     field.setValue("*");
   }
 }
 void setFieldValue(Rule model, LabelField field) {
   if ((model.getProfile() != null) && (model.getProfile().getName() != null)) {
     String name2 = model.getProfile().getName();
     field.setValue(name2);
   } else {
     field.setValue("*");
   }
 }
  private void initField(LabelField field) {
    field.setFieldLabel(getField().getLabel());

    String value = getField().getValue();
    if (!value.equals("")) {
      field.setValue(value);
      field.fireEvent(Events.Change);
    }
  }
    public Object render(
        final Rule model,
        String property,
        ColumnData config,
        int rowIndex,
        int colIndex,
        ListStore<Rule> store,
        Grid<Rule> grid) {

      if (!init) {
        init = true;
        grid.addListener(Events.ColumnResize, new ResizeListener(20));
      }

      LabelField field = new LabelField();
      field.setId(fieldId);
      field.setName(fieldId);
      field.setEmptyText("*");
      field.setFieldLabel(BeanKeyValue.NAME.getValue());
      field.setValue(BeanKeyValue.NAME.getValue());
      field.setReadOnly(true);

      //            field.setWidth(initialWidth - 10);
      field.setAutoWidth(true);
      field.show();

      setFieldValue(model, field);

      return field;
    }
 private Field<?> buildTextField(
     final LayoutContainer fieldPart, final LayoutContainer messagePart, Config config) {
   String key = config.labelKey;
   if (config.editable
       && userBean.getRole().getRights().contains(RightsConstants.CONFIG_MANAGMENT)) {
     TextField<String> field = new TextField<String>();
     field.setName(config.name());
     buildField(config, I18nUtils.getString(key), field, fieldPart, messagePart);
     bindings.add(new FieldBinding<String>(field, config.name(), null));
     return field;
   } else {
     LabelField field = new LabelField();
     field.setName(config.name());
     buildField(config, I18nUtils.getString(key), field, fieldPart, messagePart);
     bindings.add(new FieldBinding<Object>(field, config.name(), null));
     return field;
   }
 }
  public GroupDialog(Group pGroup) {
    this.group = pGroup;
    this.setHeading(textMessages.group());
    this.setModal(true);
    this.setLayout(new AbsoluteLayout());
    this.setSize("455", "355");
    this.setResizable(false);

    LabelField lblfldName = new LabelField(textMessages.name_());
    add(lblfldName, new AbsoluteData(6, 13));
    lblfldName.setSize("82px", "19px");

    nameTextBox = new TextField<String>();
    add(nameTextBox, new AbsoluteData(128, 13));
    nameTextBox.setSize("306px", "22px");

    LabelField lblfldUsers = new LabelField(textMessages.users_());
    add(lblfldUsers, new AbsoluteData(6, 49));
    lblfldUsers.setSize("54px", "19px");

    LabelField lblfldAvailable = new LabelField(textMessages.available());
    add(lblfldAvailable, new AbsoluteData(6, 74));
    lblfldAvailable.setSize("67px", "19px");

    LabelField lblfldMembers = new LabelField(textMessages.members());
    add(lblfldMembers, new AbsoluteData(232, 74));
    lblfldMembers.setSize("74px", "19px");

    DualListField<UserData> membersListBox = new DualListField<UserData>();
    add(membersListBox, new AbsoluteData(6, 96));
    membersListBox.setSize("428px", "183px");
    ListField<UserData> from = membersListBox.getFromList();
    ListField<UserData> to = membersListBox.getToList();

    from.setSize(300, 100);
    from.setDisplayField(Constants.FULLNAME);
    fromUserStore = new ListStore<UserData>();
    fromUserStore.sort(Constants.FULLNAME, SortDir.ASC);
    from.setStore(fromUserStore);
    to.setDisplayField(Constants.FULLNAME);
    to.setSize(300, 100);
    toUserStore = new ListStore<UserData>();
    toUserStore.sort(Constants.FULLNAME, SortDir.ASC);
    to.setStore(toUserStore);

    Button saveButton =
        new Button(
            textMessages.save(),
            new SelectionListener<ButtonEvent>() {
              @Override
              public void componentSelected(ButtonEvent ce) {
                doSave();
              }
            });

    Button cancelButton =
        new Button(
            textMessages.cancel(),
            new SelectionListener<ButtonEvent>() {
              @Override
              public void componentSelected(ButtonEvent ce) {
                doCancel();
              }
            });

    setButtonAlign(HorizontalAlignment.CENTER);
    addButton(saveButton);
    addButton(cancelButton);

    setFields();
  }
 public void setToolBar4ErrorStatus(String status) {
   lt.setStyleName("errorMessage");
   lt.setText(status);
   lt.setVisible(true);
 }
 public void setToolBar4Status(String status) {
   lt.setStyleName("toolbarMessage");
   lt.setText(status);
 }
Exemple #11
0
  LayoutContainer initProButtons() {

    TableLayout tl = new TableLayout(2);
    lc.setLayout(tl);

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

    bsd_add =
        new BcodeSelectDialog<TreeNodeModelData>() {
          public void doposted(List<TreeNodeModelData> modeldatalist) {
            if (modeldatalist.size() > 0) {
              this.setEmptyText("已经选择了数据");

              List<TreeNodeModelData> selectchecklist = bsd_add.getTree().getCheckedSelection();

              if (selectchecklist.size() <= 0) {
                MessageBox.alert("错误", "请选择“离职人员”", null);
                return;
              }
              String bcodestr = "";
              for (TreeNodeModelData tnmd : selectchecklist) {
                BusiObject bo = new BusiObject();

                bcodestr += " systembcode like '" + tnmd.get("systembcode") + "%25' or ";
              }
              bcodestr += " 1=2";
              GWT.log("bcodestr =" + bcodestr);

              String sql =
                  "select icode, bcode,employstatus,leavereason,leavemark,Resignationdate from bcode_job where exists (select * from systembcode_view where systembcode_view.bcode = bcode_job.bcode  and ( "
                      + bcodestr
                      + "))";
              GWT.log("sql =" + sql);
              store.getStoreinfo().setSql(sql);
              store.reload();
            }
          }
        };
    bsd_add.setNeesreselect(false);
    bsd_add.setEmptyText("未选择数据");
    bsd_add.setExpanded();
    bsd_add.setCheckNodes(CheckNodes.BOTH);

    Resignationdate = new DateField();
    Resignationdate.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));

    save.addListener(Events.OnClick, getListener());
    lc.add(new LabelField("选择人员:"), td1);
    lc.add(bsd_add, td1);

    lc.add(new LabelField("状态改变为:"), td1);
    lc.add(C_num8, td1);

    lc.add(leavereason_l, td1);
    lc.add(C_num9, td1);

    lc.add(resignationdate_l, td1);
    lc.add(Resignationdate, td1);

    lc.add(mark_l, td1);
    lc.add(mark_t, td1);

    leavereason_l.setVisible(false);
    C_num9.setVisible(false);
    mark_l.setVisible(false);
    mark_t.setVisible(false);
    resignationdate_l.setVisible(false);
    Resignationdate.setVisible(false);

    lc.add(save, td2);

    bsd_add.addListener(Events.Changed, getListener());
    C_num8.addListener(Events.Changed, getListener());
    C_num9.addListener(Events.Changed, getListener());
    mark_t.addListener(Events.Changed, getListener());
    Resignationdate.addListener(Events.Changed, getListener());
    return lc;
  }
  private FormPanel createForm() {
    FormPanel panel = new FormPanel();
    panel.setFrame(true);
    // panel.setIconStyle("icon-filter");
    panel.setCollapsible(false);
    panel.setHeaderVisible(false);
    // panel.setHeading("Select views to import");
    panel.setSize(410, -1);
    panel.setButtonAlign(HorizontalAlignment.RIGHT);
    panel.setLayout(new FlowLayout());

    // main container:
    LayoutContainer main = new LayoutContainer();
    RowLayout rowLayout = new RowLayout();
    main.setLayout(rowLayout);

    main.add(createAccountChoice());
    main.add(createTreePanel());

    panel.add(main);

    // Checkboxes for public/editable:
    final LayoutContainer rights = new LayoutContainer();
    RowLayout rLayout = new RowLayout();
    rights.setLayout(rLayout);

    makePublicView = new CheckBox();
    makePublicView.setBoxLabel(constants.visibleForAllViewers());

    makeEditableView = new CheckBox();
    makeEditableView.setBoxLabel(constants.visibleAndEditableForAllEditors());

    if (showBoxes) {
      rights.add(makePublicView);
      rights.add(makeEditableView);
      makePublicView.setValue(false);
      makeEditableView.setValue(false);
    }
    panel.add(rights);

    LabelField label = new LabelField();
    label.setHeight("20px");
    panel.add(label);

    // finally the apply/cancel button:
    SelectionListener<ComponentEvent> listener =
        new SelectionListener<ComponentEvent>() {
          public void componentSelected(ComponentEvent ce) {
            if (ce.component instanceof Button) {
              Button pressedButton = (Button) ce.component;
              // we close dialog on button press:
              if (closeAction == CloseAction.CLOSE) close(pressedButton);
              else hide(pressedButton);
            }
          }
        };
    okButton = importViews ? new Button(constants.importAction()) : new Button(constants.create());
    okButton.setItemId(BUTTON_OK);
    cancelButton = new Button(constants.cancel());
    cancelButton.setItemId(BUTTON_CANCEL);
    okButton.addSelectionListener(listener);
    cancelButton.addSelectionListener(listener);
    panel.addButton(okButton);
    panel.addButton(cancelButton);

    return panel;
  }