Package net.suberic.pooka.gui

Examples of net.suberic.pooka.gui.MessageProxy$AddressLine


            getCache().cacheMessage((MimeMessage)msg, uid, uidValidity, SimpleFileCache.HEADERS);
        }

        MessageInfo mi = getMessageInfoByUid(uid);
        if (mi != null) {
          MessageProxy mp = mi.getMessageProxy();
          if (mp != null) {
            mp.unloadTableInfo();
            mp.loadTableInfo();
          }
        }

      } catch (MessagingException me) {
        // if we catch a MessagingException, it just means
View Full Code Here


   * by the filter.
   */
  public List performFilter(List filteredMessages) {
    List deleted = new java.util.LinkedList();
    for (int i = 0; i < filteredMessages.size(); i++) {
      MessageProxy current = (MessageProxy) filteredMessages.get(i);
      current.deleteMessage(false);
      deleted.add(current);
    }

    return deleted;
  }
View Full Code Here

   * by the filter.
   */
  public List performFilter(List filteredMessages) {
    for (int i = 0; i < filteredMessages.size(); i++) {
      try {
  MessageProxy current = (MessageProxy) filteredMessages.get(i);
  current.getMessageInfo().getRealMessage().setFlags(flagToSet, flagValue);
      } catch (MessagingException me) {
      }
     
    }
   
View Full Code Here

   */
  public void loadWaitingMessages() {
   
    int updateCounter = 0;
    int loadedMessageCount = 0;
    MessageProxy mp;
   
    // start this load section.
    int queueSize = getQueueSize();   
    int totalMessageCount = queueSize;
    if (! stopped && queueSize > 0) {
      folderInfo.getLogger().log(java.util.logging.Level.FINE, folderInfo.getFolderID() + " loading " + queueSize + " messages.");
     
      MessageLoadedListener display = getFolderInfo().getFolderDisplayUI();
      if (display != null)
  this.addMessageLoadedListener(display);
     
      fireMessageLoadedEvent(MessageLoadedEvent.LOADING_STARTING, 0, totalMessageCount);
     
      // get the batch sizes.
      int fetchBatchSize = 50;
      int loadBatchSize = 25;
      try {
  fetchBatchSize = Integer.parseInt(Pooka.getProperty("Pooka.fetchBatchSize", "50"));
      } catch (NumberFormatException nfe) {
      }
     
      try {
  loadBatchSize = Integer.parseInt(Pooka.getProperty("Pooka.loadBatchSize", "25"));
      } catch (NumberFormatException nfe) {
      }
     
      FetchProfile fetchProfile = getFolderInfo().getFetchProfile();

      // we'll stay in this while loop until the queue is empty
      for (List messages = retrieveNextBatch(fetchBatchSize); ! stopped && messages != null; messages=retrieveNextBatch(fetchBatchSize)) {
  totalMessageCount = messages.size() + getQueueSize() + loadedMessageCount;
  if (Pooka.getProperty("Pooka.openFoldersInBackGround", "false").equalsIgnoreCase("true")) {
    synchronized(folderInfo.getFolderThread().getRunLock()) {
      try {
        folderInfo.getFolderThread().setCurrentActionName("Loading messages.");
        // break when either we've been stopped or we're out of messages,
        for (int batchCount = 0; ! stopped && batchCount < messages.size(); batchCount++) {
    mp=(MessageProxy)messages.get(batchCount);
   
    // if the message hasn't been fetched, then fetch fetchBatchSize
    // worth of messages.
    if (! mp.getMessageInfo().hasBeenFetched()) {
      try {
        List fetchList = new ArrayList();
        for (int j = batchCount; fetchList.size() < fetchBatchSize && j < messages.size(); j++) {
          MessageInfo fetchInfo = ((MessageProxy) messages.get(j)).getMessageInfo();
          if (! fetchInfo.hasBeenFetched()) {
      fetchList.add(fetchInfo);
      //fetchInfo.setFetched(true);
          }
        }
     
        MessageInfo[] toFetch = new MessageInfo[fetchList.size()];
        toFetch = (MessageInfo[]) fetchList.toArray(toFetch);
        getFolderInfo().fetch(toFetch, fetchProfile);
      } catch(MessagingException me) {
        if (folderInfo.getLogger().isLoggable(java.util.logging.Level.WARNING)) {
         
          System.out.println("caught error while fetching for folder " + getFolderInfo().getFolderID() + ":  " + me);
          me.printStackTrace();
        }
      }
     
    }
   
    // now load each individual messageproxy.
    // and refresh each message.
    try {
      if (! mp.isLoaded())
      mp.loadTableInfo();
      if (mp.needsRefresh())
        mp.refreshMessage();
      else if (! mp.matchedFilters()) {
        mp.matchFilters();
    }
    } catch (Exception e) {
      if (folderInfo.getLogger().isLoggable(java.util.logging.Level.WARNING)) {
        e.printStackTrace();
      }
    }
   
    loadedMessageCount++;
    if (++updateCounter >= getUpdateMessagesCount()) {
      fireMessageLoadedEvent(MessageLoadedEvent.MESSAGES_LOADED, loadedMessageCount, totalMessageCount);
      updateCounter = 0;      
    }
        }
      } finally {
        folderInfo.getFolderThread().setCurrentActionName("");
      }
    } // end synchronized
  } else {
    // break when either we've been stopped or we're out of messages,
    for (int batchCount = 0; ! stopped && batchCount < messages.size(); batchCount++) {
      mp=(MessageProxy)messages.get(batchCount);
     
      // if the message hasn't been fetched, then fetch fetchBatchSize
      // worth of messages.
      if (! mp.getMessageInfo().hasBeenFetched()) {
        try {
    List fetchList = new ArrayList();
    for (int j = batchCount; fetchList.size() < fetchBatchSize && j < messages.size(); j++) {
      MessageInfo fetchInfo = ((MessageProxy) messages.get(j)).getMessageInfo();
      if (! fetchInfo.hasBeenFetched()) {
        fetchList.add(fetchInfo);
        //fetchInfo.setFetched(true);
      }
    }
   
    MessageInfo[] toFetch = new MessageInfo[fetchList.size()];
    toFetch = (MessageInfo[]) fetchList.toArray(toFetch);
    synchronized(folderInfo.getFolderThread().getRunLock()) {
      folderInfo.getFolderThread().setCurrentActionName("Loading messages.");
      getFolderInfo().fetch(toFetch, fetchProfile);
      folderInfo.getFolderThread().setCurrentActionName("");
    }
        } catch(MessagingException me) {
    if (getFolderInfo().getLogger().isLoggable(java.util.logging.Level.WARNING)) {
      System.out.println("caught error while fetching for folder " + getFolderInfo().getFolderID() + ":  " + me);
      me.printStackTrace();
    }
        }
       
      }
     
      // now load each individual messageproxy.
      // and refresh each message.
      try {
        synchronized(folderInfo.getFolderThread().getRunLock()) {
    try {
      folderInfo.getFolderThread().setCurrentActionName("Loading messages.");
      if (! mp.isLoaded())
        mp.loadTableInfo();
      if (mp.needsRefresh())
        mp.refreshMessage();
      else if (! mp.matchedFilters()) {
        mp.matchFilters();
      }
    } finally {
      folderInfo.getFolderThread().setCurrentActionName("");
    }
        } // synchronized
View Full Code Here

   */
  void populateUidMap() {
    if (folderTableModel != null) {
      List v = folderTableModel.getAllProxies();
      for (int i = 0; i < v.size(); i++) {
        MessageProxy mp = (MessageProxy) v.get(i);
        try {
          String uid = (String) mp.getMessageInfo().getMessageProperty(UID_HEADER);
          uidsRead.add(uid);
          if (Pooka.isDebug())
            System.out.println("adding " + uid + " to read list.");
        } catch (MessagingException me) {
          Pooka.getUIFactory().showError("Error getting UID for message:  ", me);
View Full Code Here

    if (! (mce instanceof net.suberic.pooka.event.MessageTableInfoChangedEvent)) {
      try {
        if (!mce.getMessage().isSet(Flags.Flag.DELETED) || ! Pooka.getProperty("Pooka.autoExpunge", "true").equalsIgnoreCase("true")) {

          MessageInfo mi = getMessageInfo(mce.getMessage());
          MessageProxy mp = mi.getMessageProxy();
          if (mp != null) {
            if (mce.getMessageChangeType() == MessageChangedEvent.FLAGS_CHANGED) {
              mi.refreshFlags();
            } else if (mce.getMessageChangeType() == MessageChangedEvent.ENVELOPE_CHANGED) {
              mi.refreshHeaders();
            }
            mp.unloadTableInfo();
            mp.loadTableInfo();
          }
        }
      } catch (MessagingException me) {
        // if we catch a MessagingException, it just means
        // that the message has already been expunged.
View Full Code Here

        String city = postalAddress.getCity();
        String country = postalAddress.getCountry();
        String code = postalAddress.getPostalCode();
        String state = postalAddress.getStateOrProvince();

    AddressLine stnumAL = objectFactory.createAddressLine();
        stnumAL.setKeyName("STREET_NUMBER");
    if (stnum != null) {
        stnumAL.setKeyValue(stnum);
    }

    AddressLine stAL = objectFactory.createAddressLine();
        stAL.setKeyName("STREET");
    if (st != null) {
        stAL.setKeyValue(st);
    }

    AddressLine cityAL = objectFactory.createAddressLine();
        cityAL.setKeyName("CITY");
    if (city != null) {
        cityAL.setKeyValue(city);
    }

    AddressLine countryAL = objectFactory.createAddressLine();
        countryAL.setKeyName("COUNTRY");
    if (country != null) {
        countryAL.setKeyValue(country);
    }

    AddressLine codeAL = objectFactory.createAddressLine();
        codeAL.setKeyName("POSTALCODE");
    if (code != null) {
        codeAL.setKeyValue(code);
    }

    AddressLine stateAL = objectFactory.createAddressLine();
        stateAL.setKeyName("STATE");
    if (state != null) {
        stateAL.setKeyValue(state);
    }

    // Add the AddressLine to vector
    addarr[0] = stnumAL;
    addarr[1] = stAL;
View Full Code Here

        String city = postalAddress.getCity();
        String country = postalAddress.getCountry();
        String code = postalAddress.getPostalCode();
        String state = postalAddress.getStateOrProvince();

    AddressLine stnumAL = objectFactory.createAddressLine();
        stnumAL.setKeyName("STREET_NUMBER");
    if (stnum != null) {
        stnumAL.setKeyValue(stnum);
    }

    AddressLine stAL = objectFactory.createAddressLine();
        stAL.setKeyName("STREET");
    if (st != null) {
        stAL.setKeyValue(st);
    }

    AddressLine cityAL = objectFactory.createAddressLine();
        cityAL.setKeyName("CITY");
    if (city != null) {
        cityAL.setKeyValue(city);
    }

    AddressLine countryAL = objectFactory.createAddressLine();
        countryAL.setKeyName("COUNTRY");
    if (country != null) {
        countryAL.setKeyValue(country);
    }

    AddressLine codeAL = objectFactory.createAddressLine();
        codeAL.setKeyName("POSTALCODE");
    if (code != null) {
        codeAL.setKeyValue(code);
    }

    AddressLine stateAL = objectFactory.createAddressLine();
        stateAL.setKeyName("STATE");
    if (state != null) {
        stateAL.setKeyValue(state);
    }

    // Add the AddressLine to vector
    addarr[0] = stnumAL;
    addarr[1] = stAL;
View Full Code Here

                List<AddressLine> r = new ArrayList<AddressLine>();
                if (addressLine == null) {
                        return r;
                }
                for (int i = 0; i < addressLine.size(); i++) {
                        AddressLine x = new AddressLine();
                        x.setKeyName(addressLine.get(i).getKeyName());
                        x.setKeyValue(addressLine.get(i).getKeyValue());
                        x.setValue(addressLine.get(i).getValue());
                        r.add(x);
                }
               
                return r;
        }
View Full Code Here

    PersonName personName = new PersonName();
    personName.setLang("en");
    personName.setValue(data.getFirstName(true) + data.getLastName(true));
   
    //Address lines for contact.
    AddressLine addressLineOne = new AddressLine();
    addressLineOne.setKeyName("street");
    addressLineOne.setKeyValue("street");
    addressLineOne.setValue(data.getStreet(false));
   
    AddressLine addressLineTwo = new AddressLine();
    addressLineTwo.setKeyName("town");
    addressLineTwo.setKeyValue("town");
    addressLineTwo.setValue(data.getTown(false));
   
    AddressLine addressLineThree = new AddressLine();
    addressLineThree.setKeyName("zip");
    addressLineThree.setKeyValue("zip");
    addressLineThree.setValue(data.getZip(5));
   
    //One address for the contact. Can be more but only one here.
    Address address = new Address();
    address.setLang("en");
    address.setSortCode("1");
View Full Code Here

TOP

Related Classes of net.suberic.pooka.gui.MessageProxy$AddressLine

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.