Exemplo n.º 1
0
  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();
  }
Exemplo n.º 2
0
  public UserDialog(User pUser) {
    this.user = pUser;
    this.setHeading(textMessages.user());
    this.setModal(true);
    this.setLayout(new AbsoluteLayout());
    this.setSize("455", "475");
    this.setResizable(false);

    LabelField lblfldUsername = new LabelField(textMessages.username_());
    add(lblfldUsername, new AbsoluteData(6, 6));
    usernameTextBox = new TextField<String>();
    usernameTextBox.setReadOnly(user.getId() > 0);
    add(usernameTextBox, new AbsoluteData(144, 6));
    usernameTextBox.setSize("271px", "22px");
    LabelField lblfldFullName = new LabelField(textMessages.fullname_());
    add(lblfldFullName, new AbsoluteData(6, 34));
    fullnameTextBox = new TextField<String>();
    add(fullnameTextBox, new AbsoluteData(144, 34));
    fullnameTextBox.setSize("271px", "22px");
    LabelField lblfldEmail = new LabelField(textMessages.email_());
    add(lblfldEmail, new AbsoluteData(6, 62));
    emailTextBox = new TextField<String>();
    add(emailTextBox, new AbsoluteData(144, 62));
    emailTextBox.setSize("271px", "22px");
    LabelField lblfldPassword = new LabelField(textMessages.password_());
    add(lblfldPassword, new AbsoluteData(6, 90));
    password1TextBox = new TextField<String>();
    password1TextBox.setPassword(true);
    add(password1TextBox, new AbsoluteData(144, 90));
    password1TextBox.setSize("271px", "22px");
    password2TextBox = new TextField<String>();
    password2TextBox.setPassword(true);
    add(password2TextBox, new AbsoluteData(144, 118));
    password2TextBox.setSize("271px", "22px");
    enabledCheckBox = new CheckBox();
    enabledCheckBox.setBoxLabel(textMessages.enabled());
    add(enabledCheckBox, new AbsoluteData(144, 146));
    enabledCheckBox.setSize("76px", "22px");

    LabelField lblfldGroups = new LabelField(textMessages.groups_());
    add(lblfldGroups, new AbsoluteData(6, 170));
    LabelField lblfldAvailable = new LabelField(textMessages.available());
    add(lblfldAvailable, new AbsoluteData(6, 195));
    LabelField lblfldMembers = new LabelField(textMessages.memberOf());
    add(lblfldMembers, new AbsoluteData(233, 195));

    DualListField<GroupData> membersListBox = new DualListField<GroupData>();
    add(membersListBox, new AbsoluteData(6, 216));
    membersListBox.setSize("424px", "183px");
    ListField<GroupData> from = membersListBox.getFromList();
    ListField<GroupData> to = membersListBox.getToList();
    from.setSize(300, 100);
    from.setDisplayField(Constants.NAME);
    fromGroupStore = new ListStore<GroupData>();
    fromGroupStore.sort(Constants.NAME, SortDir.ASC);
    from.setStore(fromGroupStore);
    to.setDisplayField(Constants.NAME);
    to.setSize(300, 100);
    toGroupStore = new ListStore<GroupData>();
    toGroupStore.sort(Constants.NAME, SortDir.ASC);
    to.setStore(toGroupStore);

    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();
  }