Package gfriends.client.model

Examples of gfriends.client.model.GreetingItem


      }

      FlexCellFormatter cellFormatter = flexTable.getFlexCellFormatter();

      int skipCount = 0;
      GreetingItem greetingItem = null;
      for (int i = 0; i < result.size(); i++) {

        greetingItem = result.get(i);

        ContactItem currentContact = null;
        for (ContactItem contactItem : contactItemList) {
          if (contactItem.getEmail().equals(greetingItem.getEmail())) {
            currentContact = contactItem;
            break;
          }
        }

        if (currentContact.isEnable()) {
          cellFormatter.addStyleName(i - skipCount, 0, currentContact.getStyle() + "_bkcolor");
          StringBuilder sb = new StringBuilder();

          if (isLocalStorageSupported() && greetingItem.getTimestamp() > lastTimestamp) {
            sb.append("<img src='/images/new_icon.jpg' width='33px' Height='19px'/><br/>");
            newMsgNum++;
          }
          sb.append("[" + DateTimeFormat.getMediumDateTimeFormat().format(greetingItem.getDataTime()) + "]&nbsp;&nbsp;&nbsp;").append("<b>")
              .append(currentContact.getNickName()).append(" wrote: </b>").append("<br/>").append("<blockquote><pre>")
              .append(greetingItem.isEncrypt() ? decrypt(encryptKey, greetingItem.getContent()) : greetingItem.getContent())
              .append("</pre></blockquote>");

          this.flexTable.setHTML(i - skipCount, 0, sb.toString());

        } else {
View Full Code Here


      String query = "select from " + Greeting.class.getName() + " order by date desc range 0,20";

      @SuppressWarnings("unchecked")
      List<Greeting> greetings = (List<Greeting>) pm.newQuery(query).execute();

      GreetingItem greetingItem = null;
      for (Greeting currentGreeting : greetings) {
        greetingItem = new GreetingItem();
        if (currentGreeting.getAuthor() != null) {
          greetingItem.setNickName(currentGreeting.getAuthor().getNickname());
          greetingItem.setEmail(currentGreeting.getAuthor().getEmail());
        }
        greetingItem.setContent(currentGreeting.getContent());
        greetingItem.setDataTime(currentGreeting.getDate());
        greetingItem.setTimestamp(currentGreeting.getDate().getTime());
        greetingItem.setEncrypt(currentGreeting.getEncrypt() == null ? false : currentGreeting.getEncrypt().booleanValue());
        result.add(greetingItem);
      }

    } finally {
      if (pm != null) {
View Full Code Here

TOP

Related Classes of gfriends.client.model.GreetingItem

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.