예제 #1
0
  public TagPopup(UIObject target, String spaceUname, String tagname) {
    super(target, true, true, true);
    this.spaceUname = spaceUname;
    this.tagname = tagname;

    VerticalPanel panel = new VerticalPanel();
    panel.add(message);
    panel.add(new HTML("<b>" + tagname + "</b>"));
    panel.add(new Hr());
    panel.add(pagesPanel);
    if (!AbstractEntryPoint.isOffline()) {
      // so far, have to block tag cloud in offline model as the macro render logic is on
      // MacroHandler side, it is not easy to do in
      // offline model.
      Hyperlink tagCloud =
          new Hyperlink(
              Msg.consts.goto_tagcloud(),
              GwtUtils.buildToken(
                  GwtUtils.getCPageToken(SharedConstants.CPAGE_TAG_CLOUD), spaceUname));
      tagCloud.addClickHandler(
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              TagPopup.this.hide();
            }
          });
      panel.add(tagCloud);
      panel.setCellHorizontalAlignment(tagCloud, HasHorizontalAlignment.ALIGN_RIGHT);
    }
    panel.setSize("100%", "100%");
    this.setWidget(panel);
  }
예제 #2
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();
  }