示例#1
0
  public void onSuccess(UserModel user) {
    deck.showWidget(1);

    if (!GwtClientUtils.preSuccessCheck(user, null)) {
      return;
    }

    // user exist - then fill all user information form and display information.
    if (user.getUid() != null && user.getUid() > 0) {
      fillPanel(user);
      form1.fillFields(user);
      form2.fillFields(user);
      form3.fillFields(user);
      editDeck.showWidget(0);
    }
    // image loading and center
    Scheduler.get()
        .scheduleDeferred(
            new ScheduledCommand() {
              public void execute() {
                ProfileDialog.this.center();
              }
            });
    // TODO: user not exist, error message display
  }
  public void onSuccess(UserListModel model) {

    if (!GwtClientUtils.preSuccessCheck(model, null)) {
      // just simple display message on panel
      msgLabel.clear();
      msgLabel.add(ErrorCode.getMessage(model.errorCode, model.errorCode));
      return;
    }
    // show all users in this space group in table;
    fillPanel(model.getUserModelList());
  }
示例#3
0
  private void fillPanel(UserModel model) {
    if (model == null) return;

    resetTitle(model.getLoginname());
    // if it's login user, refresh navbar user name
    if (model.isLogin()) BaseEntryPoint.I.resetLoginUser(model.getFullname());

    //		set display info on left part
    fullname.setText(model.getFullname());

    contacts.setUser(model);
    statusText.setText(StringUtil.trimToEmpty(model.getStatus()));
    this.userUid = model.getUid();

    if (model.getPortrait() != null) {
      // while user update Profile, the portrait won't refresh. See userPortraitUpdated() method
      portrait.clear();
      portrait.setWidget(GwtClientUtils.createUserPortrait(model.getPortrait()));
    }
  }
示例#4
0
  public void onSuccess(PageItemListModel model) {
    if (!GwtClientUtils.preSuccessCheck(model, message)) {
      return;
    }

    pagesPanel.clear();
    for (PageItemModel item : model.itemList) {
      Hyperlink link =
          new Hyperlink(item.title, GwtUtils.getSpacePageToken(item.spaceUname, item.title));
      link.addClickHandler(
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              TagPopup.this.hide();
            }
          });
      pagesPanel.add(link);
    }

    resized();
  }
  /**
   * @param model
   * @param content
   */
  private void callback(PortletModel model, RenderMarkupModel content) {
    busy(false);
    messagePanel.clear();
    clearControl();

    if (!GwtClientUtils.preSuccessCheck(model, null)) {
      // show error message on item part rather than general error message on HTML page above
      messagePanel.add(ErrorCode.getMessage(model.errorCode, model.errorMsg));
      return;
    }
    if (content.renderContent == null || content.renderContent.size() == 0) {
      contentPanel.clear();
      Label none = new Label("(" + Msg.consts.none() + ")");
      none.setStyleName(Css.PORTLET_WEAK_TEXT);
      contentPanel.add(none);
      contentPanel.submit();
    } else {
      PageRender render = new PageRender(contentPanel);
      render.renderContent(null, null, content.renderContent, false);

      controlBar.setPaginationInfo(model.hasPre, model.hasNxt, model.currentPage);
      addControl(controlBar);
    }
  }
示例#6
0
  public void userPortraitUpdated(String portraitUuid) {
    portrait.clear();
    portrait.setWidget(GwtClientUtils.createUserPortrait(portraitUuid));

    editDeck.showWidget(0);
  }
示例#7
0
 public void onFailure(Throwable error) {
   deck.showWidget(1);
   GwtClientUtils.processError(error);
 }
 public void onFailure(Throwable error) {
   controlBar.busy(false);
   GwtClientUtils.processError(error);
 }
示例#9
0
 public void onFailure(Throwable error) {
   GwtClientUtils.processError(error);
 }