Package com.cubusmail.common.model

Examples of com.cubusmail.common.model.GWTMailFolder


   * @param mailFolder
   * @return
   */
  public static GWTMailFolder convert( IMailFolder mailFolder, boolean completeTree ) {

    GWTMailFolder result = new GWTMailFolder();

    result.setId( mailFolder.getId() );
    result.setName( mailFolder.getName() );
    // result.setUnreadMessagesCount( mailFolder.getUnreadMessageCount() );
    result.setInbox( mailFolder.isInbox() );
    result.setDraft( mailFolder.isDraft() );
    result.setSent( mailFolder.isSent() );
    result.setTrash( mailFolder.isTrash() );
    result.setCreateSubfolderSupported( mailFolder.isCreateSubfolderSupported() );
    result.setMoveSupported( mailFolder.isMoveSupported() );
    result.setRenameSupported( mailFolder.isRenameSupported() );
    result.setDeleteSupported( mailFolder.isDeleteSupported() );
    result.setEmptySupported( mailFolder.isEmptySupported() );

    if ( completeTree ) {
      IMailFolder[] subfolders = mailFolder.getSubfolders();
      if ( subfolders.length > 0 ) {
        GWTMailFolder[] gwtSubfolders = new GWTMailFolder[subfolders.length];
        for (int i = 0; i < subfolders.length; i++) {
          IMailFolder subfolder = mailFolder.getSubfolders()[i];
          gwtSubfolders[i] = convert( subfolder, completeTree );
          gwtSubfolders[i].setParent( result );
        }
        result.setSubfolders( gwtSubfolders );
      }
    }

    return result;
  }
View Full Code Here


    if ( folder instanceof GWTMailbox ) {
      return ImageProvider.MAIL_FOLDER_MAILBOX;
    }
    else {
      GWTMailFolder mailFolder = (GWTMailFolder) folder;
      if ( mailFolder.isInbox() ) {
        return ImageProvider.MAIL_FOLDER_INBOX;
      }
      else if ( mailFolder.isDraft() ) {
        return ImageProvider.MAIL_FOLDER_DRAFT;
      }
      else if ( mailFolder.isSent() ) {
        return ImageProvider.MAIL_FOLDER_SENT;
      }
      else if ( mailFolder.isTrash() ) {
        return ImageProvider.MAIL_FOLDER_TRASH_FULL;
      }
      else {
        return ImageProvider.MAIL_FOLDER;
      }
View Full Code Here

      if ( GWTUtil.getGwtFolder( nodes[0] ) instanceof GWTMailbox ) {
        nodes = treeData.getChildren( nodes[0] );
      }

      for (TreeNode node : nodes) {
        GWTMailFolder folder = (GWTMailFolder) GWTUtil.getGwtFolder( node );
        if ( folder.isInbox() ) {
          return (TreeNode) node;
        }
      }
    }
    return null;
View Full Code Here

TOP

Related Classes of com.cubusmail.common.model.GWTMailFolder

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.