Ejemplo n.º 1
0
  private Layout() {

    vLayout = new VLayout();
    vLayout.setWidth100();
    vLayout.setHeight100();

    messageWindow = new MessageWindow(vLayout);

    vLayout.addMember(MainToolStrip.getInstance());

    mainSectionStack = new SectionStack();
    mainSectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    mainSectionStack.setAnimateSections(true);
    mainSectionStack.setCanResizeSections(true);

    SectionStackSection mainTabSection = new SectionStackSection();
    mainTabSection.setCanCollapse(false);
    mainTabSection.setShowHeader(false);

    centerTabSet = CenterTabSet.getInstance();
    mainTabSection.addItem(centerTabSet);

    mainSectionStack.setSections(mainTabSection);

    vLayout.addMember(mainSectionStack);

    modal = new ModalWindow(vLayout);

    vLayout.draw();
  }
  public UserManagement() {
    setWidth100();
    setHeight100();
    setLayoutMargin(20);

    UserDataSource userDS = UserDataSource.getInstance();

    searchForm = new SearchForm(userDS);

    // final ComboBoxItem searchConditions = searchForm.getSearchConditionField();

    setupContextMenu();

    userList = new ItemListGrid(userDS);
    userList.addRecordClickHandler(
        new RecordClickHandler() {
          public void onRecordClick(RecordClickEvent event) {
            userDetailTabPane.updateDetails();
          }
        });

    userList.addCellSavedHandler(
        new CellSavedHandler() {
          public void onCellSaved(CellSavedEvent event) {
            userDetailTabPane.updateDetails();
          }
        });

    userList.addCellContextClickHandler(
        new CellContextClickHandler() {
          public void onCellContextClick(CellContextClickEvent event) {
            userListMenu.showContextMenu();
            event.cancel();
          }
        });

    SectionStack sessionLayout = new SectionStack();
    sessionLayout.setVisibilityMode(VisibilityMode.MULTIPLE);
    sessionLayout.setAnimateSections(true);

    searchForm.setHeight(60);
    searchForm.addFindListener(
        new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
          public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
            findUsers();
          }
        });

    SectionStackSection findSection = new SectionStackSection("Find Users");
    findSection.setItems(searchForm);
    findSection.setExpanded(true);

    SectionStackSection usersSection = new SectionStackSection("User List");
    usersSection.setItems(userList);
    usersSection.setExpanded(true);

    userDetailTabPane = new UserDetailTabPane(userDS, userList);
    SectionStackSection userDetailsSection = new SectionStackSection("User Details");
    userDetailsSection.setItems(userDetailTabPane);
    userDetailsSection.setExpanded(true);

    sessionLayout.setSections(findSection, usersSection, userDetailsSection);

    addMember(sessionLayout);
  }