示例#1
0
  public BestUnit(AlbumObj albumObjj, int poss) {
    this.albumObj = albumObjj;
    this.pos = poss;

    panel.addStyleName("bestUnit");

    /////// Album Image/////////

    albumImage.addStyleName("albumImageBest");
    albumImage
        .getElement()
        .getStyle()
        .setProperty(
            "background",
            "url(\"/extranewgwt/getphoto?photoid="
                + albumObj.getCoverPicID()
                + "\") no-repeat center");
    panel.add(albumImage);

    /////// Rating/////
    likesStatBlock = new LikesStatBlock(albumObj, true);
    likesStatBlock.addStyleName("likesStatBlockBest");
    panel.add(likesStatBlock);

    /////// Position Label//////
    posLabel = new Label(this.pos + 1 + "");
    posLabel.addStyleName("posLabel");
    posLabel.addStyleName("text12_white_bold");
    panel.add(posLabel);

    /////// Name Label//////
    nameLabel = new Label(albumObj.getAlbname());
    nameLabel.addStyleName("nameLabel");
    nameLabel.addStyleName("text11_White");
    panel.add(nameLabel);

    // gotoAlbum.setText("Best" + albumObj.getAlbname());

    albumImage.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            // History.back();
            GoogleAnalytics.trackEvent("Pinbelle", "BestBlock_Album_Clicked", "default");
            String params =
                "albid=" + albumObj.getAlbid() + "&coverid=" + albumObj.getCoverImgObjID();
            ClientFactory.getPlaceController().goTo(new ModelPlace(params, false, null));
          }
        });

    initWidget(panel);
  }