labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r793470 - in /labs/hupa/src/main/java/org/apache/hupa/client: mvp/IMAPMessageListView.java widgets/MyPagingScrollTable.java widgets/PagingScrollToolTipTable.java widgets/ToolTip.java
Date Mon, 13 Jul 2009 06:41:38 GMT
Author: norman
Date: Mon Jul 13 06:41:37 2009
New Revision: 793470

URL: http://svn.apache.org/viewvc?rev=793470&view=rev
Log:
Rename Widget to better reflect the features
Fix bug in Tooltip generation

Added:
    labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java
      - copied, changed from r793468, labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyPagingScrollTable.java
Removed:
    labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyPagingScrollTable.java
Modified:
    labs/hupa/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
    labs/hupa/src/main/java/org/apache/hupa/client/widgets/ToolTip.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=793470&r1=793469&r2=793470&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 Mon Jul 13
06:41:37 2009
@@ -31,7 +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.MyPagingScrollTable;
+import org.apache.hupa.client.widgets.PagingScrollToolTipTable;
 import org.apache.hupa.client.widgets.ToolTipProvider;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.IMAPMessage;
@@ -89,7 +89,7 @@
 	private IMAPFolder folder;
 	private String searchValue;
 	
-	private MyPagingScrollTable<IMAPMessage> mailTable;
+	private PagingScrollToolTipTable<IMAPMessage> mailTable;
 	private EventBus bus;
 	private MyFixedWithGrid<IMAPMessage> dataTable = createDataTable();
 	
@@ -101,7 +101,7 @@
 		VerticalPanel vPanel = new VerticalPanel();
 
 		
-		mailTable = new MyPagingScrollTable<IMAPMessage>(
+		mailTable = new PagingScrollToolTipTable<IMAPMessage>(
 				new IMAPMessageTableModel(), dataTable,
 				createHeaderTable(),
 				createTableDefinitation(), new IMAPMessageToolTipProvider());

Copied: labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java
(from r793468, labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyPagingScrollTable.java)
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java?p2=labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java&p1=labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyPagingScrollTable.java&r1=793468&r2=793470&rev=793470&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/widgets/MyPagingScrollTable.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/widgets/PagingScrollToolTipTable.java Mon
Jul 13 06:41:37 2009
@@ -28,16 +28,15 @@
 import com.google.gwt.gen2.table.event.client.CellHighlightHandler;
 import com.google.gwt.gen2.table.event.client.CellUnhighlightEvent;
 import com.google.gwt.gen2.table.event.client.CellUnhighlightHandler;
-import com.google.gwt.gen2.table.event.client.TableEvent.Cell;
 import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.ui.Widget;
 
-public class MyPagingScrollTable<E> extends PagingScrollTable<E>{
+public class PagingScrollToolTipTable<E> extends PagingScrollTable<E>{
 
 	private ToolTipProvider<E> toolTipProvider = null;
 	private Timer toolTipTimer;
 	private ToolTip tTip;
-	public MyPagingScrollTable(TableModel<E> tableModel,
+	public PagingScrollToolTipTable(TableModel<E> tableModel,
 			FixedWidthGrid dataTable, FixedWidthFlexTable headerTable,
 			TableDefinition<E> tableDefinition,ToolTipProvider<E> tooltipProvider) {
 		super(tableModel, dataTable, headerTable, tableDefinition);
@@ -46,21 +45,22 @@
 		
 		dataTable.addCellHighlightHandler(new CellHighlightHandler() {
 
-			public void onCellHighlight(final CellHighlightEvent event) {
+			public void onCellHighlight(CellHighlightEvent event) {
+				final int row = event.getValue().getRowIndex();
+				final int cell = event.getValue().getCellIndex();
 				 toolTipTimer= new Timer() {
 
 						@Override
 						public void run() {
-							Cell c = event.getValue();
-							Widget w = toolTipProvider.getToolTipContent(getRowValue(c.getRowIndex()), c.getCellIndex(),
c.getRowIndex());
+							Widget w = toolTipProvider.getToolTipContent(getRowValue(row), cell,row);
 							if (w != null) {
-								tTip = new ToolTip(w,3000);
+								tTip = new ToolTip(w,0);
 								tTip.show();
 							}
 						}
 						
 					};
-					toolTipTimer.schedule(2000);
+					toolTipTimer.schedule(1000);
 			}
 			
 		});
@@ -79,7 +79,7 @@
 		});
 	}
 
-	public MyPagingScrollTable(TableModel<E> tableModel,
+	public PagingScrollToolTipTable(TableModel<E> tableModel,
 			FixedWidthGrid dataTable, FixedWidthFlexTable headerTable,
 			TableDefinition<E> tableDefinition) {
 		this(tableModel, dataTable, headerTable, tableDefinition,null);

Modified: labs/hupa/src/main/java/org/apache/hupa/client/widgets/ToolTip.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/widgets/ToolTip.java?rev=793470&r1=793469&r2=793470&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/widgets/ToolTip.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/widgets/ToolTip.java Mon Jul 13 06:41:37
2009
@@ -23,7 +23,6 @@
 import com.google.gwt.event.logical.shared.CloseEvent;
 import com.google.gwt.event.logical.shared.CloseHandler;
 import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.Widget;
 
@@ -41,6 +40,7 @@
 	public ToolTip(Widget content, int showTimeMillis) {
 		this.showTimeMillis = showTimeMillis;
 		setWidget(content);
+		
 		closeTimer = new Timer() {
 
 			@Override
@@ -54,7 +54,9 @@
 	}
 	
 	public void show() {
-		closeTimer.schedule(showTimeMillis);
+		if (showTimeMillis > 0) {
+			closeTimer.schedule(showTimeMillis);
+		}
 		super.show();
 	}
 	/**



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


Mime
View raw message