labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r791259 - in /labs/hupa: src/main/java/org/apache/hupa/client/view/MainView.java src/main/java/org/apache/hupa/client/widgets/IMAPTreeItem.java src/main/java/org/apache/hupa/server/IMAPServiceImpl.java war/Hupa.css
Date Sun, 05 Jul 2009 15:34:49 GMT
Author: norman
Date: Sun Jul  5 15:34:49 2009
New Revision: 791259

URL: http://svn.apache.org/viewvc?rev=791259&view=rev
Log:
just some more eyecandy

Added:
    labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPTreeItem.java
Modified:
    labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java
    labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java
    labs/hupa/war/Hupa.css

Modified: labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java?rev=791259&r1=791258&r2=791259&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java Sun Jul  5 15:34:49
2009
@@ -45,6 +45,7 @@
 import org.apache.hupa.client.model.MessageModelData;
 import org.apache.hupa.client.model.ModelReturnData;
 import org.apache.hupa.client.widgets.IMAPMessageWidget;
+import org.apache.hupa.client.widgets.IMAPTreeItem;
 import org.cobogw.gwt.user.client.ui.Button;
 import org.cobogw.gwt.user.client.ui.ButtonBar;
 import org.cobogw.gwt.user.client.ui.RoundedPanel;
@@ -65,6 +66,7 @@
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
+import com.google.gwt.user.client.ui.SimplePanel;
 import com.google.gwt.user.client.ui.SuggestBox;
 import com.google.gwt.user.client.ui.Tree;
 import com.google.gwt.user.client.ui.TreeItem;
@@ -78,7 +80,7 @@
 public class MainView extends View<ModelReturnData,DockPanel> {
  
 	private IMAPTreeImages tImages = GWT.create(IMAPTreeImages.class);
-	private Tree folderTree = new Tree(tImages, true);
+	private Tree folderTree = new Tree(tImages,true);
 	private HupaConstants constants = GWT.create(HupaConstants.class);
 	private RoundedPanel west;
 	private VerticalPanel north;
@@ -109,12 +111,14 @@
 	private void createWest() {
 		west = new RoundedPanel(RoundedPanel.ALL);
 		west.add(folderTree);
-		west.setWidth("30%");
-
+		west.setWidth("30%");	
+		folderTree.setAnimationEnabled(true);
 		folderTree.addSelectionHandler(new SelectionHandler<TreeItem>() {
 
 			public void onSelection(SelectionEvent<TreeItem> event) {
-				folder = (IMAPFolder) event.getSelectedItem().getUserObject();
+				TreeItem item = event.getSelectedItem();
+				
+				folder = (IMAPFolder) item.getUserObject();
 				controller.call(new Event<MessageListModelData, HupaAction>(HupaAction.FETCH_MESSAGES,
new MessageListModelData(user,folder,0,20), masker));
 			}
 
@@ -161,6 +165,7 @@
 			}
 
 		});
+		
 		mailTable.setCellSpacing(0);
 		mailTable.setWidget(0, 0, headerCheckbox);
 		mailTable.getFlexCellFormatter().setWidth(0, 0, "15px");
@@ -358,18 +363,19 @@
 	 * @param list
 	 * @return
 	 */
-	private List<TreeItem> createTreeNodes(List<IMAPFolder> list) {
-		List<TreeItem> tList = new ArrayList<TreeItem>();
+	private List<IMAPTreeItem> createTreeNodes(List<IMAPFolder> list) {
+		List<IMAPTreeItem> tList = new ArrayList<IMAPTreeItem>();
 
 		for (int i = 0; i < list.size(); i++) {
 			IMAPFolder iFolder = list.get(i);
-			TreeItem record = new TreeItem(iFolder.getName() + " ("
+			IMAPTreeItem record = new IMAPTreeItem(iFolder.getName() + " ("
 					+ iFolder.getUnseeMessageCount() + ")");
+			
 			record.setUserObject(iFolder);
 
 			List<IMAPFolder> childFolders = iFolder.getChildIMAPFolders();
 			if (childFolders != null && childFolders.isEmpty() == false) {
-				List<TreeItem> items = createTreeNodes(childFolders);
+				List<IMAPTreeItem> items = createTreeNodes(childFolders);
 				for (int a = 0; a < items.size(); a++) {
 					record.addItem(items.get(a));
 				}
@@ -439,7 +445,7 @@
 				// clear off the tree
 				folderTree.clear();
 
-				List<TreeItem> tList = createTreeNodes((List<IMAPFolder>) data.getObject());
+				List<IMAPTreeItem> tList = createTreeNodes((List<IMAPFolder>) data.getObject());
 				for (int i = 0; i < tList.size(); i++) {
 					folderTree.addItem(tList.get(i));
 				}

Added: labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPTreeItem.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPTreeItem.java?rev=791259&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPTreeItem.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPTreeItem.java Sun Jul  5 15:34:49
2009
@@ -0,0 +1,48 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.hupa.client.widgets;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.TreeItem;
+
+public class IMAPTreeItem extends TreeItem{
+	
+	public IMAPTreeItem(String text) {
+		super();
+		SimplePanel panel = new SimplePanel();
+		Label tLabel = new Label(text);
+		panel.add(tLabel);
+		setWidget(panel);
+		getWidget().setStyleName("hupa-IMAPFolder");
+
+	}
+	
+	public void setSelected(boolean selected) {
+		super.setSelected(selected);
+		if (isSelected()) {
+			getWidget().setStyleName("hupa-IMAPFolder-selected");
+		} else {
+			getWidget().setStyleName("hupa-IMAPFolder");
+		}
+	}
+	
+	
+}

Modified: labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java?rev=791259&r1=791258&r2=791259&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java Sun Jul  5 15:34:49
2009
@@ -27,10 +27,20 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.hupa.client.data.IMAPFolder;
+import org.apache.hupa.client.data.IMAPHeader;
+import org.apache.hupa.client.data.IMAPMessage;
+import org.apache.hupa.client.data.IMAPMessageContent;
+import org.apache.hupa.client.data.IMAPUser;
+import org.apache.hupa.client.data.ResultList;
+import org.apache.hupa.client.data.IMAPMessage.IMAPFlag;
+import org.apache.hupa.client.services.IMAPService;
+import org.apache.hupa.client.services.IMAPServiceException;
 import org.columba.ristretto.coder.Base64DecoderInputStream;
-import org.columba.ristretto.coder.EncodedWord;
-import org.columba.ristretto.coder.QuotedPrintableDecoderInputStream;
 import org.columba.ristretto.coder.CharsetDecoderInputStream;
+import org.columba.ristretto.coder.QuotedPrintableDecoderInputStream;
 import org.columba.ristretto.imap.IMAPException;
 import org.columba.ristretto.imap.IMAPFlags;
 import org.columba.ristretto.imap.IMAPProtocol;
@@ -40,27 +50,13 @@
 import org.columba.ristretto.io.StreamUtils;
 import org.columba.ristretto.message.Address;
 import org.columba.ristretto.message.BasicHeader;
-import org.columba.ristretto.message.Header;
 import org.columba.ristretto.message.MailboxInfo;
 import org.columba.ristretto.message.MimeHeader;
 import org.columba.ristretto.message.MimePart;
 import org.columba.ristretto.message.MimeTree;
-import org.columba.ristretto.parser.DateParser;
-import org.columba.ristretto.parser.ParserException;
 
-import org.apache.hupa.client.data.IMAPFolder;
-import org.apache.hupa.client.data.IMAPHeader;
-import org.apache.hupa.client.data.IMAPMessage;
-import org.apache.hupa.client.data.IMAPMessageContent;
-import org.apache.hupa.client.data.IMAPUser;
-import org.apache.hupa.client.data.ResultList;
-import org.apache.hupa.client.data.IMAPMessage.IMAPFlag;
-import org.apache.hupa.client.services.IMAPService;
-import org.apache.hupa.client.services.IMAPServiceException;
 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
 
-import org.apache.commons.lang.StringEscapeUtils;
-
 public class IMAPServiceImpl extends RemoteServiceServlet implements
 		IMAPService {
 
@@ -131,7 +127,6 @@
 				matchedList.addAll(Arrays.asList(proto.search(new SearchKey[]{new SearchKey(SearchKey.TEXT,searchString)})));
 				Collections.sort(matchedList);
 				
-				System.err.println("mIds=" + matchedList.size());
 				if (matchedList.size() == 0) {
 					return mList;
 				}

Modified: labs/hupa/war/Hupa.css
URL: http://svn.apache.org/viewvc/labs/hupa/war/Hupa.css?rev=791259&r1=791258&r2=791259&view=diff
==============================================================================
--- labs/hupa/war/Hupa.css (original)
+++ labs/hupa/war/Hupa.css Sun Jul  5 15:34:49 2009
@@ -97,6 +97,9 @@
 	vertical-align:		top;
 }
 
-.gwt-Tree .gwt-TreeItem-selected {
-    background: #E6E6FA;
+.hupa-IMAPFolder-selected {
+	background:			#E6E6FA;
 }
+
+.hupa-IMAPFolder {
+}
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message