Package com.google.gwt.safehtml.shared

Examples of com.google.gwt.safehtml.shared.SafeHtml


                                for (int i = 0; i < userTurnList.size(); i++) {
                                    final int tmp = i;
                                    final String cell = "<img src = 'http://graph.facebook.com/" + userTurnList.get(i).getId()
                                                    + "/picture' height = '50px' width = '50px'>" + userTurnList.get(i).getName() + " / "
                                                    + "["+(userTurnList.get(i).getRank()-2*userTurnList.get(i).getrd())+" , "+(userTurnList.get(i).getRank()+2*userTurnList.get(i).getrd())+"]" + " / Your Turn";
                                    SafeHtml friendCell = new SafeHtml() {
                                            @Override
                                            public String asString() {
                                                    return cell;
                                            }
                                    };
                                    friendList.addItem(friendCell, new Command() {
                                            @Override
                                            public void execute() {
                                                AsyncCallback<MatchInfo> callback = new AsyncCallback<MatchInfo>(){
                                                      @Override
                                                      public void onFailure(Throwable caught) {
                                                      }
                                                      @Override
                                                      public void onSuccess(MatchInfo result) {   //load the game from the server
                                                            presenter.loadGame(result.toString());
                                                     
                                                                     
                                               };
                                               opponentId = userTurnList.get(tmp).getId();
                                               loginService.LoadMatchByOpponentInDropdown(fbUid, opponentId, callback);
                                              
                                       }
                                   });
                               }
                               
                                for (int i = 0; i < opponentTurnList.size(); i++) {
                                    final String cell = "<img src = 'http://graph.facebook.com/" + opponentTurnList.get(i).getId()
                                                    + "/picture' height = '50px' width = '50px'>" + opponentTurnList.get(i).getName() + " / "
                                                    + "["+(opponentTurnList.get(i).getRank()-2*opponentTurnList.get(i).getrd())+" , "+(opponentTurnList.get(i).getRank()+2*opponentTurnList.get(i).getrd())+"]" + " / Opponent Turn";
                                    SafeHtml friendCell = new SafeHtml() {
                                            @Override
                                            public String asString() {
                                                    return cell;
                                            }
                                    };
                                    final int tmp = i;
                                    friendList.addItem(friendCell, new Command() {
                                            @Override
                                            public void execute() {
                                                    AsyncCallback<MatchInfo> callback = new AsyncCallback<MatchInfo>(){
                                                                  @Override
                                                                  public void onFailure(Throwable caught) {
                                                                  }
                                                                  @Override
                                                                  public void onSuccess(MatchInfo result) {   //load the game from the server
                                                                    presenter.loadGame(result.toString());
                                                                 
                                                                         
                                                   };
                                                   opponentId = opponentTurnList.get(tmp).getId();
                                                   loginService.LoadMatchByOpponentInDropdown(fbUid, opponentId, callback);
                                                  
                                           }
                                    });
                                }
                               
                                for (int i = 0; i < noAgainstList.size(); i++) {
                                    final int tmp = i;
                                    final String cell = "<img src = 'http://graph.facebook.com/" + noAgainstList.get(i).getId()
                                                    + "/picture' height = '50px' width = '50px'>" + noAgainstList.get(i).getName() + " / "
                                                    +"["+(noAgainstList.get(i).getRank()-2*noAgainstList.get(i).getrd())+" , "+(noAgainstList.get(i).getRank()+2*noAgainstList.get(i).getrd())+"]";
                                    SafeHtml friendCell = new SafeHtml() {
                                            @Override
                                            public String asString() {
                                                    return cell;
                                            }
                                    };
View Full Code Here


    }

    /** Test getValue(). */
    public void testGetValue() {
        TestColumn column = new TestColumn();
        SafeHtml result = null;

        column.returnTooltip = false;
        result = column.getValue(null);
        assertNotNull(result);
        assertEquals("<span>_null</span>", result.asString());

        column.returnTooltip = true;
        result = column.getValue(null);
        assertNotNull(result);
        assertEquals("<span title='_null_tooltip'>_null</span>", result.asString());

        column.returnTooltip = false;
        result = column.getValue("");
        assertNotNull(result);
        assertEquals("<span></span>", result.asString());

        column.returnTooltip = true;
        result = column.getValue("");
        assertNotNull(result);
        assertEquals("<span title='_tooltip'></span>", result.asString());

        column.returnTooltip = false;
        result = column.getValue("hello");
        assertNotNull(result);
        assertEquals("<span>hello</span>", result.asString());

        column.returnTooltip = true;
        result = column.getValue("hello");
        assertNotNull(result);
        assertEquals("<span title='hello_tooltip'>hello</span>", result.asString());

        column.returnTooltip = true;
        result = column.getValue("here > there");
        assertNotNull(result);
        assertEquals("<span title='here &gt; there_tooltip'>here &gt; there</span>", result.asString());
    }
View Full Code Here

   }

   @Override
   public void render(String str, SafeHtmlBuilder builder)
   {
      SafeHtml safeHtml = render(str);
      if (safeHtml != null)
         builder.append(safeHtml);
   }
View Full Code Here

    }

    @Override
    public void render(Context context, DeploymentRecord record, SafeHtmlBuilder sb) {
        if (isCellActive(record)) {
            SafeHtml html = new SafeHtmlBuilder()
                .appendHtmlConstant("<a href='javascript:void(0)' tabindex=\"-1\" class='textlink-cell'>")
                .appendHtmlConstant(this.command.getLabel(record))
                .appendHtmlConstant("</a>")
                .toSafeHtml();
            sb.append(html);
        } else {
            SafeHtml html = new SafeHtmlBuilder()
                .appendHtmlConstant("&nbsp;")
                .toSafeHtml();
            sb.append(html);
        }
    }
View Full Code Here

        }

        @Override
        public void render(Cell.Context context, String title, SafeHtmlBuilder safeHtmlBuilder)
        {
            SafeHtml render;
            Row row = (Row)context.getKey();
            final String labelId = id + row.getRowNum() +"_"+index+"_l";
            boolean hasTitle = title!=null && !title.equals("");
            if (hasTitle)
            {
View Full Code Here

        }

        @Override
        public void render(Cell.Context context, String value, SafeHtmlBuilder safeHtmlBuilder)
        {
            SafeHtml render;
            Row row = (Row)context.getKey();
            final String labelId = id + row.getRowNum() +"_"+index+"_l";
            boolean hasValue = value!=null && !value.equals("");

            if (hasValue)
View Full Code Here

        }

        @Override
        public void render(Cell.Context context, String icon, SafeHtmlBuilder safeHtmlBuilder)
        {
            SafeHtml render;

            boolean hasValue = icon!=null && !icon.equals("");

            if (hasValue)
            {
View Full Code Here

  }

  @Override
  protected <N> SafeHtml getRenderedValue(int rowIndex, int colIndex, M m, ListStore<M>.Record record) {
    ColumnConfig<M, N> cc = cm.getColumn(colIndex);
    SafeHtml s = super.getRenderedValue(rowIndex, colIndex, m, record);
    TreeNode<M> node = findNode(m);
    if (node != null && cc == tree.getTreeColumn()) {
      return getTemplate(m, node.getDomId(), s, tree.calculateIconStyle(m), false, tree.calculateJoint(m),
          treeStore.getDepth(m));
    }
View Full Code Here

    }

    @Override
    public void render(Cell.Context context, String icon, SafeHtmlBuilder safeHtmlBuilder)
    {
        SafeHtml render;

        boolean hasValue = icon!=null && !icon.equals("");

        if (hasValue)
        {
View Full Code Here

        sb.appendHtmlConstant("<div>");

        // current user
        String userHtml = "<i style='color:#cecece' class='icon-user'></i>&nbsp;"+bootstrap.getPrincipal();

        SafeHtml principal = new SafeHtmlBuilder().appendHtmlConstant("<div class='header-textlink'>"+userHtml+"</div>").toSafeHtml();
        final HTML userButton = new HTML(principal);
        userButton.getElement().setAttribute("style", "cursor:pointer");
        tools.add(userButton);

        final DefaultPopup menuPopup = new DefaultPopup(DefaultPopup.Arrow.TOP);
View Full Code Here

TOP

Related Classes of com.google.gwt.safehtml.shared.SafeHtml

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.