Package webworks.message.list.impl

Examples of webworks.message.list.impl.CustomMessageStore


            message.setPreviewPicture(imageNew);
            message.setImageNew(imageNew);
            message.setImageRead(imageRead);
           
            // Store message
            CustomMessageStore messageStore = CustomMessageStore.getInstance();
            synchronized (messageStore) {
              messageStore.addInboxMessage(message);
            }
            // Notify folder
            ApplicationMessageFolder inboxFolder = messageStore.getInboxFolder();
            inboxFolder.fireElementAdded(message);

          } catch (Exception e) {
            Dialog.alert("create message failed:  " + e.getMessage());
          }
View Full Code Here


            message.setPreviewPicture(imageNew);
            message.setImageNew(imageNew);
            message.setImageRead(imageRead);
           
            // Store message
            CustomMessageStore messageStore = CustomMessageStore.getInstance();
            synchronized (messageStore) {
              messageStore.commitMessage(message);
            }
            // Notify folder
            ApplicationMessageFolder inboxFolder = messageStore.getInboxFolder();
            inboxFolder.fireElementUpdated(message, message);

          } catch (Exception e) {
            Dialog.alert("update message failed:  " + e.getMessage());
          }
View Full Code Here

  public static CustomMessage getMessage( String id) {
    try {
      CustomMessage message = null;
     
      // Loop through our stored messages
      CustomMessageStore messageStore = CustomMessageStore.getInstance();
      synchronized (messageStore) {
        ReadableList list = messageStore.getInboxMessages();
        int size = list.size();
        for (int i = 0; i < size; i++ ) {
          CustomMessage temp = (CustomMessage)list.getAt(i);
          if (temp.getId().equals(id)) {
            message = temp;
View Full Code Here

  public static CustomMessage[] getMessages() {
    try {
      CustomMessage[] messages = null;
     
      // Loop through our stored messages
      CustomMessageStore messageStore = CustomMessageStore.getInstance();
      synchronized (messageStore) {
        ReadableList list = messageStore.getInboxMessages();
        int size = list.size();
        messages = new CustomMessage[size];
        list.getAt(0, size, messages, 0);
      }
   
View Full Code Here

    Application.getApplication().invokeLater(new Runnable(){

      public void run() {
        try {     
          // Loop through our stored messages
          CustomMessageStore messageStore = CustomMessageStore.getInstance();
          synchronized (messageStore) {
            ReadableList list = messageStore.getInboxMessages();
            int size = list.size();
            for (int i = 0; i < size; i++ ) {
              CustomMessage message = (CustomMessage)list.getAt(i);
              if (message.getId().equals(id)) { 
                messageStore.deleteInboxMessage(message);
               
                // Update the inbox
                ApplicationMessageFolderRegistry reg = ApplicationMessageFolderRegistry.getInstance();
                ApplicationMessageFolder folder = reg.getApplicationFolder(CustomMessage.INBOX_FOLDER_ID);
                folder.fireElementRemoved(message);
View Full Code Here

    Application.getApplication().invokeLater(new Runnable(){

      public void run() {
        try {     
          // Loop through our stored messages
          CustomMessageStore messageStore = CustomMessageStore.getInstance();
          synchronized (messageStore) {
            ReadableList list = messageStore.getInboxMessages();
            int size = list.size();
            for (int i = 0; i < size; i++ ) {
              CustomMessage message = (CustomMessage)list.getAt(i);
              if (message.getId().equals(id)) { 
                // Update the inbox
                ApplicationMessageFolderRegistry reg = ApplicationMessageFolderRegistry.getInstance();
                ApplicationMessageFolder folder = reg.getApplicationFolder(CustomMessage.INBOX_FOLDER_ID);
               
                // Update message
                message.markRead();

                // Update storage
                messageStore.commitMessage(message);

                // Notify GUI that message has changed
                folder.fireElementUpdated(message, message);
             
                // Invoke our callback
View Full Code Here

    Application.getApplication().invokeLater(new Runnable(){

      public void run() {
        try {     
          // Loop through our stored messages
          CustomMessageStore messageStore = CustomMessageStore.getInstance();
          synchronized (messageStore) {
            ReadableList list = messageStore.getInboxMessages();
            int size = list.size();
            for (int i = 0; i < size; i++ ) {
              CustomMessage message = (CustomMessage)list.getAt(i);
               
              // Update the inbox
              ApplicationMessageFolderRegistry reg = ApplicationMessageFolderRegistry.getInstance();
              ApplicationMessageFolder folder = reg.getApplicationFolder(CustomMessage.INBOX_FOLDER_ID);
             
              // Update message
              message.markRead();                         

              // Notify GUI that message has changed
              folder.fireElementUpdated(message, message);
           
              //  We called MarkAll Read, skip the callback
              //MessageListNamespace.getInstance().invokeItemMarkedRead(message);
            }
            messageStore.persist();
          }
        } catch (Exception e) {
          throw new RuntimeException(e.getMessage());
        }
      }
View Full Code Here

TOP

Related Classes of webworks.message.list.impl.CustomMessageStore

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.