james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r823522 - in /james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp: MainPresenter.java MainView.java
Date Fri, 09 Oct 2009 12:10:06 GMT
Author: norman
Date: Fri Oct  9 12:10:05 2009
New Revision: 823522

URL: http://svn.apache.org/viewvc?rev=823522&view=rev
Log:
Reformat

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java?rev=823522&r1=823521&r2=823522&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java Fri
Oct  9 12:10:05 2009
@@ -89,54 +89,71 @@
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
 
-public class MainPresenter extends WidgetPresenter<MainPresenter.Display>{
+public class MainPresenter extends WidgetPresenter<MainPresenter.Display> {
+
+    public interface Display extends WidgetDisplay {
+        public HasClickHandlers getSearchClick();
+
+        public HasValue<String> getSearchValue();
+
+        public void fillOracle(ArrayList<Message> messages);
+
+        public void setCenter(Widget widget);
+
+        public HasSelectionHandlers<TreeItem> getTree();
 
-	
-	public interface Display extends WidgetDisplay{
-		public HasClickHandlers getSearchClick();
-		public HasValue<String> getSearchValue();
-		public void fillOracle(ArrayList<Message> messages);
-		public void setCenter(Widget widget);
-		public HasSelectionHandlers<TreeItem> getTree();
         public void bindTreeItems(List<IMAPTreeItem> treeList);
-        public HasClickHandlers getRenameClick();   
+
+        public HasClickHandlers getRenameClick();
+
         public HasClickHandlers getDeleteClick();
+
         public HasClickHandlers getNewClick();
+
         public HasDialog getDeleteConfirmDialog();
+
         public HasClickHandlers getDeleteConfirmClick();
+
         public HasEnable getRenameEnable();
+
         public HasEnable getDeleteEnable();
+
         public HasEnable getNewEnable();
+
         public void updateTreeItem(IMAPFolder folder);
+
         public void deleteSelectedFolder();
+
         public HasEditable createFolder(EditHandler handler);
+
         public void increaseUnseenMessageCount(IMAPFolder folder, int amount);
+
         public void decreaseUnseenMessageCount(IMAPFolder folder, int amount);
-	}
-	
-	private CachingDispatchAsync cachingDispatcher;
-	private User user;
-	private IMAPFolder folder;
-	private String searchValue;
-	private IMAPMessageListPresenter messageListPresenter;
-	private IMAPMessagePresenter messagePresenter;
-	private MessageSendPresenter sendPresenter;
-	private IMAPTreeItem tItem;
-	private HasEditable editableTreeItem;
-	public static final Place PLACE = new Place("Main");
-	
-	@Inject
-	public MainPresenter(MainPresenter.Display display, EventBus bus, CachingDispatchAsync cachingDispatcher,
IMAPMessageListPresenter messageListPresenter, IMAPMessagePresenter messagePresenter, MessageSendPresenter
sendPresenter) {
-		super(display,bus);
-		this.cachingDispatcher = cachingDispatcher;
-		this.messageListPresenter = messageListPresenter;
-		this.messagePresenter = messagePresenter;
-		this.sendPresenter = sendPresenter;
-	}
-	
-	
-	protected void loadTreeItems() {
-	    cachingDispatcher.execute(new FetchFolders(), new SessionAsyncCallback<FetchFoldersResult>(new
DisplayCallback<FetchFoldersResult>(display) {
+    }
+
+    private CachingDispatchAsync cachingDispatcher;
+    private User user;
+    private IMAPFolder folder;
+    private String searchValue;
+    private IMAPMessageListPresenter messageListPresenter;
+    private IMAPMessagePresenter messagePresenter;
+    private MessageSendPresenter sendPresenter;
+    private IMAPTreeItem tItem;
+    private HasEditable editableTreeItem;
+    public static final Place PLACE = new Place("Main");
+
+    @Inject
+    public MainPresenter(MainPresenter.Display display, EventBus bus, CachingDispatchAsync
cachingDispatcher, IMAPMessageListPresenter messageListPresenter, IMAPMessagePresenter messagePresenter,
+            MessageSendPresenter sendPresenter) {
+        super(display, bus);
+        this.cachingDispatcher = cachingDispatcher;
+        this.messageListPresenter = messageListPresenter;
+        this.messagePresenter = messagePresenter;
+        this.sendPresenter = sendPresenter;
+    }
+
+    protected void loadTreeItems() {
+        cachingDispatcher.execute(new FetchFolders(), new SessionAsyncCallback<FetchFoldersResult>(new
DisplayCallback<FetchFoldersResult>(display) {
 
             @Override
             protected void handleFailure(Throwable e) {
@@ -146,17 +163,15 @@
             @Override
             protected void handleSuccess(FetchFoldersResult result) {
                 display.bindTreeItems(createTreeNodes(result.getFolders()));
-                
+
                 // disable
                 display.getDeleteEnable().setEnabled(false);
                 display.getRenameEnable().setEnabled(false);
             }
 
-            
-        },eventBus,user));
+        }, eventBus, user));
     }
-	
-	   
+
     /**
      * Create recursive the TreeNodes with all childs
      * 
@@ -168,31 +183,31 @@
 
         for (int i = 0; i < list.size(); i++) {
             IMAPFolder iFolder = list.get(i);
-            
+
             final IMAPTreeItem record = new IMAPTreeItem(iFolder);
             record.addEditHandler(new EditHandler() {
 
                 public void onEditEvent(EditEvent event) {
-                    if(event.getEventType().equals(EditEvent.EventType.Stop)) {
-                        IMAPFolder iFolder = new IMAPFolder((String)event.getOldValue());
-                        final String newName = (String)event.getNewValue();
+                    if (event.getEventType().equals(EditEvent.EventType.Stop)) {
+                        IMAPFolder iFolder = new IMAPFolder((String) event.getOldValue());
+                        final String newName = (String) event.getNewValue();
                         if (iFolder.getFullName().equalsIgnoreCase(newName) == false) {
-                                cachingDispatcher.execute(new RenameFolder(iFolder, newName),
new SessionAsyncCallback<EmptyResult>(new AsyncCallback<EmptyResult>() {
+                            cachingDispatcher.execute(new RenameFolder(iFolder, newName),
new SessionAsyncCallback<EmptyResult>(new AsyncCallback<EmptyResult>() {
 
                                 public void onFailure(Throwable caught) {
                                     record.cancelEdit();
-                                }   
+                                }
 
                                 public void onSuccess(EmptyResult result) {
                                     folder.setFullName(newName);
                                 }
-                                
-                            },eventBus,user));
+
+                            }, eventBus, user));
                         }
 
                     }
                 }
-                
+
             });
             record.setUserObject(iFolder);
 
@@ -209,7 +224,7 @@
                 folder = iFolder;
                 tItem = record;
             }
-            
+
             tList.add(record);
         }
 
@@ -224,188 +239,187 @@
         return tList;
     }
 
-	private void showMessageTable(User user, IMAPFolder folder, String searchValue,boolean refresh)
{
-		this.user = user;
-		this.folder = folder;
-		this.searchValue = searchValue;
-		
-		messagePresenter.unbind();
-		sendPresenter.unbind();
-		
-		messageListPresenter.bind(user, folder, searchValue);
-		if (refresh) {
-			messageListPresenter.refreshDisplay();
-		}
-		display.setCenter(messageListPresenter.getDisplay().asWidget());
-	}
-	
-	private void showMessage(User user, IMAPFolder folder, Message message, MessageDetails details)
{
-		sendPresenter.unbind();
-		messageListPresenter.unbind();
-		
-		messagePresenter.bind(user,folder,message,details);
-		display.setCenter(messagePresenter.getDisplay().asWidget());
-	}
-	
-	
-	private void showNewMessage() {
-		messagePresenter.unbind();
-		messageListPresenter.unbind();
-		
-		sendPresenter.bind(user, Type.NEW);
-		display.setCenter(sendPresenter.getDisplay().asWidget());
-	}
-	
-	private void showForwardMessage(ForwardMessageEvent event) {
-		messagePresenter.unbind();
-		messageListPresenter.unbind();
-
-		sendPresenter.bind(event.getUser(),event.getFolder(),event.getMessage(), event.getMessageDetails(),
Type.FORWARD);
-		display.setCenter(sendPresenter.getDisplay().asWidget());
-	}
-	
-	private void showReplyMessage(ReplyMessageEvent event) {
-		messagePresenter.unbind();
-		messageListPresenter.unbind();
-
-		if (event.getReplyAll()) {
-			sendPresenter.bind(event.getUser(),event.getFolder(),event.getMessage(),event.getMessageDetails(),
Type.REPLY_ALL);
-		} else {
-			sendPresenter.bind(event.getUser(),event.getFolder(),event.getMessage(),event.getMessageDetails(),
Type.REPLY);
-
-		}
-		display.setCenter(sendPresenter.getDisplay().asWidget());
-	}
-	private void reset() {
-		display.getSearchValue().setValue("");
-		cachingDispatcher.clear();
-	}
-	
-
-	@Override
-	public Place getPlace() {
-		return PLACE;
-	}
-	
-	public void bind(User user) {
-		this.user = user;
-		folder = new IMAPFolder(user.getSettings().getInboxFolderName());
-
-		bind();
-		refreshDisplay();
-	}
-	
-	@Override
-	protected void onBind() {
-	
-		registerHandler(eventBus.addHandler(LoadMessagesEvent.TYPE, new LoadMessagesEventHandler()
{
-
-			public void onLoadMessagesEvent(LoadMessagesEvent loadMessagesEvent) {
-				showMessageTable(loadMessagesEvent.getUser(), loadMessagesEvent.getFolder(), loadMessagesEvent.getSearchValue(),
true);
-			}
-			
-		}));
-		registerHandler(eventBus.addHandler(MessagesReceivedEvent.TYPE, new MessagesReceivedEventHandler()
{
-
-			public void onMessagesReceived(MessagesReceivedEvent event) {
-				
-				// fill the oracle
-				display.fillOracle(event.getMessages());
-			}
-			
-		}));
-		
-		registerHandler(eventBus.addHandler(ExpandMessageEvent.TYPE, new ExpandMessageEventHandler()
{
-
-			public void onExpandMessage(ExpandMessageEvent event) {
-				final boolean decreaseUnseen;
-				final Message message = event.getMessage();
-				// check if the message was already seen in the past
-				if (event.getMessage().getFlags().contains(IMAPFlag.SEEN) == false) {
-					decreaseUnseen = true;
-				} else {
-					decreaseUnseen = false;
-				}
-				cachingDispatcher.executeWithCache(new GetMessageDetails(event.getFolder(),message.getUid()),
new SessionAsyncCallback<GetMessageDetailsResult>(new DisplayCallback<GetMessageDetailsResult>(display)
{
-
-					@Override
-					protected void handleFailure(Throwable e) {
-						GWT.log("ERROR", e);
-					}
-
-					@Override
-					protected void handleSuccess(GetMessageDetailsResult result) {
-						// decrease the unseen count if we were able to expose the message
-						if (decreaseUnseen) {
-							eventBus.fireEvent(new DecreaseUnseenEvent(user,folder));
-						}
-						
-						showMessage(user, folder, message, result.getMessageDetails());
-					}
-
-					
-				}, eventBus, user));
-			}
-			
-		}));
-		registerHandler(eventBus.addHandler(NewMessageEvent.TYPE, new NewMessageEventHandler()
{
-
-			public void onNewMessageEvent(NewMessageEvent event) {
-				showNewMessage();
-			}
-			
-		}));
-		
-		registerHandler(eventBus.addHandler(SentMessageEvent.TYPE, new SentMessageEventHandler()
{
-
-			public void onSentMessageEvent(SentMessageEvent ev) {
-				showMessageTable(user,folder,searchValue, false);
-			}
-			
-		}));
-		
-		registerHandler(eventBus.addHandler(ForwardMessageEvent.TYPE, new ForwardMessageEventHandler()
{
-
-			public void onForwardMessageEvent(ForwardMessageEvent event) {
-				showForwardMessage(event);
-			}
-			
-		}));
-		registerHandler(eventBus.addHandler(ReplyMessageEvent.TYPE, new ReplyMessageEventHandler()
{
-
-			public void onReplyMessageEvent(ReplyMessageEvent event) {
-				showReplyMessage(event);
-			}
-			
-		}));
-		registerHandler(eventBus.addHandler(FolderSelectionEvent.TYPE, new FolderSelectionEventHandler()
{
-
-			public void onFolderSelectionEvent(FolderSelectionEvent event) {
-				showMessageTable(user,event.getFolder(),searchValue, true);
-			}
-			
-		}));		
-		
-		registerHandler(display.getSearchClick().addClickHandler(new ClickHandler() {
-
-			public void onClick(ClickEvent event) {
-				String searchValue = null;
-				if (display.getSearchValue().getValue().trim().length() >0) {
-					searchValue = display.getSearchValue().getValue().trim();
-				}
-				eventBus.fireEvent(new LoadMessagesEvent(user,folder,searchValue));
-			}
-			
-		}));
-		
-		registerHandler(eventBus.addHandler(BackEvent.TYPE, new BackEventHandler() {
-
-			public void onBackEvent(BackEvent event) {
-				showMessageTable(user, folder, searchValue, false);
-			}
-			
-		}));
-		
+    private void showMessageTable(User user, IMAPFolder folder, String searchValue, boolean
refresh) {
+        this.user = user;
+        this.folder = folder;
+        this.searchValue = searchValue;
+
+        messagePresenter.unbind();
+        sendPresenter.unbind();
+
+        messageListPresenter.bind(user, folder, searchValue);
+        if (refresh) {
+            messageListPresenter.refreshDisplay();
+        }
+        display.setCenter(messageListPresenter.getDisplay().asWidget());
+    }
+
+    private void showMessage(User user, IMAPFolder folder, Message message, MessageDetails
details) {
+        sendPresenter.unbind();
+        messageListPresenter.unbind();
+
+        messagePresenter.bind(user, folder, message, details);
+        display.setCenter(messagePresenter.getDisplay().asWidget());
+    }
+
+    private void showNewMessage() {
+        messagePresenter.unbind();
+        messageListPresenter.unbind();
+
+        sendPresenter.bind(user, Type.NEW);
+        display.setCenter(sendPresenter.getDisplay().asWidget());
+    }
+
+    private void showForwardMessage(ForwardMessageEvent event) {
+        messagePresenter.unbind();
+        messageListPresenter.unbind();
+
+        sendPresenter.bind(event.getUser(), event.getFolder(), event.getMessage(), event.getMessageDetails(),
Type.FORWARD);
+        display.setCenter(sendPresenter.getDisplay().asWidget());
+    }
+
+    private void showReplyMessage(ReplyMessageEvent event) {
+        messagePresenter.unbind();
+        messageListPresenter.unbind();
+
+        if (event.getReplyAll()) {
+            sendPresenter.bind(event.getUser(), event.getFolder(), event.getMessage(), event.getMessageDetails(),
Type.REPLY_ALL);
+        } else {
+            sendPresenter.bind(event.getUser(), event.getFolder(), event.getMessage(), event.getMessageDetails(),
Type.REPLY);
+
+        }
+        display.setCenter(sendPresenter.getDisplay().asWidget());
+    }
+
+    private void reset() {
+        display.getSearchValue().setValue("");
+        cachingDispatcher.clear();
+    }
+
+    @Override
+    public Place getPlace() {
+        return PLACE;
+    }
+
+    public void bind(User user) {
+        this.user = user;
+        folder = new IMAPFolder(user.getSettings().getInboxFolderName());
+
+        bind();
+        refreshDisplay();
+    }
+
+    @Override
+    protected void onBind() {
+
+        registerHandler(eventBus.addHandler(LoadMessagesEvent.TYPE, new LoadMessagesEventHandler()
{
+
+            public void onLoadMessagesEvent(LoadMessagesEvent loadMessagesEvent) {
+                showMessageTable(loadMessagesEvent.getUser(), loadMessagesEvent.getFolder(),
loadMessagesEvent.getSearchValue(), true);
+            }
+
+        }));
+        registerHandler(eventBus.addHandler(MessagesReceivedEvent.TYPE, new MessagesReceivedEventHandler()
{
+
+            public void onMessagesReceived(MessagesReceivedEvent event) {
+
+                // fill the oracle
+                display.fillOracle(event.getMessages());
+            }
+
+        }));
+
+        registerHandler(eventBus.addHandler(ExpandMessageEvent.TYPE, new ExpandMessageEventHandler()
{
+
+            public void onExpandMessage(ExpandMessageEvent event) {
+                final boolean decreaseUnseen;
+                final Message message = event.getMessage();
+                // check if the message was already seen in the past
+                if (event.getMessage().getFlags().contains(IMAPFlag.SEEN) == false) {
+                    decreaseUnseen = true;
+                } else {
+                    decreaseUnseen = false;
+                }
+                cachingDispatcher.executeWithCache(new GetMessageDetails(event.getFolder(),
message.getUid()), new SessionAsyncCallback<GetMessageDetailsResult>(
+                        new DisplayCallback<GetMessageDetailsResult>(display) {
+
+                            @Override
+                            protected void handleFailure(Throwable e) {
+                                GWT.log("ERROR", e);
+                            }
+
+                            @Override
+                            protected void handleSuccess(GetMessageDetailsResult result)
{
+                                // decrease the unseen count if we were able to
+                                // expose the message
+                                if (decreaseUnseen) {
+                                    eventBus.fireEvent(new DecreaseUnseenEvent(user, folder));
+                                }
+
+                                showMessage(user, folder, message, result.getMessageDetails());
+                            }
+
+                        }, eventBus, user));
+            }
+
+        }));
+        registerHandler(eventBus.addHandler(NewMessageEvent.TYPE, new NewMessageEventHandler()
{
+
+            public void onNewMessageEvent(NewMessageEvent event) {
+                showNewMessage();
+            }
+
+        }));
+
+        registerHandler(eventBus.addHandler(SentMessageEvent.TYPE, new SentMessageEventHandler()
{
+
+            public void onSentMessageEvent(SentMessageEvent ev) {
+                showMessageTable(user, folder, searchValue, false);
+            }
+
+        }));
+
+        registerHandler(eventBus.addHandler(ForwardMessageEvent.TYPE, new ForwardMessageEventHandler()
{
+
+            public void onForwardMessageEvent(ForwardMessageEvent event) {
+                showForwardMessage(event);
+            }
+
+        }));
+        registerHandler(eventBus.addHandler(ReplyMessageEvent.TYPE, new ReplyMessageEventHandler()
{
+
+            public void onReplyMessageEvent(ReplyMessageEvent event) {
+                showReplyMessage(event);
+            }
+
+        }));
+        registerHandler(eventBus.addHandler(FolderSelectionEvent.TYPE, new FolderSelectionEventHandler()
{
+
+            public void onFolderSelectionEvent(FolderSelectionEvent event) {
+                showMessageTable(user, event.getFolder(), searchValue, true);
+            }
+
+        }));
+
+        registerHandler(display.getSearchClick().addClickHandler(new ClickHandler() {
+
+            public void onClick(ClickEvent event) {
+                String searchValue = null;
+                if (display.getSearchValue().getValue().trim().length() > 0) {
+                    searchValue = display.getSearchValue().getValue().trim();
+                }
+                eventBus.fireEvent(new LoadMessagesEvent(user, folder, searchValue));
+            }
+
+        }));
+
+        registerHandler(eventBus.addHandler(BackEvent.TYPE, new BackEventHandler() {
+
+            public void onBackEvent(BackEvent event) {
+                showMessageTable(user, folder, searchValue, false);
+            }
+
+        }));
 
         registerHandler(eventBus.addHandler(ExpandMessageEvent.TYPE, new ExpandMessageEventHandler()
{
 
@@ -414,7 +428,7 @@
                     editableTreeItem.cancelEdit();
                 }
             }
-            
+
         }));
         registerHandler(eventBus.addHandler(NewMessageEvent.TYPE, new NewMessageEventHandler()
{
 
@@ -423,41 +437,41 @@
                     editableTreeItem.cancelEdit();
                 }
             }
-            
+
         }));
         registerHandler(eventBus.addHandler(DecreaseUnseenEvent.TYPE, new DecreaseUnseenEventHandler()
{
 
             public void onDecreaseUnseenEvent(DecreaseUnseenEvent event) {
-                // Check if the folder was the trash folder. If not increase the message
count of the trash folder
+                // Check if the folder was the trash folder. If not increase the
+                // message count of the trash folder
                 if (user.getSettings().getTrashFolderName().equalsIgnoreCase(event.getFolder().getFullName())
== false) {
-                    display.increaseUnseenMessageCount(new IMAPFolder(user.getSettings().getTrashFolderName()),event.getAmount());
+                    display.increaseUnseenMessageCount(new IMAPFolder(user.getSettings().getTrashFolderName()),
event.getAmount());
                 }
-                display.decreaseUnseenMessageCount(event.getFolder(),event.getAmount());
+                display.decreaseUnseenMessageCount(event.getFolder(), event.getAmount());
             }
-            
+
         }));
         registerHandler(eventBus.addHandler(IncreaseUnseenEvent.TYPE, new IncreaseUnseenEventHandler()
{
 
             public void onIncreaseUnseenEvent(IncreaseUnseenEvent event) {
-                display.increaseUnseenMessageCount(event.getFolder(),event.getAmount());
+                display.increaseUnseenMessageCount(event.getFolder(), event.getAmount());
             }
 
-            
         }));
         registerHandler(display.getTree().addSelectionHandler(new SelectionHandler<TreeItem>()
{
 
             public void onSelection(SelectionEvent<TreeItem> event) {
-                tItem = (IMAPTreeItem)event.getSelectedItem();
+                tItem = (IMAPTreeItem) event.getSelectedItem();
                 folder = (IMAPFolder) tItem.getUserObject();
-                eventBus.fireEvent(new LoadMessagesEvent(user,folder));
+                eventBus.fireEvent(new LoadMessagesEvent(user, folder));
             }
-            
+
         }));
-        
+
         registerHandler(display.getTree().addSelectionHandler(new SelectionHandler<TreeItem>()
{
 
             public void onSelection(SelectionEvent<TreeItem> event) {
-                tItem = (IMAPTreeItem)event.getSelectedItem();
+                tItem = (IMAPTreeItem) event.getSelectedItem();
                 folder = (IMAPFolder) tItem.getUserObject();
                 if (folder.getFullName().equalsIgnoreCase(user.getSettings().getInboxFolderName()))
{
                     display.getDeleteEnable().setEnabled(false);
@@ -467,25 +481,25 @@
                     display.getRenameEnable().setEnabled(true);
                 }
             }
-            
+
         }));
-        
+
         registerHandler(display.getRenameClick().addClickHandler(new ClickHandler() {
 
             public void onClick(ClickEvent event) {
                 tItem.startEdit();
             }
-            
+
         }));
-        
+
         registerHandler(display.getDeleteClick().addClickHandler(new ClickHandler() {
 
             public void onClick(ClickEvent event) {
                 display.getDeleteConfirmDialog().show();
             }
-            
+
         }));
-        
+
         registerHandler(display.getDeleteConfirmClick().addClickHandler(new ClickHandler()
{
 
             public void onClick(ClickEvent event) {
@@ -498,73 +512,72 @@
                     public void onSuccess(EmptyResult result) {
                         display.deleteSelectedFolder();
                     }
-                    
+
                 });
             }
-            
+
         }));
-        
+
         registerHandler(display.getNewClick().addClickHandler(new ClickHandler() {
 
             public void onClick(ClickEvent event) {
                 editableTreeItem = display.createFolder(new EditHandler() {
 
                     public void onEditEvent(EditEvent event) {
-                        final IMAPTreeItem item = (IMAPTreeItem)event.getSource();
+                        final IMAPTreeItem item = (IMAPTreeItem) event.getSource();
                         final String newValue = (String) event.getNewValue();
                         if (event.getEventType().equals(EditEvent.EventType.Stop)) {
-                            cachingDispatcher.execute(new CreateFolder(new IMAPFolder(newValue.trim())),
 new AsyncCallback<EmptyResult>() {
+                            cachingDispatcher.execute(new CreateFolder(new IMAPFolder(newValue.trim())),
new AsyncCallback<EmptyResult>() {
 
                                 public void onFailure(Throwable caught) {
-                                    GWT.log("Error while create folder",caught);
+                                    GWT.log("Error while create folder", caught);
                                     item.cancelEdit();
                                 }
 
                                 public void onSuccess(EmptyResult result) {
                                     // Nothing todo
                                 }
-                                
+
                             });
                         }
                     }
-                    
+
                 });
             }
-            
+
         }));
-        
+
         registerHandler(eventBus.addHandler(MessagesReceivedEvent.TYPE, new MessagesReceivedEventHandler()
{
 
             public void onMessagesReceived(MessagesReceivedEvent event) {
                 IMAPFolder f = event.getFolder();
                 display.updateTreeItem(f);
             }
-            
+
         }));
-		
-	}
 
+    }
 
-	@Override
-	protected void onPlaceRequest(PlaceRequest request) {
-	}
-
-	@Override
-	protected void onUnbind() {
-		messagePresenter.unbind();
-		sendPresenter.unbind();
-		messageListPresenter.unbind();
-		reset();
-	
-	}
-
-	public void refreshDisplay() {
-	    loadTreeItems();        
-		showMessageTable(user,folder,null,true);
-	}
-
-	public void revealDisplay() {
-		// TODO Auto-generated method stub
-		
-	}
+    @Override
+    protected void onPlaceRequest(PlaceRequest request) {
+    }
+
+    @Override
+    protected void onUnbind() {
+        messagePresenter.unbind();
+        sendPresenter.unbind();
+        messageListPresenter.unbind();
+        reset();
+
+    }
+
+    public void refreshDisplay() {
+        loadTreeItems();
+        showMessageTable(user, folder, null, true);
+    }
+
+    public void revealDisplay() {
+        // TODO Auto-generated method stub
+
+    }
 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java?rev=823522&r1=823521&r2=823522&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java Fri Oct
 9 12:10:05 2009
@@ -72,23 +72,23 @@
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
 
-public class MainView extends Composite implements MainPresenter.Display{
-	
-	private DockPanel dockPanel;
-	private VerticalPanel north;
-	private HupaConstants constants = GWT.create(HupaConstants.class);
-	private RoundedPanel west;
-	private IMAPTreeImages tImages = GWT.create(IMAPTreeImages.class);
-	private Tree folderTree = new Tree(tImages,true);
-	private MultiWordSuggestOracle oracle = new MultiWordSuggestOracle(" ,@");  
-	private SuggestBox searchBox = new SuggestBox(oracle);
-	private Button searchButton = new Button(constants.searchButton());
-	private Loading loading = new Loading(false);
-	private Widget centerWidget;
-	private RoundedPanel center;
-	private IMAPMessageListView mListView;
-	private HupaMessages messages = GWT.create(HupaMessages.class);
-	private VerticalPanel folderPanel = new VerticalPanel();
+public class MainView extends Composite implements MainPresenter.Display {
+
+    private DockPanel dockPanel;
+    private VerticalPanel north;
+    private HupaConstants constants = GWT.create(HupaConstants.class);
+    private RoundedPanel west;
+    private IMAPTreeImages tImages = GWT.create(IMAPTreeImages.class);
+    private Tree folderTree = new Tree(tImages, true);
+    private MultiWordSuggestOracle oracle = new MultiWordSuggestOracle(" ,@");
+    private SuggestBox searchBox = new SuggestBox(oracle);
+    private Button searchButton = new Button(constants.searchButton());
+    private Loading loading = new Loading(false);
+    private Widget centerWidget;
+    private RoundedPanel center;
+    private IMAPMessageListView mListView;
+    private HupaMessages messages = GWT.create(HupaMessages.class);
+    private VerticalPanel folderPanel = new VerticalPanel();
     private SimplePanel panel = new SimplePanel();
     private HorizontalPanel folderButtonBar = new HorizontalPanel();
     private EnableHyperlink newFolderButton = new EnableHyperlink(constants.newFolder(),
"");
@@ -100,166 +100,165 @@
     private EventBus bus;
     private PagingScrollTableRowDragController controller;
     protected User user;
-	
-	@Inject
-	public MainView(EventBus bus, PagingScrollTableRowDragController controllerProvider) {
+
+    @Inject
+    public MainView(EventBus bus, PagingScrollTableRowDragController controllerProvider)
{
         this.controller = controllerProvider;
         this.bus = bus;
-		
-		dockPanel = new DockPanel();
-		
-		dockPanel.setSpacing(10);
-		dockPanel.setWidth("100%");
-
-		createNorth();
-		createWest();
-		createCenter();
-
-		dockPanel.add(north, DockPanel.NORTH);
-		dockPanel.add(west, DockPanel.WEST);
-		dockPanel.add(center, DockPanel.CENTER);
-		dockPanel.setCellHorizontalAlignment(north, DockPanel.ALIGN_RIGHT);
-		dockPanel.setCellHorizontalAlignment(center, DockPanel.ALIGN_LEFT);
-		
-		initWidget(dockPanel);
-	}
-
-	private void createWest() {
-			west = new RoundedPanel(RoundedPanel.ALL,1);
-			west.add(folderTree);
-			west.setWidth("150px");	
-			
-			 
-	        folderTree.setAnimationEnabled(true);   
-	        folderPanel.setSpacing(5);
-	        
-	        
-	        folderButtonBar.setSpacing(3);
-	        folderButtonBar.add(newFolderButton);
-	        folderButtonBar.add(renameFolderButton);
-	        folderButtonBar.add(deleteFolderButton);
-	        RoundedPanel buttonPanel = new RoundedPanel(RoundedPanel.ALL,1);
-	        buttonPanel.setBorder();
-	        buttonPanel.add(folderButtonBar);
-	        
-	        folderPanel.add(buttonPanel);
-	        folderPanel.add(folderTree);
-
-	        panel.add(loader);
-	        confirmFolderDeleteBox.setText(messages.confirmDeleteFolder());
-
-	        bus.addHandler(LoginEvent.TYPE,new LoginEventHandler() {
-
-	            public void onLogin(LoginEvent event) {
-	                user = event.getUser();
-	            }
-	            
-	        });
-	        bus.addHandler(LogoutEvent.TYPE,new LogoutEventHandler() {
-
-	            public void onLogout(LogoutEvent event) {
-	                user = null;
-	            }
-	            
-	        });
-	        west.add(panel);
-	}
-	
-	private void createNorth() {
-		north = new VerticalPanel();
-		north.setWidth("100%");
-		
-		
-		HorizontalPanel barPanel = new HorizontalPanel();
-		barPanel.setWidth("100%");
-
-		HorizontalPanel hPanel = new HorizontalPanel();
-		hPanel.setSpacing(5);
-		hPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
-	
-		
-		searchBox.setAnimationEnabled(true);
-		searchBox.setAutoSelectEnabled(false);
-		searchBox.setWidth("250px");
-		searchBox.setLimit(20);
-		searchBox.addKeyUpHandler(new KeyUpHandler() {
-
-			public void onKeyUp(KeyUpEvent event) {
-				if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
-					searchButton.click();
-				}
-			}
-			
-		});
-		hPanel.add(searchBox);
-		hPanel.add(searchButton);
-		barPanel.add(hPanel);
-		barPanel.setCellHorizontalAlignment(hPanel, HorizontalPanel.ALIGN_LEFT);
-		barPanel.add(loading);
-		barPanel.setCellHorizontalAlignment(loading,HorizontalPanel.ALIGN_RIGHT);
-		barPanel.setCellVerticalAlignment(loading, HorizontalPanel.ALIGN_MIDDLE);
-		
-		north.add(barPanel);
-		
-	}
-
-	private void createCenter() {
-		center = new RoundedPanel(RoundedPanel.ALL, 1);
-		center.setBorder();
-		center.setWidth("100%");
-		center.add(mListView);
-
-	}
-
-	public HasClickHandlers getSearchClick() {
-		return searchButton;
-	}
-	public HasValue<String> getSearchValue() {
-		return searchBox;
-	}
-	
-
-	public void fillOracle(ArrayList<Message> messages) {
-		for (int i = 0; i < messages.size();i++) {
-			String subject = messages.get(i).getSubject();
-			String from = messages.get(i).getFrom();
-			if (subject != null && subject.trim().length() > 0) {
-				oracle.add(subject.trim());
-			}
-			if (from != null && from.trim().length() > 0) {
-				oracle.add(from.trim());
-			}
-		}
-		searchBox.setText("");
-	}
-
-	public void setCenter(Widget widget) {
-		centerWidget = widget;
-		center.setWidget(centerWidget);
-	}
-	
+
+        dockPanel = new DockPanel();
+
+        dockPanel.setSpacing(10);
+        dockPanel.setWidth("100%");
+
+        createNorth();
+        createWest();
+        createCenter();
+
+        dockPanel.add(north, DockPanel.NORTH);
+        dockPanel.add(west, DockPanel.WEST);
+        dockPanel.add(center, DockPanel.CENTER);
+        dockPanel.setCellHorizontalAlignment(north, DockPanel.ALIGN_RIGHT);
+        dockPanel.setCellHorizontalAlignment(center, DockPanel.ALIGN_LEFT);
+
+        initWidget(dockPanel);
+    }
+
+    private void createWest() {
+        west = new RoundedPanel(RoundedPanel.ALL, 1);
+        west.add(folderTree);
+        west.setWidth("150px");
+
+        folderTree.setAnimationEnabled(true);
+        folderPanel.setSpacing(5);
+
+        folderButtonBar.setSpacing(3);
+        folderButtonBar.add(newFolderButton);
+        folderButtonBar.add(renameFolderButton);
+        folderButtonBar.add(deleteFolderButton);
+        RoundedPanel buttonPanel = new RoundedPanel(RoundedPanel.ALL, 1);
+        buttonPanel.setBorder();
+        buttonPanel.add(folderButtonBar);
+
+        folderPanel.add(buttonPanel);
+        folderPanel.add(folderTree);
+
+        panel.add(loader);
+        confirmFolderDeleteBox.setText(messages.confirmDeleteFolder());
+
+        bus.addHandler(LoginEvent.TYPE, new LoginEventHandler() {
+
+            public void onLogin(LoginEvent event) {
+                user = event.getUser();
+            }
+
+        });
+        bus.addHandler(LogoutEvent.TYPE, new LogoutEventHandler() {
+
+            public void onLogout(LogoutEvent event) {
+                user = null;
+            }
+
+        });
+        west.add(panel);
+    }
+
+    private void createNorth() {
+        north = new VerticalPanel();
+        north.setWidth("100%");
+
+        HorizontalPanel barPanel = new HorizontalPanel();
+        barPanel.setWidth("100%");
+
+        HorizontalPanel hPanel = new HorizontalPanel();
+        hPanel.setSpacing(5);
+        hPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
+
+        searchBox.setAnimationEnabled(true);
+        searchBox.setAutoSelectEnabled(false);
+        searchBox.setWidth("250px");
+        searchBox.setLimit(20);
+        searchBox.addKeyUpHandler(new KeyUpHandler() {
+
+            public void onKeyUp(KeyUpEvent event) {
+                if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
+                    searchButton.click();
+                }
+            }
+
+        });
+        hPanel.add(searchBox);
+        hPanel.add(searchButton);
+        barPanel.add(hPanel);
+        barPanel.setCellHorizontalAlignment(hPanel, HorizontalPanel.ALIGN_LEFT);
+        barPanel.add(loading);
+        barPanel.setCellHorizontalAlignment(loading, HorizontalPanel.ALIGN_RIGHT);
+        barPanel.setCellVerticalAlignment(loading, HorizontalPanel.ALIGN_MIDDLE);
+
+        north.add(barPanel);
+
+    }
+
+    private void createCenter() {
+        center = new RoundedPanel(RoundedPanel.ALL, 1);
+        center.setBorder();
+        center.setWidth("100%");
+        center.add(mListView);
+
+    }
+
+    public HasClickHandlers getSearchClick() {
+        return searchButton;
+    }
+
+    public HasValue<String> getSearchValue() {
+        return searchBox;
+    }
+
+    public void fillOracle(ArrayList<Message> messages) {
+        for (int i = 0; i < messages.size(); i++) {
+            String subject = messages.get(i).getSubject();
+            String from = messages.get(i).getFrom();
+            if (subject != null && subject.trim().length() > 0) {
+                oracle.add(subject.trim());
+            }
+            if (from != null && from.trim().length() > 0) {
+                oracle.add(from.trim());
+            }
+        }
+        searchBox.setText("");
+    }
+
+    public void setCenter(Widget widget) {
+        centerWidget = widget;
+        center.setWidget(centerWidget);
+    }
+
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#bindTreeItems(java.util.List)
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#bindTreeItems(
+     * java.util.List)
      */
     public void bindTreeItems(List<IMAPTreeItem> treeList) {
         folderTree.clear();
-        for (int i = 0; i < dropControllerList.size();i++) {
+        for (int i = 0; i < dropControllerList.size(); i++) {
             controller.unregisterDropController(dropControllerList.get(i));
         }
-        
+
         for (int i = 0; i < treeList.size(); i++) {
             IMAPTreeItem item = treeList.get(i);
             bindDropController(item);
             folderTree.addItem(item);
-            
+
             if (((IMAPFolder) item.getUserObject()).getFullName().equalsIgnoreCase(user.getSettings().getInboxFolderName()))
{
                 folderTree.setSelectedItem(item, false);
             }
-            
+
         }
     }
-    
+
     /**
      * Bind a IMAPFolderDropController to the given Item and all its childs
      * 
@@ -269,24 +268,26 @@
         IMAPFolderDropController dropController = new IMAPFolderDropController(item);
         controller.registerDropController(dropController);
         dropControllerList.add(dropController);
-        
+
         if (item.getChildCount() > 0) {
-            for (int i = 0; i < item.getChildCount();   i++) {
-                bindDropController((IMAPTreeItem)item.getChild(i));
+            for (int i = 0; i < item.getChildCount(); i++) {
+                bindDropController((IMAPTreeItem) item.getChild(i));
             }
         }
     }
-    
+
     /*
      * (non-Javadoc)
+     * 
      * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getTree()
      */
     public HasSelectionHandlers<TreeItem> getTree() {
         return folderTree;
     }
-    
+
     /*
      * (non-Javadoc)
+     * 
      * @see net.customware.gwt.presenter.client.widget.WidgetDisplay#asWidget()
      */
     public Widget asWidget() {
@@ -295,6 +296,7 @@
 
     /*
      * (non-Javadoc)
+     * 
      * @see net.customware.gwt.presenter.client.Display#startProcessing()
      */
     public void startProcessing() {
@@ -305,26 +307,27 @@
 
     /*
      * (non-Javadoc)
+     * 
      * @see net.customware.gwt.presenter.client.Display#stopProcessing()
      */
     public void stopProcessing() {
         panel.clear();
         panel.add(folderPanel);
     }
-    
+
     /**
      * Drop controller which handle drop on TreeItems
      * 
-     *
+     * 
      */
     private class IMAPFolderDropController extends SimpleDropController {
         private IMAPTreeItem item;
-        
+
         public IMAPFolderDropController(IMAPTreeItem item) {
             super(item.getWidget());
             this.item = item;
         }
-        
+
         /**
          * Veto the Drop if the folder is the same
          */
@@ -334,19 +337,19 @@
                 throw new VetoDragException();
             }
         }
-        
+
         /**
          * Set the right unseen count on the folders and fire an event
          */
         @Override
         public void onDrop(DragContext context) {
-            IMAPTreeItem oldTreeItem = (IMAPTreeItem)folderTree.getSelectedItem();
-            Message message = (Message)controller.getDragValue();
+            IMAPTreeItem oldTreeItem = (IMAPTreeItem) folderTree.getSelectedItem();
+            Message message = (Message) controller.getDragValue();
             if (message.getFlags().contains(IMAPFlag.SEEN) == false) {
                 oldTreeItem.decreaseUnseenMessageCount();
                 item.increaseUnseenMessageCount();
             }
-            bus.fireEvent(new MoveMessageEvent(user,(IMAPFolder)oldTreeItem.getUserObject(),(IMAPFolder)item.getUserObject(),message));
+            bus.fireEvent(new MoveMessageEvent(user, (IMAPFolder) oldTreeItem.getUserObject(),
(IMAPFolder) item.getUserObject(), message));
         }
 
         /**
@@ -373,7 +376,9 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getRenameClick()
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getRenameClick()
      */
     public HasClickHandlers getRenameClick() {
         return renameFolderButton;
@@ -381,7 +386,9 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getDeleteEnable()
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getDeleteEnable()
      */
     public HasEnable getDeleteEnable() {
         return deleteFolderButton;
@@ -389,7 +396,9 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getNewEnable()
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getNewEnable()
      */
     public HasEnable getNewEnable() {
         return newFolderButton;
@@ -397,7 +406,9 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getRenameEnable()
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getRenameEnable()
      */
     public HasEnable getRenameEnable() {
         return renameFolderButton;
@@ -405,7 +416,9 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getDeleteClick()
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getDeleteClick()
      */
     public HasClickHandlers getDeleteClick() {
         return deleteFolderButton;
@@ -413,6 +426,7 @@
 
     /*
      * (non-Javadoc)
+     * 
      * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getNewClick()
      */
     public HasClickHandlers getNewClick() {
@@ -421,7 +435,10 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getDeleteConfirmDialog()
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getDeleteConfirmDialog
+     * ()
      */
     public HasDialog getDeleteConfirmDialog() {
         return confirmFolderDeleteBox;
@@ -429,7 +446,10 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getDeleteConfirmClick()
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#getDeleteConfirmClick
+     * ()
      */
     public HasClickHandlers getDeleteConfirmClick() {
         return confirmFolderDeleteBox;
@@ -437,12 +457,14 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#deleteSelectedFolder()
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#deleteSelectedFolder
+     * ()
      */
     public void deleteSelectedFolder() {
         folderTree.getSelectedItem().remove();
-        
-        
+
         // Select the INBOX after delete folder
         for (int i = 0; i < folderTree.getItemCount(); i++) {
             IMAPTreeItem item = (IMAPTreeItem) folderTree.getItem(i);
@@ -451,23 +473,27 @@
                 break;
             }
         }
-        
+
     }
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#createFolder(org.apache.hupa.client.widgets.EditHandler)
+     * 
+     * @see
+     * org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#createFolder(org
+     * .apache.hupa.client.widgets.EditHandler)
      */
     public HasEditable createFolder(EditHandler handler) {
-        final IMAPTreeItem selected = (IMAPTreeItem)folderTree.getSelectedItem();
+        final IMAPTreeItem selected = (IMAPTreeItem) folderTree.getSelectedItem();
         IMAPFolder oldFolder = (IMAPFolder) selected.getUserObject();
-        
-        // Generate a new folder with a whitespace as name, this is needed as workaround

-        IMAPFolder folder = new IMAPFolder(oldFolder.getFullName() + oldFolder.getDelimiter()
+" ");
+
+        // Generate a new folder with a whitespace as name, this is needed as
+        // workaround
+        IMAPFolder folder = new IMAPFolder(oldFolder.getFullName() + oldFolder.getDelimiter()
+ " ");
         folder.setDelimiter(oldFolder.getDelimiter());
 
         final IMAPTreeItem newItem = new IMAPTreeItem(folder);
-        
+
         // add the new item as child
         folderTree.getSelectedItem().addItem(newItem);
         newItem.addEditHandler(handler);
@@ -475,33 +501,35 @@
 
             public void onEditEvent(EditEvent event) {
                 if (event.getEventType().equals(EditEvent.EventType.Cancel)) {
-                    // remove the folder 
+                    // remove the folder
                     newItem.remove();
                     folderTree.setSelectedItem(selected, false);
                 } else if (event.getEventType().equals(EditEvent.EventType.Stop)) {
                     // Select the new created folder and fire an event
                     folderTree.setSelectedItem(newItem, true);
                 }
-                
+
             }
-            
+
         });
-        // Expand the parent 
-        folderTree.getSelectedItem().setState(true,false);
-        
-        // Select the new folder  and start editing it
+        // Expand the parent
+        folderTree.getSelectedItem().setState(true, false);
+
+        // Select the new folder and start editing it
         folderTree.setSelectedItem(newItem, false);
         newItem.startEdit();
-        
+
         // reset the text of the new item (remove the whitespace)
         newItem.setText("");
-        
+
         return newItem;
     }
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#decreaseUnseenMessageCount(org.apache.hupa.shared.data.IMAPFolder,
int)
+     * 
+     * @seeorg.apache.hupa.client.mvp.IMAPFolderPresenter.Display#
+     * decreaseUnseenMessageCount(org.apache.hupa.shared.data.IMAPFolder, int)
      */
     public void decreaseUnseenMessageCount(IMAPFolder folder, int amount) {
         int count = folderTree.getItemCount();
@@ -511,13 +539,15 @@
                 item.descreaseUnseenMessageCount(amount);
                 break;
             }
-            
+
         }
     }
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.client.mvp.IMAPFolderPresenter.Display#increaseUnseenMessageCount(org.apache.hupa.shared.data.IMAPFolder,
int)
+     * 
+     * @seeorg.apache.hupa.client.mvp.IMAPFolderPresenter.Display#
+     * increaseUnseenMessageCount(org.apache.hupa.shared.data.IMAPFolder, int)
      */
     public void increaseUnseenMessageCount(IMAPFolder folder, int amount) {
         int count = folderTree.getItemCount();
@@ -527,16 +557,16 @@
                 item.increaseUnseenMessageCount(amount);
                 break;
             }
-            
+
         }
     }
-    
+
     private IMAPTreeItem findTreeItemForFolder(IMAPTreeItem item, IMAPFolder folder) {
-        if (folder.getFullName().equalsIgnoreCase(((IMAPFolder)item.getUserObject()).getFullName()))
{
+        if (folder.getFullName().equalsIgnoreCase(((IMAPFolder) item.getUserObject()).getFullName()))
{
             return item;
         }
         for (int i = 0; i < item.getChildCount(); i++) {
-            IMAPTreeItem tItem = findTreeItemForFolder((IMAPTreeItem)item.getChild(i),folder);
+            IMAPTreeItem tItem = findTreeItemForFolder((IMAPTreeItem) item.getChild(i), folder);
             if (tItem != null) {
                 return tItem;
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message