[gwt-contrib] GWT 2.0.2

2010-02-12 Thread stuckagain
Hi,

Any idea when there will be a GWT 2.0.2 ? The 2.0.1 contains a few
issues that stops us from migrating (already reported and fixed), the
2.0 contains issues that were fixed in 2.0.1 ... so we must migrate.
building our own version is not immediatly possible.

David

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] Re: Add the ability to change the default HandlerManager of a Widget

2010-02-12 Thread Nathan Wells

 Thinking outload...

 What about allowing ctors to take a HM. The other ctors use the default
 implementation. If you dont care for a HM then use the ctors without HM in
 the parameter list. That way


The problem with this is that you then have to add HM to the ctor for every
extension of Widget (which are many).


 you dont pollute the widget method list with gets/creates and sets


Well, I think the current consensus is that gets and sets won't
happen/aren't necessary for the use case in question. As far as polluting
the Widget method list with createHM()... It is a protected method with a
default implementation, so

1) You would have to extend Widget (or one of widget's subclasses) to see
it.

2) You probably wouldn't see it unless you were purposefully looking for
things to extend about Widget


 which prolly dont make sense once the thing is built.


Since the HandlerManager is lazy loading (with good reason, too) the only
way this sort of flexible API makes sense is to (1) provide a factory method
or (2) allow for a HMFactory in the constructor. I tend towards the factory
method because it is a less complex change and because of the problems with
constructor extensions mentioned above.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Re: Add the ability to change the default HandlerManager of a Widget

2010-02-12 Thread Sven Brunken
Updated the patch to only add a createHandlerManager which gets called
by ensureHandlers.

On 12 Feb., 04:22, John LaBanca jlaba...@google.com wrote:
 Alright, lets go with createHandlerManager() for now.  Thanks for all the
 feedback.

 @sven -

 Would you like to update the patch by reverting the getHandlerManager()
 method back to a package protected method?  If you don't get to it for a few
 days, I'll can do it for you.

 Thanks,
 John LaBanca
 jlaba...@google.com

 On Thu, Feb 11, 2010 at 9:39 PM, Nathan Wells nwwe...@gmail.com wrote:
  I'd say that if you wanted to implement a HandlerManager stack, it
  would probably be best to do that internal to the HandlerManager,
  rather than forcing a Widget to know how events are handled.

  Assuming that is possible given the current Widget implementations
  (others more expert than I would know this, probably), the only API I
  would want is createHandlerManager(). I could then manage how that
  more complex HandlerManager is dealt with.

  While we're on the subject... if you're providing this factory method,
  I would rather see a well-documented interface to implement rather
  than a semi-documented implementation of which I would probably be
  overriding every method.

  just my .02

  On Feb 11, 11:05 am, Ray Ryan rj...@google.com wrote:
   This conversation keeps getting complicated by discussions of policy. I'm
   just trying to make it possible for widgets we haven't thought of yet to
   define policies of their own.

   E.g., to temporarily switch between modes that change the set of events
  they
   source, copying some handlers or not if that's appropriate (perhaps in
  mode
   B I simply am not a source of the events that would happen in mode A.
   Perhaps I am. Let me choose). E.g., to implement an HM stack. E.g., to
  try
   out a singleton HM (I wouldn't, but why should I stop you from trying it
   out).

   I think JohnL has hit the sweet spot with:

   /**
    * Called by default implementation of {...@link #getHM}
    * to lazily instantiate the HM for this widget.
    */
   protected HM createHM();

   /**
    * All access to the widget's HM must be made through this method.
    * It is an error to cache the object returned. The default
  implementation
    * returns the result of {...@link #createHM} the first time it is called.
    */
   protected HM getHM();

   If I override getHM(), I have the option to call the normal createHM() to
   get whatever HM the widget normally uses. Or not. If I override
  createHM() I
   can provide a custom implementation, or wrap the normal one, without
  having
   to re-implement the lazy instantiation mechanism.

   Am I trying to provide flexibility that no one is asking for?

  --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors



-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] GWT 2.0.2

2010-02-12 Thread Miguel Méndez
We should have the 2.0.2 release out by end of day today or Monday at the
latest.

On Fri, Feb 12, 2010 at 3:40 AM, stuckagain david.no...@gmail.com wrote:

 Hi,

 Any idea when there will be a GWT 2.0.2 ? The 2.0.1 contains a few
 issues that stops us from migrating (already reported and fixed), the
 2.0 contains issues that were fixed in 2.0.1 ... so we must migrate.
 building our own version is not immediatly possible.

 David

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors




-- 
Miguel

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Re: RFC: sharded linking

2010-02-12 Thread Alex Moffat
Where can I read a description of what -XshardPrecompile, or see the
code for it, it sounds very useful to me personally? It's not in 2.0.0
as far as I can see. My concerns about the sharded linking proposal
came from what I understood the original flow to be from my looking at
it and from the original sharded linkin proposal.

current Precompile:
   - parse Java and run generators
   - output: number of permutations, AST, generated artifacts
current CompilePerms:
   - input: permutation id, AST
   - compile one permutation to JavaScript
   - output: JavaScript, generated artifacts
current Link:
   - input: JavaScript from all permutations, generated artifacts
   - run linkers on all artifacts
   - emit EmittedArtifacts into the final output

If this isn't what the the current flow is then what is the current
flow and how does sharded linking fit into that?

On Feb 11, 6:43 pm, Scott Blum sco...@google.com wrote:
 I have a few comments, but first I wanted to raise the point that I'm not
 sure why we're having this argument about maximally sharded Precompiles at
 all.  For one thing, it's already implemented, and optional, via
 -XshardPrecompile.  I can't think of any reason to muck with this, or why
 it would have any relevance to sharded linking.  Can we just table that part
 for now, or is there something I'm missing?

 Okay, so now on to sharded linking itself.  Here's what I love:

 - Love the overall goals: do more work in parallel and eliminate
 serialization overhead.
 - Love the idea of simulated sharding because it enforces consistency.
 - Love that the linkers all run in the same order.

 Here's what I don't love:

 - I'm not sure why development mode wouldn't run a sharded link first.
  Wouldn't it make sense if development mode works just like production
 compile, it just runs a single development mode permutation shard link
 before running the final link?

 - I dislike the whole transition period followed by having to forcibly
 update all linkers, unless there's a really compelling reason to do so.
  Maybe I'm missing some use cases, but I don't see what problems result from
 having some linkers run early and others run late.  As Lex noted, all the
 linkers are largely independent of each other and mostly won't step on each
 other's toes.

 - It seems unnecessary to have to annotate Artifacts to say which ones are
 transferable, because I thought we already mandated that all Artifacts have
 to be transferable.

 I have in mind a different proposal that I believe addresses the same goals,
 but in a less-disruptive fashion.  Please feel free to poke holes in it:

 1) Linker was made an abstract class specifically so that it could be
 extended later.  I propose simply adding a new method linkSharded() with
 the same semantics as link().  Linkers that don't override this method
 would simply do nothing on the shards and possibly lose out on the
 opportunity to shard work.  Linkers that can effectively do some work on
 shards would override this method to do so.  (We might also have a
 relinkSharded() for development mode.)

 2) Instead of trying to do automatic thinning, we just let the linkers
 themselves do the thinning.  For example, one of the most
 serialization-expensive things we do is serialize/deserialze symbolMaps.  To
 avoid this, we update SymbolMapsLinker to do most of its work during
 sharding, and update IFrameLinker (et al) to remove the CompilationResult
 during the sharded link so it never gets sent across to the final link.

 The pros to this idea are (I think) that you don't break anyone... instead
 you opt-in to the optimization.  If you don't do anything, it should still
 work, but maybe slower than it could.

 The cons are... well maybe it's too simplistic and I'm missing some of the
 corner cases, or ways this could break down.

 Thoughts?
 Scott

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r7556 committed - Unselect the MenuItem in the top level MenuBar when auto-hiding a chil...

2010-02-12 Thread codesite-noreply

Revision: 7556
Author: jlaba...@google.com
Date: Thu Feb 11 05:01:40 2010
Log: Unselect the MenuItem in the top level MenuBar when auto-hiding a  
child MenuBar.

http://gwt-code-reviews.appspot.com/141804

Issue: 2458

http://code.google.com/p/google-web-toolkit/source/detail?r=7556

Modified:
 /trunk/user/src/com/google/gwt/user/client/ui/MenuBar.java
 /trunk/user/test/com/google/gwt/user/client/ui/MenuBarTest.java

===
--- /trunk/user/src/com/google/gwt/user/client/ui/MenuBar.java	Mon Feb  1  
02:58:54 2010
+++ /trunk/user/src/com/google/gwt/user/client/ui/MenuBar.java	Thu Feb 11  
05:01:40 2010

@@ -17,6 +17,8 @@

 import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.EventTarget;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
 import com.google.gwt.event.dom.client.KeyCodes;
 import com.google.gwt.event.logical.shared.CloseEvent;
 import com.google.gwt.event.logical.shared.CloseHandler;
@@ -534,7 +536,7 @@
 } else if ((parentMenu != null)  parentMenu.vertical) {
   parentMenu.selectPrevItem();
 } else {
-  close();
+  close(true);
 }
   }

@@ -598,14 +600,12 @@
 eatEvent(event);
 break;
   case KeyCodes.KEY_ESCAPE:
-closeAllParents();
-// Ensure the popup is closed even if it has not been enetered
-// with the mouse or key navigation
-if (parentMenu == null  popup != null) {
-  popup.hide();
-}
+closeAllParentsAndChildren();
 eatEvent(event);
 break;
+  case KeyCodes.KEY_TAB:
+closeAllParentsAndChildren();
+break;
   case KeyCodes.KEY_ENTER:
 if (!selectFirstItemIfNoneSelected()) {
   doItemAction(selectedItem, true, true);
@@ -793,12 +793,26 @@
* Closes all parent menu popups.
*/
   void closeAllParents() {
-MenuBar curMenu = this;
-while (curMenu.parentMenu != null) {
-  curMenu.close();
-  curMenu = curMenu.parentMenu;
+if (parentMenu != null) {
+  // The parent menu will recursively call closeAllParents.
+  close(false);
+} else {
+  // If this is the top most menu, deselect the current item.
+  selectItem(null);
 }
   }
+
+  /**
+   * Closes all parent and child menu popups.
+   */
+  void closeAllParentsAndChildren() {
+closeAllParents();
+// Ensure the popup is closed even if it has not been enetered
+// with the mouse or key navigation
+if (parentMenu == null  popup != null) {
+  popup.hide();
+}
+  }

   /*
* Performs the action associated with the given menu item. If the item  
has a

@@ -855,6 +869,13 @@
   }
 }
   }
+
+  /**
+   * Visible for testing.
+   */
+  PopupPanel getPopup() {
+return popup;
+  }

   void itemOver(MenuItem item, boolean focus) {
 if (item == null) {
@@ -952,11 +973,15 @@

   /**
* Closes this menu (if it is a popup).
+   *
+   * @param focus true to move focus to the parent
*/
-  private void close() {
+  private void close(boolean focus) {
 if (parentMenu != null) {
-  parentMenu.popup.hide();
-  parentMenu.focus();
+  parentMenu.popup.hide(!focus);
+  if (focus) {
+parentMenu.focus();
+  }
 }
   }

@@ -1017,6 +1042,15 @@

 // Hide focus outline in IE 6/7
 DOM.setElementAttribute(getElement(), hideFocus, true);
+
+// Deselect items when blurring without a child menu.
+addDomHandler(new BlurHandler() {
+  public void onBlur(BlurEvent event) {
+if (shownChildMenu == null) {
+  selectItem(null);
+}
+  }
+}, BlurEvent.getType());
   }

   private void moveToNextItem() {
@@ -1055,7 +1089,7 @@
   if ((parentMenu != null)  (!parentMenu.vertical)) {
 parentMenu.selectPrevItem();
   } else {
-close();
+close(true);
   }
 }
   }
===
--- /trunk/user/test/com/google/gwt/user/client/ui/MenuBarTest.java	Mon Oct  
26 18:35:41 2009
+++ /trunk/user/test/com/google/gwt/user/client/ui/MenuBarTest.java	Thu Feb  
11 05:01:40 2010

@@ -1,12 +1,12 @@
 /*
  * Copyright 2008 Google Inc.
- *
+ *
  * Licensed 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
@@ -15,9 +15,11 @@
  */
 package com.google.gwt.user.client.ui;

+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.NativeEvent;
+import com.google.gwt.event.dom.client.KeyCodes;
 import 

[gwt-contrib] [google-web-toolkit] r7559 committed - Updated the release notes for GWT 2.0.2.

2010-02-12 Thread codesite-noreply

Revision: 7559
Author: mmen...@google.com
Date: Thu Feb 11 07:22:23 2010
Log: Updated the release notes for GWT 2.0.2.

http://code.google.com/p/google-web-toolkit/source/detail?r=7559

Modified:
 /trunk/distro-source/core/src/release_notes.html

===
--- /trunk/distro-source/core/src/release_notes.html	Thu Feb  4 06:19:20  
2010
+++ /trunk/distro-source/core/src/release_notes.html	Thu Feb 11 07:22:23  
2010

@@ -30,6 +30,7 @@
   p style=margin-top: 5px; margin-left: 5px; font-weight: bold;  
font-size: 115%;for all versions/b

   ul
 lia href=#Release_Notes_Current@GWT_VERSION@/a/li
+lia href=#Release_Notes_2_0_12.0.1/a/li
 lia href=#Release_Notes_2_0_02.0.0/a/li
 lia href=#Release_Notes_2_0_0_rc22.0.0-rc2/a/li
 lia href=#Release_Notes_2_0_0_rc12.0.0-rc1/a/li
@@ -58,6 +59,18 @@
   a name=Release_Notes_Current/a
   h2Release Notes for @GWT_VERSION@/h2
   p
+  This 2.0.2 release contains a couple of fixes that were not included  
in the 2.0.1 release.

+  /p
+  h3Noteworthy Fixed Issues/h3
+  ul
+liStandard.css missing new layout styles (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4429;#4429/a)/li
+liUsing a PopupPanel in Internet Explorer without a history  
IFrame throws a NullPointerException (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4584;#4584/a)/li

+  /ul
+
+  hr/
+  a name=Release_Notes_2_0_1/a
+  h2Release Notes for 2.0.1/h2
+  p
   This 2.0.1 release contains fixes for bugs found in the 2.0.0  
release.

   /p
   h3Potentially breaking changes and fixes/h3
@@ -79,7 +92,6 @@
   ul
 liUiBinder Image class with resource attribute, removes styles  
on that image (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4415;#4415/a)/li
   	liWidgets lose focus if its placed on FocusPanel (Opera, Safari)  
(a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=1471;#1471/a)/li
-  	liStandard.css missing new layout styles (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4429;#4429/a)/li
   	liRemove method in SplitLayoutPanel is broken (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4217;#4217/a)/li
 liSplitter constructor hard codes the background color of the  
splitter to white (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4335;#4335/a)/li
 liImage should provide method to set alternative text (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4335;#4335/a)/li


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r7560 committed - Add a favorites table

2010-02-12 Thread codesite-noreply

Revision: 7560
Author: gwt.mirror...@gmail.com
Date: Fri Feb 12 08:00:20 2010
Log: Add a favorites table

http://code.google.com/p/google-web-toolkit/source/detail?r=7560

Modified:
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/DataBackedWidgets.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/StockService.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/StockServiceAsync.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/server/StockServiceImpl.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/StockQuote.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/StockRequest.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/StockResponse.java


===
---  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/DataBackedWidgets.java	 
Thu Feb 11 05:08:46 2010
+++  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/DataBackedWidgets.java	 
Fri Feb 12 08:00:20 2010

@@ -36,14 +36,12 @@
 import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.TextBox;

-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;

 /**
  * Entry point classes define codeonModuleLoad()/code.
@@ -78,13 +76,6 @@
 }
   };

-  private ColumnStockQuote, String notesColumn = new ColumnStockQuote,  
String(new TextInputCell()) {

-@Override
-protected String getValue(StockQuote object) {
-  return object.getNotes();
-}
-  };
-
   private ColumnStockQuote, Integer priceColumn = new ColumnStockQuote,  
Integer(

   new CurrencyCell()) {
 @Override
@@ -103,10 +94,13 @@
 }
   };

-  /**
-   * A set of user-marked 'favorite' ticker symbols.
-   */
-  private HashSetString favoritesByTicker = new HashSetString();
+  private ColumnStockQuote, String sharesColumn = new ColumnStockQuote,  
String(

+  new TextCell()) {
+@Override
+protected String getValue(StockQuote object) {
+  return  + object.getSharesOwned();
+}
+  };

   private AsyncListModelStockQuote favoritesListModel;

@@ -115,12 +109,10 @@
*/
   private HashMapString,String notesByTicker = new  
HashMapString,String();


-  private PagingTableListViewStockQuote resultsTable0;
+  private PagingTableListViewStockQuote resultsTable;

   private AsyncListModelStockQuote searchListModel;

-  private String searchQuery;
-
   /**
* The timer used to update the stock quotes.
*/
@@ -131,7 +123,7 @@
 }
   };

-  private Range[] searchRanges;
+  private PagingTableListViewStockQuote favoritesTable;

   /**
* This is the entry point method.
@@ -151,23 +143,27 @@
 // Create the list models
 searchListModel = new AsyncListModelStockQuote(new  
DataSourceStockQuote() {

   public void requestData(AsyncListModelStockQuote listModel) {
-sendSearchRequest(searchListModel.getRanges());
+update();
   }
 });

 favoritesListModel = new AsyncListModelStockQuote(new  
DataSourceStockQuote() {

   public void requestData(AsyncListModelStockQuote listModel) {
-sendFavoritesRequest(favoritesListModel.getRanges());
+update();
   }
 });

 // Create the results table.
-resultsTable0 = new PagingTableListViewStockQuote(searchListModel,  
10);

-resultsTable0.addColumn(favoriteColumn);
-resultsTable0.addColumn(tickerColumn);
-resultsTable0.addColumn(nameColumn);
-resultsTable0.addColumn(priceColumn);
-resultsTable0.addColumn(notesColumn);
+resultsTable = new PagingTableListViewStockQuote(searchListModel,  
10);

+resultsTable.addColumn(favoriteColumn);
+resultsTable.addColumn(tickerColumn);
+resultsTable.addColumn(nameColumn);
+resultsTable.addColumn(priceColumn);
+
+favoritesTable = new  
PagingTableListViewStockQuote(favoritesListModel, 10);

+favoritesTable.addColumn(tickerColumn);
+favoritesTable.addColumn(priceColumn);
+favoritesTable.addColumn(sharesColumn);

 favoriteColumn.setMutator(new MutatorStockQuote, Boolean() {
   public void mutate(StockQuote object, Boolean after) {
@@ -175,22 +171,18 @@
   }
 });

-notesColumn.setMutator(new MutatorStockQuote, String() {
-  public void mutate(StockQuote object, String after) {
-setNotes(object.getTicker(), after);
-  }
-});
-
-RootPanel.get().add(resultsTable0);
+RootPanel.get().add(resultsTable);
+RootPanel.get().add(new HTML(hr));
+RootPanel.get().add(favoritesTable);

 // Add a handler to send the name to the server
 queryField.addKeyUpHandler(new KeyUpHandler() {
   public void onKeyUp(KeyUpEvent event) {
-

[gwt-contrib] [google-web-toolkit] r7561 committed - Makes HandlerManager execute all event handlers even if one throws an...

2010-02-12 Thread codesite-noreply

Revision: 7561
Author: phopk...@google.com
Date: Thu Feb 11 10:21:52 2010
Log: Makes HandlerManager execute all event handlers even if one throws an
exception. Wraps thrown exceptions in an UmbrellaException (which is
factored out of AttachDetachException).

http://gwt-code-reviews.appspot.com/136805

http://code.google.com/p/google-web-toolkit/source/detail?r=7561

Added:
 /trunk/user/src/com/google/gwt/event/shared/UmbrellaException.java
Modified:
 /trunk/user/src/com/google/gwt/event/shared/HandlerManager.java
 /trunk/user/src/com/google/gwt/user/client/ui/AttachDetachException.java
 /trunk/user/test/com/google/gwt/event/shared/HandlerManagerTest.java

===
--- /dev/null
+++ /trunk/user/src/com/google/gwt/event/shared/UmbrellaException.java	Thu  
Feb 11 10:21:52 2010

@@ -0,0 +1,49 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed 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 com.google.gwt.event.shared;
+
+import java.util.Set;
+
+/**
+ * A {...@link RuntimeException} that collects a {...@link Set} of child
+ * {...@link Throwable}s together. Typically thrown after loop, with all of  
the
+ * exceptions thrown during that loop, but delayed so that the loop  
finishes

+ * executing.
+ */
+public class UmbrellaException extends RuntimeException {
+
+  /**
+   * The causes of the exception.
+   */
+  private SetThrowable causes;
+
+  public UmbrellaException(SetThrowable causes) {
+super(
+One or more exceptions caught, see full set in  
UmbrellaException#getCauses,

+causes.size() == 0 ? null : causes.toArray(new Throwable[0])[0]);
+this.causes = causes;
+  }
+
+  /**
+   * Get the set of exceptions that caused the failure.
+   *
+   * @return the set of causes
+   */
+  public SetThrowable getCauses() {
+return causes;
+  }
+
+}
===
--- /trunk/user/src/com/google/gwt/event/shared/HandlerManager.java	Mon  
Nov  2 09:21:49 2009
+++ /trunk/user/src/com/google/gwt/event/shared/HandlerManager.java	Thu Feb  
11 10:21:52 2010

@@ -19,8 +19,10 @@

 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;

 /**
  * Manager responsible for adding handlers to event sources and firing  
those

@@ -54,17 +56,39 @@
 boolean isReverseOrder) {
   TypeH type = event.getAssociatedType();
   int count = getHandlerCount(type);
+  SetThrowable causes = null;
+
   if (isReverseOrder) {
 for (int i = count - 1; i = 0; i--) {
   H handler = this.H getHandler(type, i);
-  event.dispatch(handler);
+  try {
+event.dispatch(handler);
+  } catch (Throwable e) {
+if (causes == null) {
+  // create lazily to avoid excess creation in general case
+  causes = new HashSetThrowable();
+}
+causes.add(e);
+  }
 }
   } else {
 for (int i = 0; i  count; i++) {
   H handler = this.H getHandler(type, i);
-  event.dispatch(handler);
+  try {
+event.dispatch(handler);
+  } catch (Throwable e) {
+if (causes == null) {
+  // create lazily to avoid excess creation in general case
+  causes = new HashSetThrowable();
+}
+causes.add(e);
+  }
 }
   }
+
+  if (causes != null) {
+throw new UmbrellaException(causes);
+  }
 }

 @SuppressWarnings(unchecked)
@@ -162,6 +186,11 @@
* Note, any subclass should be very careful about overriding this  
method, as

* adds/removes of handlers will not be safe except within this
* implementation.
+   *
+   * Any exceptions thrown by handlers will be bundled into a
+   * {...@link UmbrellaException} and then re-thrown after all handlers have
+   * completed. An exception thrown by a handler will not prevent other  
handlers

+   * from executing.
*
* @param event the event
*/
@@ -175,6 +204,7 @@
 try {
   firingDepth++;

+  // May throw an UmbrellaException.
   registry.fireEvent(event, isReverseOrder);

 } finally {
@@ -182,13 +212,14 @@
   if (firingDepth == 0) {
 handleQueuedAddsAndRemoves();
   }
-}
-if (oldSource == null) {
-  // This was my event, so I should kill it now that I'm done.
-  event.kill();
-} else {
-

[gwt-contrib] [google-web-toolkit] r7562 committed - tr...@7530,7559 was merged into this branch...

2010-02-12 Thread codesite-noreply

Revision: 7562
Author: jlaba...@google.com
Date: Fri Feb 12 08:15:34 2010
Log: tr...@7530,7559 was merged into this branch
  Updates release notes for 2.0.2.
  svn merge -c7530,7559 --ignore-ancestry  
https://google-web-toolkit.googlecode.com/svn/trunk



http://code.google.com/p/google-web-toolkit/source/detail?r=7562

Modified:
 /releases/2.0/branch-info.txt
 /releases/2.0/distro-source/core/src/release_notes.html

===
--- /releases/2.0/branch-info.txt   Wed Feb 10 08:16:46 2010
+++ /releases/2.0/branch-info.txt   Fri Feb 12 08:15:34 2010
@@ -1483,3 +1483,7 @@
   Adding null checks to all History methods to ensure that History is  
enabled.
   svn merge -c7542 --ignore-ancestry  
https://google-web-toolkit.googlecode.com/svn/trunk


+tr...@7530,7559 was merged into this branch
+  Updates release notes for 2.0.2.
+  svn merge -c7530,7559 --ignore-ancestry  
https://google-web-toolkit.googlecode.com/svn/trunk

+
===
--- /releases/2.0/distro-source/core/src/release_notes.html	Fri Jan 29  
13:26:48 2010
+++ /releases/2.0/distro-source/core/src/release_notes.html	Fri Feb 12  
08:15:34 2010

@@ -26,9 +26,11 @@
   /style/head

body
-  h1Google Web Toolkit Release Notes/h1
+  h1 style=margin-bottom: 0;Google Web Toolkit Release Notes/h1
+  p style=margin-top: 5px; margin-left: 5px; font-weight: bold;  
font-size: 115%;for all versions/b

   ul
 lia href=#Release_Notes_Current@GWT_VERSION@/a/li
+lia href=#Release_Notes_2_0_12.0.1/a/li
 lia href=#Release_Notes_2_0_02.0.0/a/li
 lia href=#Release_Notes_2_0_0_rc22.0.0-rc2/a/li
 lia href=#Release_Notes_2_0_0_rc12.0.0-rc1/a/li
@@ -57,7 +59,19 @@
   a name=Release_Notes_Current/a
   h2Release Notes for @GWT_VERSION@/h2
   p
-  This release contains fixes for bugs found in the 2.0.0 release.
+  This 2.0.2 release contains a couple of fixes that were not included  
in the 2.0.1 release.

+  /p
+  h3Noteworthy Fixed Issues/h3
+  ul
+liStandard.css missing new layout styles (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4429;#4429/a)/li
+liUsing a PopupPanel in Internet Explorer without a history  
IFrame throws a NullPointerException (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4584;#4584/a)/li

+  /ul
+
+  hr/
+  a name=Release_Notes_2_0_1/a
+  h2Release Notes for 2.0.1/h2
+  p
+  This 2.0.1 release contains fixes for bugs found in the 2.0.0  
release.

   /p
   h3Potentially breaking changes and fixes/h3
   ul
@@ -78,7 +92,6 @@
   ul
 liUiBinder Image class with resource attribute, removes styles  
on that image (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4415;#4415/a)/li
   	liWidgets lose focus if its placed on FocusPanel (Opera, Safari)  
(a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=1471;#1471/a)/li
-  	liStandard.css missing new layout styles (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4429;#4429/a)/li
   	liRemove method in SplitLayoutPanel is broken (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4217;#4217/a)/li
 liSplitter constructor hard codes the background color of the  
splitter to white (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4335;#4335/a)/li
 liImage should provide method to set alternative text (a  
href=http://code.google.com/p/google-web-toolkit/issues/detail?id=4335;#4335/a)/li

@@ -96,12 +109,13 @@
 See the GWT issue tracker for
 a  
href=http://code.google.com/p/google-web-toolkit/issues/list?can=1q=status:Fixed,FixedNotReleased%20milestone:2_0_1num=1000;
 the complete list of bug fixes and enhancements/a in this  
release.

-  /p
+  /p
   hr/
   a name=Release_Notes_2_0_0/a
   h2Release Notes for 2.0.0/h2
   p
-This release includes some minor bug fixes found in the release  
candidate.  See the release notes
+This release includes some minor bug fixes found in the release  
candidate.
+See a href=doc/latest/ReleaseNotes.htmlWhat's New in GWT  
2.0/a plus the release notes
 for a href=#Release_Notes_2_0_0_rc12.0.0-rc1/a and a  
href=#Release_Notes_2_0_0_rc22.0.0-rc2/a
 for the full list of features and bugs fixes included in the GWT  
2.0.0 release.

   /p
@@ -476,7 +490,7 @@
   a name=Release_Notes_1_5_0/a
   h2Release Notes for 1.5.0 (RC)/h2
   p
-  This release candidate is, in a word, huge. Rather than including  
all the details here, please see a  
href=http://code.google.com/docreader/#p(google-web-toolkit-doc-1-5)t(Whatsnewin15)What's  
New in GWT 1.5?/a for full details. The main thing you'll want to know is  
that GWT 1.5 supports the Java 5 language features (generics, enumerated  

[gwt-contrib] [google-web-toolkit] r7563 committed - Adding an option to buy or sell stock the datawidgets sample.

2010-02-12 Thread codesite-noreply

Revision: 7563
Author: gwt.mirror...@gmail.com
Date: Fri Feb 12 08:17:37 2010
Log: Adding an option to buy or sell stock the datawidgets sample.

http://code.google.com/p/google-web-toolkit/source/detail?r=7563

Added:
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/BuySellPopup.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/Transaction.java

Modified:
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/DataBackedWidgets.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/StockService.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/StockServiceAsync.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/server/StockServiceImpl.java


===
--- /dev/null
+++  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/BuySellPopup.java	 
Fri Feb 12 08:17:37 2010

@@ -0,0 +1,134 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed 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 com.google.gwt.sample.datawidgets.client;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.sample.datawidgets.shared.StockQuote;
+import com.google.gwt.sample.datawidgets.shared.Transaction;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.DialogBox;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.TextBox;
+
+/**
+ * A popup used for purchasing stock.
+ */
+public class BuySellPopup extends DialogBox {
+
+  private StockQuote quote;
+
+  /**
+   * The table used for layout.
+   */
+  private FlexTable layout = new FlexTable();
+
+  /**
+   * The box used to change the quantity.
+   */
+  private TextBox quantityBox = new TextBox();
+
+  /**
+   * The button used to buy or sell.
+   */
+  private Button opButton;
+
+  /**
+   * True if we are buying, false if hiding.
+   */
+  private boolean isBuying;
+
+  /**
+   * The last transaction.
+   */
+  private Transaction transaction;
+
+  public BuySellPopup() {
+super(false, true);
+setGlassEnabled(true);
+setWidget(layout);
+
+layout.setHTML(0, 0, bTicker:/b);
+layout.setHTML(1, 0, bName:/b);
+layout.setHTML(2, 0, bPrice:/b);
+layout.setHTML(3, 0, bQuantity:/b);
+layout.setWidget(3, 1, quantityBox);
+
+// Buy Button.
+opButton = new Button(, new ClickHandler() {
+  public void onClick(ClickEvent event) {
+try {
+  int quantity = Integer.parseInt(quantityBox.getText());
+  transaction = new Transaction(isBuying, quote.getTicker(),  
quantity);

+  hide();
+} catch (NumberFormatException e) {
+  Window.alert(You must enter a valid quantity);
+}
+  }
+});
+layout.setWidget(4, 0, opButton);
+
+// Cancel Button.
+Button cancelButton = new Button(Cancel, new ClickHandler() {
+  public void onClick(ClickEvent event) {
+hide();
+  }
+});
+layout.setWidget(4, 1, cancelButton);
+  }
+
+  /**
+   * Get the last transaction.
+   *
+   * @return the last transaction, or null if cancelled
+   */
+  public Transaction getTransaction() {
+return transaction;
+  }
+
+  /**
+   * Set the current {...@link StockQuote}.
+   *
+   * @param quote the stock quote to buy
+   * @param isBuying true if buying the stock
+   */
+  public void setStockQuote(StockQuote quote, boolean isBuying) {
+this.quote = quote;
+String op = isBuying ? Buy : Sell;
+setText(op +   + quote.getTicker() +  ( + quote.getName() + ));
+layout.setHTML(0, 1, quote.getTicker());
+layout.setHTML(1, 1, quote.getName());
+layout.setHTML(2, 1, quote.getDisplayPrice());
+quantityBox.setText(0);
+opButton.setText(op);
+this.isBuying = isBuying;
+transaction = null;
+  }
+
+  @Override
+  protected void onLoad() {
+super.onLoad();
+DeferredCommand.addCommand(new Command() {
+  public void execute() {
+quantityBox.selectAll();
+quantityBox.setFocus(true);
+  }
+});
+  }
+}
===
--- /dev/null
+++  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/Transaction.java	 
Fri Feb 12 08:17:37 2010

@@ -0,0 +1,60 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ 

[gwt-contrib] [google-web-toolkit] r7564 committed - Upgrade WebKit's DOM library to use textContent instead of falling bac...

2010-02-12 Thread codesite-noreply

Revision: 7564
Author: knor...@google.com
Date: Thu Feb 11 17:33:08 2010
Log: Upgrade WebKit's DOM library to use textContent instead of falling  
back to the

slow versions of setInnerText and getInnerText.
Review by: jgw

http://gwt-code-reviews.appspot.com/141808/show

http://code.google.com/p/google-web-toolkit/source/detail?r=7564

Modified:
 /trunk/user/src/com/google/gwt/dom/client/DOMImplSafari.java

===
--- /trunk/user/src/com/google/gwt/dom/client/DOMImplSafari.java	Wed Sep  2  
07:58:52 2009
+++ /trunk/user/src/com/google/gwt/dom/client/DOMImplSafari.java	Thu Feb 11  
17:33:08 2010

@@ -168,6 +168,18 @@
 return top;
   }-*/;

+  /*
+   * textContent is used over innerText for two reasons:
+   * 1 - It is consistent with DOMImplMozilla. textContent
+   * does not convert br's to new lines in WebKit.
+   * 2 - textContent is faster on retreival because WebKit
+   * does not recalculate styles as it does for innerText.
+   */
+  @Override
+  public native String getInnerText(Element node) /*-{
+return node.textContent;
+  }-*/;
+
   @Override
   public int getScrollLeft(Document doc) {
 // Safari always applies document scrolling to the body element, even  
in

@@ -215,9 +227,9 @@
* elements, because their descendent elements are only one level deep.
*/
   @Override
-  public native void selectClear(SelectElement select) /*-{
-select.innerText = '';
-  }-*/;
+  public void selectClear(SelectElement select) {
+select.setInnerText();
+  }

   @Override
   public native int selectGetLength(SelectElement select) /*-{
@@ -234,6 +246,14 @@
 select.removeChild(select.children[index]);
   }-*/;

+  /*
+   * See getInnerText for why textContent is used instead of innerText.
+   */
+  @Override
+  public native void setInnerText(Element elem, String text) /*-{
+elem.textContent = text || '';
+  }-*/;
+
   @Override
   public void setScrollLeft(Document doc, int left) {
 // Safari always applies document scrolling to the body element, even  
in


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: PopupPanel.setVisible does not affect glass

2010-02-12 Thread t . broyer

Your tests don't check that the iframe shim attached to the glass
element in IE6/7 is hidden/shown.


http://gwt-code-reviews.appspot.com/143809/diff/1/3
File user/src/com/google/gwt/user/client/ui/PopupPanel.java (right):

http://gwt-code-reviews.appspot.com/143809/diff/1/3#newcode927
Line 927: UIObject.setVisible(glass, visible);
You're hiding the glass element, but not its iframe shim (in IE6/7).
You need to call impl.setVisible *in addition* to hiding/showing the
glass element.

http://gwt-code-reviews.appspot.com/143809

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r7565 committed - Abstracting out PlayerStatus to a separate class and adding the concep...

2010-02-12 Thread codesite-noreply

Revision: 7565
Author: jlaba...@google.com
Date: Fri Feb 12 05:38:22 2010
Log: Abstracting out PlayerStatus to a separate class and adding the  
concept of cash.  Also adds GWT checkstyle to the project and cleans up  
checkstyle errors.


http://code.google.com/p/google-web-toolkit/source/detail?r=7565

Added:
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/server/PlayerStatus.java

Modified:
 /trunk/bikeshed/.project
 /trunk/bikeshed/src/com/google/gwt/cells/client/ButtonCell.java
 /trunk/bikeshed/src/com/google/gwt/cells/client/Cell.java
 /trunk/bikeshed/src/com/google/gwt/cells/client/CheckboxCell.java
 /trunk/bikeshed/src/com/google/gwt/cells/client/CurrencyCell.java
 /trunk/bikeshed/src/com/google/gwt/cells/client/Mutator.java
 /trunk/bikeshed/src/com/google/gwt/cells/client/TextCell.java
 /trunk/bikeshed/src/com/google/gwt/cells/client/TextInputCell.java
 /trunk/bikeshed/src/com/google/gwt/list/client/Column.java
 /trunk/bikeshed/src/com/google/gwt/list/client/PagingTableListView.java
 /trunk/bikeshed/src/com/google/gwt/list/client/SimpleCellList.java
 /trunk/bikeshed/src/com/google/gwt/list/shared/AbstractListModel.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/BuySellPopup.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/DataBackedWidgets.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/client/StockQuoteCell.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/server/StockServiceImpl.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/StockQuote.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/StockRequest.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/StockResponse.java
  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/shared/Transaction.java

 /trunk/bikeshed/war/WEB-INF/web.xml

===
--- /dev/null
+++  
/trunk/bikeshed/src/com/google/gwt/sample/datawidgets/server/PlayerStatus.java	 
Fri Feb 12 05:38:22 2010

@@ -0,0 +1,179 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed 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 com.google.gwt.sample.datawidgets.server;
+
+import java.util.HashMap;
+import java.util.TreeSet;
+
+/**
+ * Game state for a single player.
+ */
+public class PlayerStatus {
+
+  /**
+   * The initial amount of cash that the player starts with, in cents.
+   */
+  private static final int INITIAL_CASH = 1 * 100;
+
+  /**
+   * An impossible stock ticker.
+   */
+  private static final String IMPOSSIBLE_TICKER_SYMBOL = XX;
+
+  /**
+   * The amount of cash that the player has.
+   */
+  private int cash = INITIAL_CASH;
+
+  /**
+   * This players favorite stocks.
+   */
+  private TreeSetString favorites = new TreeSetString();
+
+  /**
+   * The query used to retrieve favorites.
+   */
+  private String favoritesQuery;
+
+  /**
+   * The number of shares owned for each symbol.
+   */
+  private HashMapString, Integer sharesOwnedBySymbol = new  
HashMapString, Integer();

+
+  public PlayerStatus() {
+generateFavoritesQuery();
+  }
+
+  /**
+   * Add a stock to the favorites list.
+   *
+   * @param ticker the stock ticker
+   */
+  public void addFavorite(String ticker) {
+favorites.add(ticker);
+generateFavoritesQuery();
+  }
+
+  /**
+   * Purchase stock.
+   *
+   * @param ticker the stock ticker
+   * @param quantity the number of shares to buy
+   * @param price the price of the stock
+   * @throws IllegalArgumentException if the stock cannot be purchased
+   */
+  public void buy(String ticker, int quantity, int price)
+  throws IllegalArgumentException {
+// Verify that the player can afford the stock.
+int totalPrice = price * quantity;
+if (cash  totalPrice) {
+  throw new IllegalArgumentException(You cannot afford that much  
stock);

+}
+
+// Update the number of shares owned.
+int current = getSharesOwned(ticker);
+cash -= totalPrice;
+current += quantity;
+sharesOwnedBySymbol.put(ticker, current);
+
+// Add this stock to the favorites list.
+addFavorite(ticker);
+  }
+
+  /**
+   * Get the player's current cash amount.
+   *
+   * @return the cash amount
+   */
+  public int getCash() {
+return cash;
+  }
+
+  /**
+   * Get this players favorite query.
+   *
+   * @return the query
+   */
+  public String getFavoritesQuery() {
+return favoritesQuery;
+  }
+
+  /**
+   * Get the number of shares 

[gwt-contrib] [google-web-toolkit] r7566 committed - Edited wiki page through web user interface.

2010-02-12 Thread codesite-noreply

Revision: 7566
Author: jlaba...@google.com
Date: Fri Feb 12 09:42:27 2010
Log: Edited wiki page through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=7566

Modified:
 /wiki/DataBackedWidgetsDesign.wiki

===
--- /wiki/DataBackedWidgetsDesign.wiki  Mon Jan 25 14:48:52 2010
+++ /wiki/DataBackedWidgetsDesign.wiki  Fri Feb 12 09:42:27 2010
@@ -1,37 +1,43 @@
 #summary Design Doc for data backed widgets
 #labels Phase-Design

-wiki:toc max_depth=2 /
+wiki:toc max_depth=3 /

 = Introduction =

 Data backed widgets will replace the FastTree and PagingScrollTable  
widgets in incubator. They will incorporate models and views that  
efficiently display large amounts of data to users.


-= Tables and Lists =
-
-NOTE: This is a work in progress and by no means finalized. Please leave  
comments if you see something that you love or hate.

-
+*NOTE:* This is a work in progress and by no means finalized. Please leave  
comments if you see something that you love or hate.

+
+== Bike Shed ==
+
+We've created a new subdirectory under trunk/ where you can view the data  
backed widget code as we work on it. This directory and the code it  
contains is intended to be highly unstable, so please do not rely on it in  
your applications.

+
+Bike Shed includes a sample application (a stock trading game) that we are  
using to test the design.  You can include the project in Eclipse.

+
+http://code.google.com/p/google-web-toolkit/source/browse/#svn/trunk/bikeshed
+
+
+= Tables and Lists =

 == !ListModel ==

-The ListModel will supply data to tables and lists.  It has one method to  
add ListHandlers, which receive event when data becomes available or is  
updated.

-
-{{{
-/**
- * A model for a list.
- *
- * @param T the data type of records in the list
- */
-public interface ListModelT {
-
-  /**
-   * Add a {...@link ListHandler} to the model.
-   *
-   * @param handler the {...@link ListHandler}
-   */
-  ListRegistration addListHandler(ListHandlerT handler);
-}
-}}}
+[http://code.google.com/p/google-web-toolkit/source/browse/trunk/bikeshed/src/com/google/gwt/list/shared/ListModel.java  
ListModel]  
will supply data to tables and lists.  It has one method to add  
ListHandlers, which receive event when data becomes available or is updated.

+
+=== !AbstractListModel ===
+
+[http://code.google.com/p/google-web-toolkit/source/browse/trunk/bikeshed/src/com/google/gwt/list/shared/AbstractListModel.java  
AbstractListModel]  
provides a default implementation of ListModel with  
convenience methods for pushing data to the Views.  In particular,  
{{{updateDataSize}}} and {{{updateViewData}}} allow you to forward new data  
to the Views using data such as an RPC result.

+
+=== !ListListModel ===
+
+[http://code.google.com/p/google-web-toolkit/source/browse/trunk/bikeshed/src/com/google/gwt/list/shared/ListListModel.java  
ListListModel]  
is a concrete ListModel backed by a List.  Any changes to  
the internal list, which can be accessed via {{{getList()}}} will be  
reflected in the model and forwarded to the views.

+
+We use a DeferredCommand to ensure that the Views aren't spammed if you  
are performing multiple List operations in a single event loop.

+
+=== !AsyncListModel ===
+
+[http://code.google.com/p/google-web-toolkit/source/browse/trunk/bikeshed/src/com/google/gwt/list/shared/AsyncListModel.java  
AsyncListModel]  
is a concrete class that links to an asynchronous  
DataSource.  It allows you to connect the model to an application level  
controller that uses RPC requests to fetch data.

+

 == !ListHandler ==

@@ -85,10 +91,6 @@
 }}}


-== !AbstractListModel ==
-
-We will provide an AbstractListModel that takes care of the grunt work  
involved with managing and updating views.  Most users will only need to  
specify how to get the data from the backend.

-
 = Trees =

 We'll be working on this next...

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r7567 committed - Edited wiki page through web user interface.

2010-02-12 Thread codesite-noreply

Revision: 7567
Author: jlaba...@google.com
Date: Fri Feb 12 09:53:47 2010
Log: Edited wiki page through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=7567

Modified:
 /wiki/DataBackedWidgetsDesign.wiki

===
--- /wiki/DataBackedWidgetsDesign.wiki  Fri Feb 12 09:42:27 2010
+++ /wiki/DataBackedWidgetsDesign.wiki  Fri Feb 12 09:53:47 2010
@@ -1,13 +1,14 @@
 #summary Design Doc for data backed widgets
 #labels Phase-Design

+*NOTE:* This is a work in progress and by no means finalized. Please leave  
comments if you see something that you love or hate.

+
 wiki:toc max_depth=3 /

 = Introduction =

 Data backed widgets will replace the FastTree and PagingScrollTable  
widgets in incubator. They will incorporate models and views that  
efficiently display large amounts of data to users.


-*NOTE:* This is a work in progress and by no means finalized. Please leave  
comments if you see something that you love or hate.


 == Bike Shed ==

@@ -18,6 +19,20 @@
  
http://code.google.com/p/google-web-toolkit/source/browse/#svn/trunk/bikeshed



+
+= Cells =
+
+[http://code.google.com/p/google-web-toolkit/source/browse/trunk/bikeshed/src/com/google/gwt/cells/client/Cell.java  
Cells]  
are the basic blocks used to render the View and interpret events.   
Cells are typed based on the type of data that the cell represents, and  
they must implement a {{{render}}} method that renders the typed value as  
an HTML string.  In addition, cells can override {{{onBrowserEvent}}} to  
act as a flyweight that handles events that are fired on elements that were  
rendered by the cell.

+
+
+== Mutators ==
+
+Cells can be associated with a  
[http://code.google.com/p/google-web-toolkit/source/browse/trunk/bikeshed/src/com/google/gwt/cells/client/Mutator.java  
Mutator] that allows the cell to modify an Object in response to an event  
fired on a rendered Cell.

+
+For example, in a table that represents object R (the row value), there  
may be multiple cells, each with a different type that represents a field  
in R.  The first column could use a  
[http://code.google.com/p/google-web-toolkit/source/browse/trunk/bikeshed/src/com/google/gwt/cells/client/CheckboxCell.java  
CheckboxCell] to render check boxes based on some boolean inside of R.   
When the user clicks on one of the check boxes, CheckboxCell can inform the  
application controller that a certain field in R has been set to true or  
false.

+
+
+
 = Tables and Lists =

 == !ListModel ==
@@ -91,10 +106,13 @@
 }}}


+
 = Trees =

 We'll be working on this next...

+
+
 = !TreeTables =

 We'll tackle this beast later...

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] SameParameterValueOptimizer should ignore methods called from native code.

2010-02-12 Thread mike . aizatsky

Reviewers: Lex,

Message:
Lex,

Please review.

Description:
SameParameterValueOptimizer should ignore methods called from native
code.

Please review this at http://gwt-code-reviews.appspot.com/141812

Affected files:
  M  
dev/core/src/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizer.java
  M  
dev/core/test/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizerTest.java



Index:  
dev/core/src/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizer.java
diff --git  
a/dev/core/src/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizer.java  
b/dev/core/src/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizer.java
index  
c22d483e43da32c220f52633b2b0594ee45f3cba..bdbf664616d1f68f92fa5c138c6940bf37d3483b  
100644
---  
a/dev/core/src/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizer.java
+++  
b/dev/core/src/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizer.java

@@ -29,6 +29,8 @@ import com.google.gwt.dev.jjs.ast.JPrefixOperation;
 import com.google.gwt.dev.jjs.ast.JProgram;
 import com.google.gwt.dev.jjs.ast.JValueLiteral;
 import com.google.gwt.dev.jjs.ast.JVisitor;
+import com.google.gwt.dev.jjs.ast.js.JsniMethodBody;
+import com.google.gwt.dev.jjs.ast.js.JsniMethodRef;

 import java.util.HashSet;
 import java.util.IdentityHashMap;
@@ -103,6 +105,13 @@ public class SameParameterValueOptimizer {
 }

 @Override
+public void endVisit(JsniMethodBody x, Context ctx) {
+  for (JsniMethodRef methodRef : x.getJsniMethodRefs()) {
+rescuedMethods.add(methodRef.getTarget());
+  }
+}
+
+@Override
 public boolean visit(JMethod x, Context ctx) {
   SetJMethod overrides = program.typeOracle.getAllOverrides(x);
   if (!overrides.isEmpty()) {
Index:  
dev/core/test/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizerTest.java
diff --git  
a/dev/core/test/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizerTest.java  
b/dev/core/test/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizerTest.java
index  
036d71a2daa0362c76bfb294524d58cd2e99b114..196894be93c4fcd7ee7cea023d722bfe99c6cbae  
100644
---  
a/dev/core/test/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizerTest.java
+++  
b/dev/core/test/com/google/gwt/dev/jjs/impl/SameParameterValueOptimizerTest.java
@@ -52,6 +52,21 @@ public class SameParameterValueOptimizerTest extends  
OptimizerTestBase {

   int j = 1;, });
   }

+  public void testJsniReferenceSaveMethod() throws Exception {
+addSnippetClassDecl(
+public static native void someStaticMethod() /*-{ +
+  var foo = @test.EntryPoint::foo(Ljava/lang/String;) +
+}-*/);
+
+assertOptimize(
+foo,
+static void foo(String s) { String p = s; },
+foo(\\); foo(\\);).into(
+public static void foo(String s){,
+  String p = s;,
+});
+  }
+
   private OptimizationResult assertOptimize(String methodName,
   String methodDecl, String codeSnippet) throws  
UnableToCompleteException {

 addSnippetClassDecl(methodDecl);


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: SameParameterValueOptimizer should ignore methods called from native code.

2010-02-12 Thread spoon

LGTM


http://gwt-code-reviews.appspot.com/141812

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] RFC: sharded linking

2010-02-12 Thread Matt Mastracci
On 2010-02-12, at 1:15 PM, Ray Cromwell wrote:

 On Thu, Feb 11, 2010 at 4:43 PM, Scott Blum sco...@google.com wrote:

 - I dislike the whole transition period followed by having to forcibly
 update all linkers, unless there's a really compelling reason to do so.
 
 In general, I'd agree, but the number of linkers in the wild appears
 to be small, this may be a case of trying to preserve an API that only
 5 or 10 people in the world are using.

+1. I've written a handful of custom linkers (including one in the public 
gwt-firefox-extension project), but I'm used to updating them between GWT 
releases to work around subtle changes in the linker contract (ie: the 
evolution of hosted mode, various global variable changes, etc).  

I'd rather have a clean linker system that changes from version to version than 
an awkward one with a lot of legacy interfaces.

Matt.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] conditional linkers and the primary.linker property

2010-02-12 Thread spoon

Reviewers: robertvawter,

Description:
This patch adds a way that deferred bindings can be differ depending
on the choice of primary linker.  This general functionality is
necessary to get runAsync working for the cross-site linker, because
doing so requires compiler rewrites that do not apply to the standard
linker.

After discussing the problem with Bob, a good-looking strategy is to
have the add-linker tag take conditions as an argument.  For example,
it could look like this:

  add-linker name=xs
when-property-is name=primary.linker value=xs /
  /add-linker


This tag adds the xs linker if and only if the primary.linker is set
for all permutations.

To help users understand how this works, if they try to enable a
linker for some but not all permutations, an error message is emitted.
An example error message is as follows:

  Linker 'xs' is enabled for some permutations but not all of them


In addition to allawing linkers to be added conditionally, the
recommended way to set a primary linker will change.  Currently, users
do this:

  !-- DEPRECATED --
  add-linker name=xs /


The new style is like this:

  set-property name=primary.linker value=xs /


The old style will still work for any application it already works
for, but will be deprecated.  An example deprecation message is as
follows:


  [WARN] Linker 'test1' is primary but was not added via primary.linker
Instead of add-linker, use: set-property name='primary.linker'
value='test1' /
If that doesn't work, contact the linker's maintainer



IMPLEMENTATION

ModuleDef used to have a list of linker classes that build up as the
module is parsed.  Now, it has a list of conditional linkers.  Once
parsing is complete, ModuleDef.finalizeLinkers should be called, which
makes the final choice of which linkers are enabled.


Please review this at http://gwt-code-reviews.appspot.com/143811

Affected files:
  dev/core/src/com/google/gwt/dev/cfg/Condition.java
  dev/core/src/com/google/gwt/dev/cfg/ConditionAll.java
  dev/core/src/com/google/gwt/dev/cfg/ConditionAny.java
  dev/core/src/com/google/gwt/dev/cfg/ConditionNone.java
  dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
  dev/core/src/com/google/gwt/dev/cfg/ModuleDefLoader.java
  dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
  dev/core/test/com/google/gwt/dev/cfg/ConditionTest.java
  dev/core/test/com/google/gwt/dev/cfg/ModuleDefTest.java
  user/src/com/google/gwt/core/Core.gwt.xml
  user/src/com/google/gwt/core/SsoLinker.gwt.xml
  user/src/com/google/gwt/core/StdLinker.gwt.xml
  user/src/com/google/gwt/core/XSLinker.gwt.xml
  user/test/com/google/gwt/core/ext/IFrameLinkerTest.gwt.xml
  user/test/com/google/gwt/core/ext/SingleScriptLinkerTest.gwt.xml
  user/test/com/google/gwt/core/ext/XSLinkerTest.gwt.xml
  user/test/com/google/gwt/dev/cfg/LinkerTagsTest.gwt.xml
  user/test/com/google/gwt/dev/cfg/LinkerTagsTest.java
  user/test/com/google/gwt/dev/cfg/LinkerTagsTestBadA.gwt.xml
   
user/test/com/google/gwt/dev/cfg/LinkerTagsTestUnconditionalPrimary.gwt.xml

  user/test/com/google/gwt/dev/cfg/PropertyTest.gwt.xml
  user/test/com/google/gwt/dev/cfg/TagSuite.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: GFlow cleanup

2010-02-12 Thread spoon

I can't review the changes right this moment, but I have added this
patch to the gflow branch for convenience.


http://gwt-code-reviews.appspot.com/143812

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] Re: RFC: sharded linking

2010-02-12 Thread Lex Spoon
On Fri, Feb 12, 2010 at 9:50 AM, Alex Moffat alex.mof...@gmail.com wrote:

 Where can I read a description of what -XshardPrecompile, or see the
 code for it, it sounds very useful to me personally?


-XshardPrecompile is an experiment that everyone wants to change, so it
seems unlikely to be released in its current form.  We can talk about it if
it helps, but I would propose that we focus more on what we want to do for
real.



 It's not in 2.0.0
 as far as I can see. My concerns about the sharded linking proposal
 came from what I understood the original flow to be from my looking at
 it and from the original sharded linkin proposal.


Your understanding is correct as far as I can tell.

Lex

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Re: RFC: sharded linking

2010-02-12 Thread Lex Spoon
On Thu, Feb 11, 2010 at 8:58 PM, Brendan Kenny bcke...@gmail.com wrote:

 If this is indeed the direction to go in (and I'm a big fan of the
 goals as well), it's probably also worth making a more formal
 definition for won't step on each other's toes. As a use case, I'm
 working on a PRE linker that (currently) removes CompilationResults,
 alters them based on information collected from across all
 permutations, and then emits new ones. Obviously this isn't ideal--its
 expensive and CompilationResults were written to be (mostly)
 immutable--but it's also perfectly acceptable within the current
 design of the artifactSet/linker chain. The primary linker only cares
 about the set of compilation results it receives, and if an earlier
 linker altered them, it need never know.


Hey, Brendan, it sounds like you are already pressing the limits of what is
doable with linkers.Can you describe in more detail what this linker
accomplishes?

For this linker to be used in distributed builds, I believe you'd really
want to come up with a way to do the JS rewrites on the sharded part.
 Otherwise, the final link node is going to have to do the JS rewrites for
the whole build sequentially.  What exact information is used as input to
the rewrites?



 It seems (and I could definitely be misinterpreting here) that in both
 the simulated sharding procedure and Scott's alternate proposal, there
 will be sections of primary and post linkers running before a non-
 shardable pre linker. If that's true, then neither will be able to
 fully honor the ordering of linkers when shardable and non-shardable
 linkers are mixed.


That's a large part of why I suggested that we phase out non-sharded
linkers.  In mixed mode, there isn't a perfect ordering to choose.  With all
sharded linkers, the order is simple and predictable.  All sharded parts run
before all final parts, and within either of those groups, PRE/PRIMARY/POST
are respected.



 Continuing to think out loud, it seems that the way to alter my linker
 is probably either to statically derive what all permutations will
 need in every shard (as opposed to just having each triggered
 generator emit an artifact and collecting them at the end), or keeping
 that the same and creating a custom primary linker, which I was hoping
 not to do as it would tend to limit adoption.



It might help to know that both generators and linkers have access to the
full set of *possible* values of a deferred binding, not just the values for
the current permutation.  As an example, the LocaleListLinker reads off all
possible values of locale and generates a file containing them:

http://code.google.com/p/google-web-toolkit-incubator/source/browse/trunk/src/com/google/gwt/libideas/linker/LocaleListLinker.java



Lex

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] RFC: sharded linking

2010-02-12 Thread Lex Spoon
On Thu, Feb 11, 2010 at 7:43 PM, Scott Blum sco...@google.com wrote:

 I have a few comments, but first I wanted to raise the point that I'm not
 sure why we're having this argument about maximally sharded Precompiles at
 all.  For one thing, it's already implemented, and optional, via
 -XshardPrecompile.  I can't think of any reason to muck with this, or why
 it would have any relevance to sharded linking.  Can we just table that part
 for now, or is there something I'm missing?


There are still two modes, but there's no more need for an explicit
argument.  For Compiler, precompile is never sharded.  For the three-stage
entry points, full sharding happens iff all linkers are shardable.



 - I'm not sure why development mode wouldn't run a sharded link first.
  Wouldn't it make sense if development mode works just like production
 compile, it just runs a single development mode permutation shard link
 before running the final link?


Sure, we can do that. Note, though, that they will be running against an
empty ArtifactSet, because there aren't any compiles for them to look at.
 Thus, they won't typically do anything.



 2) Instead of trying to do automatic thinning, we just let the linkers
 themselves do the thinning.  For example, one of the most
 serialization-expensive things we do is serialize/deserialze symbolMaps.  To
 avoid this, we update SymbolMapsLinker to do most of its work during
 sharding, and update IFrameLinker (et al) to remove the CompilationResult
 during the sharded link so it never gets sent across to the final link.


In addition to the other issues pointed out, note that this adds ordering
constraints among the linkers.  Any linker that deletes something must run
after every linker that wants to look at it.  Your example wouldn't work as
is, because it would mean no POST linker can look at CompilationResults.  It
also wouldn't work to put the deletion in a POST linker, for the same
reason.  We'd have to work out a way for the deletions to happen last, after
all the normal linkage activity.

Suppose, continuing that idea, we add a POSTPOST order that is used only for
deletion.  If it's really only for deletion, then the usual link() API is
overly general, because it lets linkers both add and remove artifacts during
POSTPOST, which is not desired.  So, we want a POSTPOST API that is only for
deletion.  Linkers somehow or another mark artifacts for deletion, but not
anything else.  At this point, though, isn't it pretty much the same as the
automated thinning in the initial proposal?


 The pros to this idea are (I think) that you don't break anyone... instead
you
 opt-in to the optimization.  If you don't do anything, it should still
work, but
 maybe slower than it could.

The proposal that started this thread also does not break anyone.

Lex

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors