labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r793401 - /labs/hupa/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
Date Sun, 12 Jul 2009 20:14:01 GMT
Author: norman
Date: Sun Jul 12 20:14:01 2009
New Revision: 793401

URL: http://svn.apache.org/viewvc?rev=793401&view=rev
Log:
Use ToolTips

Modified:
    labs/hupa/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java

Modified: labs/hupa/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java?rev=793401&r1=793400&r2=793401&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java Sun Jul 12
20:14:01 2009
@@ -31,6 +31,7 @@
 import org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display;
 import org.apache.hupa.client.rpc.EventBus;
 import org.apache.hupa.client.widgets.MyFixedWithGrid;
+import org.apache.hupa.client.widgets.ToolTip;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.IMAPMessage;
 import org.apache.hupa.shared.data.IMAPUser;
@@ -63,6 +64,8 @@
 import com.google.gwt.gen2.table.client.SelectionGrid.SelectionPolicy;
 import com.google.gwt.gen2.table.client.TableDefinition.AbstractCellView;
 import com.google.gwt.gen2.table.client.TableModelHelper.Request;
+import com.google.gwt.gen2.table.event.client.CellHighlightEvent;
+import com.google.gwt.gen2.table.event.client.CellHighlightHandler;
 import com.google.gwt.gen2.table.event.client.HasPageLoadHandlers;
 import com.google.gwt.gen2.table.event.client.HasRowSelectionHandlers;
 import com.google.gwt.gen2.table.event.client.PageLoadEvent;
@@ -86,6 +89,7 @@
 	private IMAPUser user;
 	private IMAPFolder folder;
 	private String searchValue;
+	private ToolTip tip;
 	
 	private PagingScrollTable<IMAPMessage> mailTable;
 	private EventBus bus;
@@ -156,6 +160,27 @@
 			}
 		});
 		
+		dataTable.addCellHighlightHandler(new CellHighlightHandler() {
+
+			public void onCellHighlight(CellHighlightEvent event) {
+
+		
+				if (event.getValue().getCellIndex() == 3) {
+					if (tip != null) {
+						tip.hide(true);
+					}
+					tip = new ToolTip(mailTable.getRowValue(event.getValue().getRowIndex()).getIMAPHeader().getSubject());
+					tip.show();
+				} else if (event.getValue().getCellIndex() == 2) {
+					if (tip != null) {
+						tip.hide(true);
+					}
+					tip = new ToolTip(mailTable.getRowValue(event.getValue().getRowIndex()).getIMAPHeader().getFrom());
+					tip.show();
+				} 
+			}
+			
+		});
 		mailTable.getDataTable().setCellSpacing(0);
 
 	
@@ -209,6 +234,7 @@
 
 	private TableDefinition<IMAPMessage> createTableDefinitation() {
 		DefaultTableDefinition<IMAPMessage> def = new DefaultTableDefinition<IMAPMessage>(createColumnDefinitionList());
+		
 		return def;
 	}
 



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


Mime
View raw message