labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r794727 - in /labs/hupa/src/main/java/org/apache/hupa/client: mvp/IMAPMessageListView.java widgets/MyFixedWidthGrid.java widgets/MyFixedWithGrid.java widgets/PagingScrollToolTipTable.java
Date Thu, 16 Jul 2009 15:58:58 GMT
Author: norman
Date: Thu Jul 16 15:58:58 2009
New Revision: 794727

URL: http://svn.apache.org/viewvc?rev=794727&view=rev
Log:
Hide tooltip on click

Added:
    labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWidthGrid.java
      - copied, changed from r794320, labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWithGrid.java
Removed:
    labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWithGrid.java
Modified:
    labs/hupa/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
    labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.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=794727&r1=794726&r2=794727&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 Thu Jul 16
15:58:58 2009
@@ -30,7 +30,7 @@
 import org.apache.hupa.client.HupaConstants;
 import org.apache.hupa.client.bundles.MyPagingOptionImages;
 import org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display;
-import org.apache.hupa.client.widgets.MyFixedWithGrid;
+import org.apache.hupa.client.widgets.MyFixedWidthGrid;
 import org.apache.hupa.client.widgets.PagingScrollToolTipTable;
 import org.apache.hupa.client.widgets.ToolTipProvider;
 import org.apache.hupa.shared.data.IMAPFolder;
@@ -91,7 +91,7 @@
 	
 	private PagingScrollToolTipTable<IMAPMessage> mailTable;
 	private EventBus bus;
-	private MyFixedWithGrid<IMAPMessage> dataTable = createDataTable();
+	private MyFixedWidthGrid<IMAPMessage> dataTable = createDataTable();
 	
 	@Inject
 	public IMAPMessageListView(DispatchAsync dispatcher,EventBus bus) {
@@ -245,8 +245,8 @@
 	/**
 	   * @return the newly created data table.
 	   */
-	  private MyFixedWithGrid<IMAPMessage> createDataTable() {
-	    MyFixedWithGrid<IMAPMessage> dataTable = new MyFixedWithGrid<IMAPMessage>();
+	  private MyFixedWidthGrid<IMAPMessage> createDataTable() {
+	    MyFixedWidthGrid<IMAPMessage> dataTable = new MyFixedWidthGrid<IMAPMessage>();
 	    dataTable.setSelectionPolicy(SelectionPolicy.CHECKBOX);
 	    return dataTable;
 	  }

Copied: labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWidthGrid.java (from
r794320, labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWithGrid.java)
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWidthGrid.java?p2=labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWidthGrid.java&p1=labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWithGrid.java&r1=794320&r2=794727&rev=794727&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWithGrid.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyFixedWidthGrid.java Thu Jul 16
15:58:58 2009
@@ -31,7 +31,7 @@
 import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.Event;
 
-public class MyFixedWithGrid<R> extends FixedWidthGrid implements
+public class MyFixedWidthGrid<R> extends FixedWidthGrid implements
 		HasClickHandlers {
 
 	private HandlerManager manager = new HandlerManager(this);

Modified: labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java?rev=794727&r1=794726&r2=794727&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java Thu
Jul 16 15:58:58 2009
@@ -19,8 +19,11 @@
 
 package org.apache.hupa.client.widgets;
 
+import org.apache.hupa.client.events.ClickEvent;
+import org.apache.hupa.client.events.ClickHandler;
+import org.apache.hupa.shared.data.IMAPMessage;
+
 import com.google.gwt.gen2.table.client.FixedWidthFlexTable;
-import com.google.gwt.gen2.table.client.FixedWidthGrid;
 import com.google.gwt.gen2.table.client.PagingScrollTable;
 import com.google.gwt.gen2.table.client.TableDefinition;
 import com.google.gwt.gen2.table.client.TableModel;
@@ -37,7 +40,7 @@
 	private Timer toolTipTimer;
 	private ToolTip tTip;
 	public PagingScrollToolTipTable(TableModel<E> tableModel,
-			FixedWidthGrid dataTable, FixedWidthFlexTable headerTable,
+			MyFixedWidthGrid<E> dataTable, FixedWidthFlexTable headerTable,
 			TableDefinition<E> tableDefinition,ToolTipProvider<E> tooltipProvider) {
 		super(tableModel, dataTable, headerTable, tableDefinition);
 		this.toolTipProvider = tooltipProvider;
@@ -48,7 +51,7 @@
 			public void onCellHighlight(CellHighlightEvent event) {
 				final int row = event.getValue().getRowIndex();
 				final int cell = event.getValue().getCellIndex();
-				 toolTipTimer= new Timer() {
+				toolTipTimer= new Timer() {
 
 						@Override
 						public void run() {
@@ -68,19 +71,30 @@
 		dataTable.addCellUnhighlightHandler(new CellUnhighlightHandler() {
 
 			public void onCellUnhighlight(CellUnhighlightEvent event) {
-				if (tTip != null) {
-					tTip.hide(true);
-				}
-				if (toolTipTimer != null) {
-					toolTipTimer.cancel();
-				}
+				hideToolTip();
 			}
 			
 		});
+		dataTable.addClickHandler(new ClickHandler<IMAPMessage>() {
+
+			public void onClick(ClickEvent<IMAPMessage> event) {
+				hideToolTip();
+			}
+			
+		});
+	}
+	
+	private void hideToolTip() {
+		if (tTip != null) {
+			tTip.hide(true);
+		}
+		if (toolTipTimer != null) {
+			toolTipTimer.cancel();
+		}
 	}
 
 	public PagingScrollToolTipTable(TableModel<E> tableModel,
-			FixedWidthGrid dataTable, FixedWidthFlexTable headerTable,
+			MyFixedWidthGrid<E> dataTable, FixedWidthFlexTable headerTable,
 			TableDefinition<E> tableDefinition) {
 		this(tableModel, dataTable, headerTable, tableDefinition,null);
 	}



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


Mime
View raw message