[gwt-contrib] Re: Comment on DataBackedWidgetsDesign in google-web-toolkit
Comment by johan.rydberg: Is there really a need for bulk-like renders? Isn't it better to just render the rows visible on the screen? For more information: http://code.google.com/p/google-web-toolkit/wiki/DataBackedWidgetsDesign -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Generated widget markup
Dear all! i was surprised, even disappointed, when i realized how GWT (ab)uses html tables. For instance the vertical panel and the tree widget ARE html tables. why it is so?? should not it be much better just to use a list of DIVs (or even a UL) for the vertical panel and nested ULs for the tree?? i mean, in the days of HTML5, CSS3, ria, and so on... semantically correct markup is a MUST BE. well, perhaps there is a really good reason behind it... so i would be really happy if somebody could help me to understand the idea... or has somebody already written semantic widgets and wants to share them ;) thanks Michael PS: i was just thinking that a tree item could have been composed by a vertical panel, so if i implement the vertical panel as an UL i would get automagically a nested ULs tree, but it is not :( but i think that is what i will do now :) PS2: i think code like http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/client/ui/Tree.java#945: DOM.setStyleAttribute(getElement(), "zoom", "1"); should also better go in a TreeImplIE class as in http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/client/ui/TreeItem.java#99: /** * IE specific implementation class for {...@link TreeItem}. */ public static class TreeItemImplIE6 extends TreeItemImpl { @Override void convertToFullNode(TreeItem item) { super.convertToFullNode(item); DOM.setStyleAttribute(item.getElement(), "marginBottom", "0px"); } } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Generated widget markup
sorry wrong list ;) On Mar 12, 2:17 pm, mmoossen wrote: > Dear all! > > i was surprised, even disappointed, when i realized how GWT (ab)uses > html tables. > For instance the vertical panel and the tree widget ARE html tables. > why it is so?? > should not it be much better just to use a list of DIVs (or even a UL) > for the vertical panel and nested ULs for the tree?? > i mean, in the days of HTML5, CSS3, ria, and so on... semantically > correct markup is a MUST BE. > > well, perhaps there is a really good reason behind it... > > so i would be really happy if somebody could help me to understand the > idea... > or has somebody already written semantic widgets and wants to share > them ;) > > thanks > Michael > > PS: i was just thinking that a tree item could have been composed by a > vertical panel, so if i implement the vertical panel as an UL i would > get automagically a nested ULs tree, but it is not :( > but i think that is what i will do now :) > > PS2: i think code > likehttp://code.google.com/p/google-web-toolkit/source/browse/trunk/user/... > DOM.setStyleAttribute(getElement(), "zoom", "1"); > > should also better go in a TreeImplIE class as > inhttp://code.google.com/p/google-web-toolkit/source/browse/trunk/user/... > /** > * IE specific implementation class for {...@link TreeItem}. > */ > public static class TreeItemImplIE6 extends TreeItemImpl { > @Override > void convertToFullNode(TreeItem item) { > super.convertToFullNode(item); > DOM.setStyleAttribute(item.getElement(), "marginBottom", "0px"); > } > } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Re: One-line fix to SelectionScript's fallback logic for
2010/3/11 Miguel Méndez > +1 to Ray's question. I know that you were simply doing a fix Lex, but we > need to think about how we test these "features". > I agree. I'll work out a test. -Lex -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7706 committed - Reduce requests to finance server...
Revision: 7706 Author: r...@google.com Date: Thu Mar 11 09:45:33 2010 Log: Reduce requests to finance server Highlight search terms in stock names Clean up some regex handling Fix checkstyle problems Merge with Joel's changes http://code.google.com/p/google-web-toolkit/source/detail?r=7706 Added: /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/HighlightingTextCell.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/GoogleFinance.java Modified: /trunk/bikeshed/.classpath /trunk/bikeshed/src/com/google/gwt/bikeshed/cells/client/EllipsisCell.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/StockSample.gwt.xml /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/Columns.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/FavoritesWidget.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockQueryWidget.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockSample.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/common.css /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/StockServiceImpl.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/Stocks.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/shared/StockQuote.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/shared/StockRequest.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/domain/RelationshipValidationVisitor.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRequests.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/shared/ReportRequests.java /trunk/bikeshed/test/com/google/gwt/sample/expenses/domain/StorageTest.java /trunk/bikeshed/war/Stocks.css === --- /dev/null +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/HighlightingTextCell.java Thu Mar 11 09:45:33 2010 @@ -0,0 +1,73 @@ +/* + * 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.bikeshed.sample.stocks.client; + +import com.google.gwt.bikeshed.cells.client.Cell; +import com.google.gwt.regexp.shared.MatchResult; +import com.google.gwt.regexp.shared.RegExp; + +/** + * A {...@link Cell} used to render text, with portions matching a given + * regular expression highlighted. + */ +public class HighlightingTextCell extends Cell { + + private String highlightRegex; + + @Override + public void render(String value, StringBuilder sb) { +sb.append(""); +if (highlightRegex == null || highlightRegex.length() == 0) { + sb.append(value); + sb.append(""); + return; +} + +RegExp regExp = RegExp.compile(highlightRegex, "gi"); +int fromIndex = 0; +int length = value.length(); +MatchResult result; +while (fromIndex < length) { + // Find the next match of the highlight regex + result = regExp.exec(value); + if (result == null) { +// No more matches +break; + } + int index = result.getIndex(); + String match = result.getGroup(0); + + // Append the characters leading up to the match + sb.append(value.substring(fromIndex, index)); + // Append the match in boldface + sb.append(""); + sb.append(match); + sb.append(""); + // Skip past the matched string + fromIndex = index + match.length(); + regExp.setLastIndex(fromIndex); +} +// Append the tail of the string +if (fromIndex < length) { + sb.append(value.substring(fromIndex)); +} +sb.append(""); + } + + public void setHighlightRegex(String highlightRegex) { +this.highlightRegex = highlightRegex; + } +} === --- /dev/null +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/GoogleFinance.java Thu Mar 11 09:45:33 2010 @@ -0,0 +1,105 @@ +/* + * 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 +
[gwt-contrib] [google-web-toolkit] r7707 committed - Cleaned up tables on firefox; added split handle styles for later use.
Revision: 7707 Author: j...@google.com Date: Thu Mar 11 10:09:28 2010 Log: Cleaned up tables on firefox; added split handle styles for later use. http://code.google.com/p/google-web-toolkit/source/detail?r=7707 Added: /trunk/bikeshed/war/hsplitter-grip.png /trunk/bikeshed/war/vsplitter-grip.png Modified: /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/FavoritesWidget.ui.xml /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockQueryWidget.ui.xml /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/common.css /trunk/bikeshed/war/Stocks.css === --- /dev/null +++ /trunk/bikeshed/war/hsplitter-grip.png Thu Mar 11 10:09:28 2010 @@ -0,0 +1,6 @@ +‰PNG + + +IHDR Uþ·$tEXtSoftware Adobe ImageReadyqÉe< ]IDATxÚbËyòá÷ÿ• oü Ñp{¬õUPíaüÿÿ? %ö° +½x Ó? { @> Â" /Ø ? +ýIEND®B`‚ === --- /dev/null +++ /trunk/bikeshed/war/vsplitter-grip.png Thu Mar 11 10:09:28 2010 @@ -0,0 +1,5 @@ +‰PNG + + +IHDR q†4WtEXtSoftware Adobe ImageReadyqÉe< >IDATxÚb +# 8zñ Ñò, †¶’ ƒŒ +†BˆbâäÁ \ ¸0)òÇ€X rã+wIEND®B`‚ === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/FavoritesWidget.ui.xml Thu Mar 11 08:39:56 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/FavoritesWidget.ui.xml Thu Mar 11 10:09:28 2010 @@ -13,7 +13,9 @@ - styleName='{common.table}'/> + +styleName='{common.table}'/> + === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockQueryWidget.ui.xml Thu Mar 11 08:39:56 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockQueryWidget.ui.xml Thu Mar 11 10:09:28 2010 @@ -9,11 +9,16 @@ - Enter query: + +Enter query: + + - styleName='{common.table}'/> + +styleName='{common.table}'/> + === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/common.css Thu Mar 11 09:45:33 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/common.css Thu Mar 11 10:09:28 2010 @@ -27,7 +27,7 @@ } .table { - width: 100%; + width: 95%; font-size: 8pt; border-spacing: 0px 0px; border-collapse: collapse; === --- /trunk/bikeshed/war/Stocks.css Thu Mar 11 09:45:33 2010 +++ /trunk/bikeshed/war/Stocks.css Thu Mar 11 10:09:28 2010 @@ -80,3 +80,11 @@ margin-bottom: 0.5em; border-bottom: 1px solid #ccc; } + +.gwt-SplitLayoutPanel-HDragger { + background: transparent url(hsplitter-grip.png) center center no-repeat; +} + +.gwt-SplitLayoutPanel-VDragger { + background: transparent url(vsplitter-grip.png) center center no-repeat; +} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on DataBackedWidgetsDesign in google-web-toolkit
Comment by j...@google.com: @johan: The short answer is yes. Here's the reason: What's visible on the screen can easily be ~20x50 cells in a table, and that can be surprisingly slow to render using individual calls to td.setInnerHTML(), and even worse if you're using entire widgets and the bookkeeping that entails. For example, if you look at the AdWords Campaign Management UI, they've had to do a fair amount of work to optimize their table rendering, using a similar approach. We're working hard to codify it in a way that makes the fastest thing the *easiest* thing, which frees up cycles to do other work. The code in /bikeshed is all over the map right now, as we experiment with different ideas, but we're settling on a "cell" abstraction that looks like it's going to work out really well in practice. For more information: http://code.google.com/p/google-web-toolkit/wiki/DataBackedWidgetsDesign -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7708 committed - Allow skipping a test case in development mode or production mode....
Revision: 7708 Author: sp...@google.com Date: Thu Mar 11 10:58:55 2010 Log: Allow skipping a test case in development mode or production mode. http://gwt-code-reviews.appspot.com/171801 Review by: amitmanjhi http://code.google.com/p/google-web-toolkit/source/detail?r=7708 Modified: /trunk/user/src/com/google/gwt/junit/JUnitShell.java /trunk/user/src/com/google/gwt/junit/Platform.java /trunk/user/test/com/google/gwt/junit/client/GWTTestCaseTest.java === --- /trunk/user/src/com/google/gwt/junit/JUnitShell.java Wed Mar 3 07:09:08 2010 +++ /trunk/user/src/com/google/gwt/junit/JUnitShell.java Thu Mar 11 10:58:55 2010 @@ -1116,9 +1116,23 @@ private boolean mustNotExecuteTest(Set bannedPlatforms) { // TODO (amitmanjhi): Remove this hard-coding. A RunStyle somehow needs to // specify how it interacts with the platforms. -return runStyle instanceof RunStyleHtmlUnit -&& (bannedPlatforms.contains(Platform.HtmlUnitBug) -|| bannedPlatforms.contains(Platform.HtmlUnit)); +if (runStyle instanceof RunStyleHtmlUnit +&& (bannedPlatforms.contains(Platform.HtmlUnitBug) || bannedPlatforms.contains(Platform.HtmlUnit))) { + return true; +} + +if (developmentMode) { + if (bannedPlatforms.contains(Platform.Devel)) { +return true; + } +} else { + // Prod mode + if (bannedPlatforms.contains(Platform.Prod)) { +return true; + } +} + +return false; } private boolean mustRetry(int numTries) { === --- /trunk/user/src/com/google/gwt/junit/Platform.java Thu Feb 25 06:57:14 2010 +++ /trunk/user/src/com/google/gwt/junit/Platform.java Thu Mar 11 10:58:55 2010 @@ -22,6 +22,8 @@ * between HtmlUnit and non-HtmlUnit platforms. */ public enum Platform { + Devel, HtmlUnitBug, - HtmlUnit -} + HtmlUnit, + Prod, +} === --- /trunk/user/test/com/google/gwt/junit/client/GWTTestCaseTest.java Thu Feb 25 06:57:14 2010 +++ /trunk/user/test/com/google/gwt/junit/client/GWTTestCaseTest.java Thu Mar 11 10:58:55 2010 @@ -24,6 +24,7 @@ import static com.google.gwt.junit.client.GWTTestCaseTest.SetUpTearDownState.IS_SETUP; import static com.google.gwt.junit.client.GWTTestCaseTest.SetUpTearDownState.IS_TORNDOWN; +import com.google.gwt.core.client.GWT; import com.google.gwt.junit.DoNotRunWith; import com.google.gwt.junit.Platform; import com.google.gwt.user.client.Timer; @@ -366,13 +367,29 @@ fail("Unexpected exception during assertTrue(String, boolean) testing"); } - /* + /** * Just setting the htmlunit mode. */ @DoNotRunWith(Platform.HtmlUnitBug) public void testSetRetry() { htmlunitMode = false; } + + /** + * Test skipping a test for dev mode. + */ + @DoNotRunWith(Platform.Devel) + public void testPlatformDevel() { +assertTrue("Should not run in devel mode", GWT.isScript()); + } + + /** + * Test skipping a test for prod mode. + */ + @DoNotRunWith(Platform.Prod) + public void testPlatformProd() { +assertTrue("Should not run in prod mode", !GWT.isScript()); + } /* * This test MUST appear after testSetRetry(). -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7709 committed - reverting r5487 that was just for diagnostics...
Revision: 7709 Author: amitman...@google.com Date: Thu Mar 11 11:04:12 2010 Log: reverting r5487 that was just for diagnostics Patch by: amitmanjhi Review by: scottb, jat http://code.google.com/p/google-web-toolkit/source/detail?r=7709 Modified: /trunk/user/src/com/google/gwt/i18n/client/Dictionary.java /trunk/user/test/com/google/gwt/i18n/client/I18NTest.java === --- /trunk/user/src/com/google/gwt/i18n/client/Dictionary.java Fri Nov 20 08:57:58 2009 +++ /trunk/user/src/com/google/gwt/i18n/client/Dictionary.java Thu Mar 11 11:04:12 2010 @@ -102,7 +102,6 @@ null, name); } - private JavaScriptObject accessedKeys; private JavaScriptObject dict; private String label; @@ -124,13 +123,8 @@ "Cannot find JavaScript object with the name '" + name + "'", name, null); } -createAccessedKeysArray(); } - private native void createAccessedKeysArray() /*-{ -th...@com.google.gwt.i18n.client.dictionary::accessedKeys = new Array(); - }-*/; - /** * Get the value associated with the given Dictionary key. * @@ -147,12 +141,6 @@ key = String(key); var map = th...@com.google.gwt.i18n.client.dictionary::dict; var value = map[key]; -var keys = th...@com.google.gwt.i18n.client.dictionary::accessedKeys; -keys.unshift(key); -// only keep the last 30 elements. Shrink it when array exceeds 60 -if (keys.length > 60) { - keys.splice(30); -} if (value == null || !map.hasOwnProperty(key)) { th...@com.google.gwt.i18n.client.dictionary::resourceError(Ljava/lang/String;)(key); } @@ -192,7 +180,6 @@ if (s.size() < MAX_KEYS_TO_SHOW) { error += "\n keys found: " + s; } -error += "\n accessed keys: " + accessedKeys; throw new MissingResourceException(error, this.toString(), key); } === --- /trunk/user/test/com/google/gwt/i18n/client/I18NTest.java Thu Feb 25 10:33:31 2010 +++ /trunk/user/test/com/google/gwt/i18n/client/I18NTest.java Thu Mar 11 11:04:12 2010 @@ -430,46 +430,6 @@ assertTrue(s.contains("a")); assertTrue(s.contains("b")); assertFalse(s.contains("c")); -String nonExistentKey = "nonExistentKey"; -try { - d.get(nonExistentKey); - fail("should have thrown a MissingResourceException"); -} catch (MissingResourceException ex) { - assertTrue(ex.getMessage(), ex.getMessage().indexOf( - "accessed keys: " + nonExistentKey + ",d,formattedMessage") != -1); -} - -/* - * verify that accessedKeys maintains at least the last 30 entries in the - * correct order. Steps involved: (i) create expectedKeys array, (ii) access - * the dictionary, (iii) confirm that accessedKeys is maintained correctly. - */ -// expectedKeys: nonExistentKey, 9 a's, 9 b's, 9 d's, 2 formattedMessage's -StringBuffer expectedKeys = new StringBuffer(); -expectedKeys.append(nonExistentKey); -for (String key : new String[] {"a", "b", "d"}) { - for (int i = 0; i < 9; i++) { -expectedKeys.append(","); -expectedKeys.append(key); - } -} -expectedKeys.append(",formattedMessage,formattedMessage"); -// access 360 keys. last 30 should match expectedKeys -for (int i = 0; i < 10; i++) { - for (String key : new String[] {"formattedMessage", "d", "b", "a"}) { -for (int j = 0; j < 9; j++) { - d.get(key); -} - } -} -try { - d.get(nonExistentKey); - fail("should have thrown a MissingResourceException"); -} catch (MissingResourceException ex) { - assertTrue(ex.getMessage(), ex.getMessage().indexOf( - "accessed keys: " + expectedKeys.toString()) != -1); -} - Collection s2 = d.values(); assertTrue(s2.contains("A")); assertTrue(s2.contains("B")); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7710 committed - Implement actions/history in the browser
Revision: 7710 Author: r...@google.com Date: Thu Mar 11 11:11:10 2010 Log: Implement actions/history in the browser http://code.google.com/p/google-web-toolkit/source/detail?r=7710 Modified: /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/BuySellPopup.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockQueryWidget.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockSample.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/TransactionTreeViewModel.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/Updater.java === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/BuySellPopup.java Fri Feb 26 10:28:42 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/BuySellPopup.java Thu Mar 11 11:11:10 2010 @@ -35,17 +35,27 @@ */ public class BuySellPopup extends DialogBox { - private StockQuote quote; + + private static final int TICKER = 0; + private static final int NAME = 1; + private static final int PRICE = 2; + private static final int MAX_QUANTITY = 3; + private static final int QUANTITY = 4; + private static final int TOTAL = 5; + private static final int AVAILABLE = 6; + private static final int BUTTONS = 7; + + private int cash; /** - * The table used for layout. + * True if we are buying, false if hiding. */ - private FlexTable layout = new FlexTable(); + private boolean isBuying; /** - * The box used to change the quantity. + * The table used for layout. */ - private TextBox quantityBox = new TextBox(); + private FlexTable layout = new FlexTable(); /** * The button used to buy or sell. @@ -53,9 +63,11 @@ private Button opButton; /** - * True if we are buying, false if hiding. + * The box used to change the quantity. */ - private boolean isBuying; + private TextBox quantityBox = new TextBox(); + + private StockQuote quote; /** * The last transaction. @@ -67,24 +79,26 @@ setGlassEnabled(true); setWidget(layout); -layout.setHTML(0, 0, "Ticker:"); -layout.setHTML(1, 0, "Name:"); -layout.setHTML(2, 0, "Price:"); -layout.setHTML(3, 0, "Quantity:"); -layout.setWidget(3, 1, quantityBox); -layout.setHTML(4, 0, "Total:"); -layout.setHTML(5, 0, "Available:"); +layout.setHTML(TICKER, 0, "Ticker:"); +layout.setHTML(NAME, 0, "Name:"); +layout.setHTML(PRICE, 0, "Price:"); +layout.setHTML(MAX_QUANTITY, 0, "Max Quantity:"); +layout.setHTML(QUANTITY, 0, "Quantity:"); +layout.setWidget(QUANTITY, 1, quantityBox); +layout.setHTML(TOTAL, 0, "Total:"); +layout.setHTML(AVAILABLE, 0, "Available:"); // Update total price when the quantity changes. quantityBox.addKeyUpHandler(new KeyUpHandler() { public void onKeyUp(KeyUpEvent event) { try { - int quantity = Integer.parseInt(quantityBox.getText()); + String text = quantityBox.getText(); + int quantity = text.length() == 0 ? 0 : Integer.parseInt(text); double totalPrice = quantity * quote.getPrice() / 100.0; - layout.setText(4, 1, NumberFormat.getCurrencyFormat("USD").format( + layout.setText(TOTAL, 1, NumberFormat.getCurrencyFormat("USD").format( totalPrice)); } catch (NumberFormatException e) { - layout.setText(4, 1, "Invalid quantity"); + layout.setText(TOTAL, 1, "Invalid quantity"); } } }); @@ -101,7 +115,7 @@ } } }); -layout.setWidget(6, 0, opButton); +layout.setWidget(BUTTONS, 0, opButton); // Cancel Button. Button cancelButton = new Button("Cancel", new ClickHandler() { @@ -109,7 +123,7 @@ hide(); } }); -layout.setWidget(6, 1, cancelButton); +layout.setWidget(BUTTONS, 1, cancelButton); } public StockQuote getStockQuote() { @@ -119,7 +133,7 @@ /** * Get the last transaction. * - * @return the last transaction, or null if cancelled + * @return the last transaction, or null if canceled */ public Transaction getTransaction() { return transaction; @@ -132,7 +146,8 @@ */ public void setAvailableCash(int cash) { // TODO: Bind the available cash field. -layout.setText(5, 1, NumberFormat.getCurrencyFormat("USD").format(cash / 100.0)); +this.cash = cash; +layout.setText(AVAILABLE, 1, NumberFormat.getCurrencyFormat("USD").format(cash / 100.0)); } /** @@ -145,10 +160,15 @@ this.quote = quote; String op = isBuying ? "Buy" : "Sell"; setText(op + " " + quote.getTicker() + " (" + quote.getName() + ")"); -layout.setText(0, 1, quote.getTicker()); -layout.setText(1, 1, quote.getName()); -layout.setText(2, 1, quote.getDisplayPrice()); -layout.setText(4, 1, NumberFormat.getCurrencyFormat("USD").format(0.0)); +layout.setText(TICKE
[gwt-contrib] [google-web-toolkit] r7711 committed - Fixes GenerateJavaScriptAST to not produce duplicate native polymorphi...
Revision: 7711 Author: sco...@google.com Date: Thu Mar 11 11:44:05 2010 Log: Fixes GenerateJavaScriptAST to not produce duplicate native polymorphic methods. http://gwt-code-reviews.appspot.com/177801 Review by: spoon http://code.google.com/p/google-web-toolkit/source/detail?r=7711 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java Mon Mar 1 10:24:16 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java Thu Mar 11 11:44:05 2010 @@ -374,9 +374,9 @@ * causes no harm. */ jsFunction = new JsFunction(sourceInfo, topScope, globalName, true); -if (polymorphicNames.containsKey(x)) { - polymorphicJsFunctions.add(jsFunction); -} + } + if (polymorphicNames.containsKey(x)) { +polymorphicJsFunctions.add(jsFunction); } methodBodyMap.put(x.getBody(), jsFunction); jsFunction.getSourceInfo().addCorrelation( -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7712 committed - Implements JsDate to wrap the native Java Date class....
Revision: 7712 Author: sco...@google.com Date: Thu Mar 11 12:28:06 2010 Log: Implements JsDate to wrap the native Java Date class. http://gwt-code-reviews.appspot.com/182801 Review by: rjrjr http://code.google.com/p/google-web-toolkit/source/detail?r=7712 Added: /trunk/user/src/com/google/gwt/core/client/JsDate.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/core/client/JsDate.java Thu Mar 11 12:28:06 2010 @@ -0,0 +1,583 @@ +/* + * 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.core.client; + +/** + * A simple wrapper around a native JS Date object. + */ +public class JsDate extends JavaScriptObject { + + /** + * Creates a new date with the current time. + */ + public static native JsDate create() /*-{ +return new Date(); + }-*/; + + /** + * Creates a new date with the specified internal representation, which is the + * number of milliseconds since midnight on January 1st, 1970. This is the + * same representation returned by {...@link #getTime()}. + */ + public static native JsDate create(double milliseconds) /*-{ +return new Date(milliseconds); + }-*/; + + /** + * Creates a new date using the specified values. + */ + public static native JsDate create(int year, int month) /*-{ +return new Date(year, month); + }-*/; + + /** + * Creates a new date using the specified values. + */ + public static native JsDate create(int year, int month, int dayOfMonth) /*-{ +return new Date(year, month, dayOfMonth); + }-*/; + + /** + * Creates a new date using the specified values. + */ + public static native JsDate create(int year, int month, int dayOfMonth, int hours) /*-{ +return new Date(year, month, dayOfMonth, hours); + }-*/; + + /** + * Creates a new date using the specified values. + */ + public static native JsDate create(int year, int month, int dayOfMonth, int hours, + int minutes) /*-{ +return new Date(year, month, dayOfMonth, hours, minutes); + }-*/; + + /** + * Creates a new date using the specified values. + */ + public static native JsDate create(int year, int month, int dayOfMonth, int hours, + int minutes, int seconds) /*-{ +return new Date(year, month, dayOfMonth, hours, minutes, seconds); + }-*/; + + /** + * Creates a new date using the specified values. + */ + public static native JsDate create(int year, int month, int dayOfMonth, int hours, + int minutes, int seconds, int millis) /*-{ +return new Date(year, month, dayOfMonth, hours, minutes, seconds, millis); + }-*/; + + /** + * Creates a new date from a string to be parsed. + */ + public static native JsDate create(String dateString) /*-{ +return new Date(dateString); + }-*/; + + /** + * Parses a string representation of a date and time and returns the internal + * millisecond representation. If the string cannot be parsed, the returned + * value will be NaN. Use {...@link Double#isNaN(double)} to check + * the result. + */ + public static native double parse(String dateString) /*-{ +return Date.parse(dateString); + }-*/; + + // CHECKSTYLE_OFF: Matching the spec. + /** + * Returns the internal millisecond representation of the specified UTC date + * and time. + */ + public static native double UTC(int year, int month, int dayOfMonth, int hours, + int minutes, int seconds, int millis) /*-{ +return Date.UTC(year, month, dayOfMonth, hours, minutes, seconds, millis); + }-*/; + + // CHECKSTYLE_ON + + /** + * Non directly instantiable, use one of the {...@link #create()} methods. + */ + protected JsDate() { + } + + /** + * Returns the day of the month. + */ + public final native int getDate() /*-{ +return this.getDate(); + }-*/; + + /** + * Returns the day of the week, from 0 (Sunday) to 6 + * Saturday. + */ + public final native int getDay() /*-{ +return this.getDay(); + }-*/; + + /** + * Returns the four-digit year. + */ + public final native int getFullYear() /*-{ +return this.getFullYear(); + }-*/; + + /** + * Returns the hour, between 0 (midnight) and 23. + */ + public final native int getHours() /*-{ +return this.getHours(); + }-*/; + + /** + * Returns the milliseconds, between 0 and 999. + */ + public final native int getMilliseconds() /*-{ +return this.getMillis
[gwt-contrib] [google-web-toolkit] r7713 committed - Reimplement java.util.Date in Java, using the new JsDate....
Revision: 7713 Author: sco...@google.com Date: Thu Mar 11 17:04:12 2010 Log: Reimplement java.util.Date in Java, using the new JsDate. http://gwt-code-reviews.appspot.com/181801 Review by: rice, jat http://code.google.com/p/google-web-toolkit/source/detail?r=7713 Modified: /trunk/user/super/com/google/gwt/emul/java/util/Date.java /trunk/user/test/com/google/gwt/emultest/java/util/DateTest.java === --- /trunk/user/super/com/google/gwt/emul/java/util/Date.java Thu Mar 11 09:27:25 2010 +++ /trunk/user/super/com/google/gwt/emul/java/util/Date.java Thu Mar 11 17:04:12 2010 @@ -1,12 +1,12 @@ /* * Copyright 2007 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,7 +15,7 @@ */ package java.util; -import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsDate; import java.io.Serializable; @@ -25,34 +25,31 @@ public class Date implements Cloneable, Comparable, Serializable { /** - * Used only by toString(). + * Encapsulates static data to avoid Date itself having a static initializer. */ - private static final String[] DAYS = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - }; - - /** - * Used only by toString(). - */ - private static final String[] MONTHS = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; + private static class StringData { +public static final String[] DAYS = { +"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; + +public static final String[] MONTHS = { +"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", +"Nov", "Dec"}; + } public static long parse(String s) { -long d = (long) parse0(s); -if (d != -1) { - return d; -} else { +double parsed = JsDate.parse(s); +if (Double.isNaN(parsed)) { throw new IllegalArgumentException(); } +return (long) parsed; } // CHECKSTYLE_OFF: Matching the spec. - public static long UTC(int year, int month, int date, int hrs, - int min, int sec) { -return (long) utc0(year, month, date, hrs, min, sec); - } + public static long UTC(int year, int month, int date, int hrs, int min, + int sec) { +return (long) JsDate.UTC(year + 1900, month, date, hrs, min, sec, 0); + } + // CHECKSTYLE_ON /** @@ -68,72 +65,36 @@ } } - /** - * Return the names for the days of the week as specified by the Date - * specification. - */ - @SuppressWarnings("unused") // called by JSNI - private static String dayToString(int day) { -return DAYS[day]; - } - - /** - * Return the names for the months of the year as specified by the Date - * specification. - */ - @SuppressWarnings("unused") // called by JSNI - private static String monthToString(int month) { -return MONTHS[month]; - } - - private static native double parse0(String s) /*-{ -var d = Date.parse(s); -return isNaN(d) ? -1 : d; - }-*/; - - /** - * Throw an exception if jsdate is not an object. - * - * @param val - */ - @SuppressWarnings("unused") // called by JSNI - private static void throwJsDateException(String val) { -throw new IllegalStateException("jsdate is " + val); - } - - private static native double utc0(int year, int month, int date, int hrs, - int min, int sec) /*-{ -return Date.UTC(year + 1900, month, date, hrs, min, sec); - }-*/; - /** * JavaScript Date instance. */ - @SuppressWarnings("unused") // used from JSNI - private JavaScriptObject jsdate; - + private final JsDate jsdate; + public Date() { -init(); +jsdate = JsDate.create(); } public Date(int year, int month, int date) { -init(year, month, date, 0, 0, 0); +this(year, month, date, 0, 0, 0); } public Date(int year, int month, int date, int hrs, int min) { -init(year, month, date, hrs, min, 0); +this(year, month, date, hrs, min, 0); } public Date(int year, int month, int date, int hrs, int min, int sec) { -init(year, month, date, hrs, min, sec); +jsdate = JsDate.create(); +jsdate.setFullYear(year + 1900, month, date); +jsdate.setHours(hrs, min, sec, 0); +fixDaylightSavings(hrs); } public Date(long date) { -init(date); +jsdate = JsDate.create(date); } public Date(String date) { -init(Date.parse(date)); +this(Date.parse(date)); } public boolean after(Date when) { @@ -165,161 +126,113 @@ return ((obj instanceof Date) && (getTim
[gwt-contrib] [google-web-toolkit] r7715 committed - Changes for crawling: client-side changes to Showcase sample...
Revision: 7715 Author: kpro...@google.com Date: Fri Mar 12 03:15:29 2010 Log: Changes for crawling: client-side changes to Showcase sample Review at http://gwt-code-reviews.appspot.com/161801 http://code.google.com/p/google-web-toolkit/source/detail?r=7715 Modified: /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwHyperlink.java /trunk/samples/showcase/war/Showcase.html === --- /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java Wed Nov 18 11:30:09 2009 +++ /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java Fri Mar 12 03:15:29 2010 @@ -79,6 +79,7 @@ import com.google.gwt.user.client.ui.HasHorizontalAlignment; import com.google.gwt.user.client.ui.HasVerticalAlignment; import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Hyperlink; import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.ListBox; import com.google.gwt.user.client.ui.RootPanel; @@ -214,7 +215,8 @@ TreeItem item = event.getSelectedItem(); ContentWidget content = itemWidgets.get(item); if (content != null && !content.equals(app.getContent())) { - History.newItem(getContentWidgetToken(content)); + String historyToken = ((Hyperlink) item.getWidget()).getTargetHistoryToken(); + History.newItem(historyToken); } } }); @@ -229,7 +231,7 @@ app.getMainMenu().ensureSelectedItemVisible(); displayContentWidget(itemWidgets.get(firstItem)); } - + // Always prefetch Prefetcher.start(); } @@ -243,6 +245,7 @@ if (content != null) { app.setContent(content); app.setContentTitle(content.getTabBar()); + Window.setTitle("Showcase of Features: " + content.getName()); } } @@ -398,12 +401,13 @@ private void setupMainMenuOption(TreeItem parent, ContentWidget content, ImageResource image) { // Create the TreeItem -TreeItem option = parent.addItem(AbstractImagePrototype.create(image).getHTML() -+ " " + content.getName()); +Hyperlink hl = new Hyperlink(AbstractImagePrototype.create(image).getHTML() ++ " " + content.getName(), true, "!" + getContentWidgetToken(content)); +TreeItem option = parent.addItem(hl); // Map the item to its history token and content widget itemWidgets.put(option, content); -itemTokens.put(getContentWidgetToken(content), option); +itemTokens.put(hl.getTargetHistoryToken(), option); } /** === --- /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwHyperlink.java Wed Nov 18 11:30:09 2009 +++ /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwHyperlink.java Fri Mar 12 03:15:29 2010 @@ -133,7 +133,7 @@ className = className.substring(className.lastIndexOf('.') + 1); // Convert to a hyper link -Hyperlink link = new Hyperlink(name, className); +Hyperlink link = new Hyperlink(name, "!" + className); link.ensureDebugId("cwHyperlink-" + className); return link; } === --- /trunk/samples/showcase/war/Showcase.html Mon Nov 23 16:21:36 2009 +++ /trunk/samples/showcase/war/Showcase.html Fri Mar 12 03:15:29 2010 @@ -1,6 +1,6 @@ -Showcase of GWT Features +
[gwt-contrib] [google-web-toolkit] r7716 committed - Adding missing package descriptions to various packages....
Revision: 7716 Author: jlaba...@google.com Date: Fri Mar 12 05:06:15 2010 Log: Adding missing package descriptions to various packages. http://gwt-code-reviews.appspot.com/176801 http://code.google.com/p/google-web-toolkit/source/detail?r=7716 Added: /trunk/dev/core/src/com/google/gwt/core/linker/package.html /trunk/user/src/com/google/gwt/i18n/client/constants/package.html /trunk/user/src/com/google/gwt/i18n/rebind/package.html /trunk/user/src/com/google/gwt/i18n/server/package.html /trunk/user/src/com/google/gwt/i18n/shared/package.html /trunk/user/src/com/google/gwt/jsonp/client/package.html /trunk/user/src/com/google/gwt/resources/client/package.html /trunk/user/src/com/google/gwt/resources/ext/package.html /trunk/user/src/com/google/gwt/rpc/client/package.html /trunk/user/src/com/google/gwt/rpc/server/package.html /trunk/user/src/com/google/gwt/uibinder/client/package-info.java === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/core/linker/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,5 @@ + + +This package contains implementations of the GWT bootstrap linkers. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/i18n/client/constants/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,9 @@ + + +Predefined internationalized constants for currency, date, time, and numbers. + +This package contains interfaces that define internationalized constants used +by the class in {...@link com.google.gwt.i18n.client} to format currency, date, +time, and numeric strings. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/i18n/rebind/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,5 @@ + + +This package contains i18n generators. The class in this package are not meant to be used directly. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/i18n/server/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,5 @@ + + +This package contains server-side i18n classes and interfaces. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/i18n/shared/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,6 @@ + + +This package contains i18n classes and interfaces shared between client and +server. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/jsonp/client/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,10 @@ + + +Classes for sending cross domain requests to an http server, potentially on a +different domain, via JSONP. + +This package contains classes that allow applications to send requests to +servers on different domains than the host page. +server. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/resources/client/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,10 @@ + + +Classes for aggregating static resources into bundles. + +This package contains classes to aggregate and minify static resources into +bundles that will be downloaded in a single request. Bundling resources +decreases the number of requests sent to the server, improving application +performance and load time. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/resources/ext/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,6 @@ + + +This package contains extension hooks for adding new resource types to +ClientBundle. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/rpc/client/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,5 @@ + + +Contains the client-side APIs for deRPC. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/rpc/server/package.html Fri Mar 12 05:06:15 2010 @@ -0,0 +1,5 @@ + + +Contains the server-side APIs for deRPC. + + === --- /dev/null +++ /trunk/user/src/com/google/gwt/uibinder/client/package-info.java Fri Mar 12 05:06:15 2010 @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/** + * Classes used to generate user interfaces using declarative ui.xml files. + * + * + * This package contains the classes and interfaces that allow you to define + * user interfaces from ui.xml template files, managed by generated + * implementations of the {...@link UiBinder
[gwt-contrib] [google-web-toolkit] r7717 committed - Fix bugs in stock sample app
Revision: 7717 Author: r...@google.com Date: Fri Mar 12 06:22:00 2010 Log: Fix bugs in stock sample app http://code.google.com/p/google-web-toolkit/source/detail?r=7717 Modified: /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/BuySellPopup.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/ChangeCell.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/HighlightingTextCell.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockQueryWidget.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/StockServiceImpl.java === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/BuySellPopup.java Thu Mar 11 11:11:10 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/BuySellPopup.java Fri Mar 12 06:22:00 2010 @@ -35,7 +35,7 @@ */ public class BuySellPopup extends DialogBox { - + // Row numbers for popup fields private static final int TICKER = 0; private static final int NAME = 1; private static final int PRICE = 2; === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/ChangeCell.java Thu Mar 11 03:44:25 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/ChangeCell.java Fri Mar 12 06:22:00 2010 @@ -24,6 +24,9 @@ @Override public void render(String value, StringBuilder sb) { +if (value == null || value.length() == 0) { + return; +} sb.append(""); === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/HighlightingTextCell.java Thu Mar 11 09:45:33 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/HighlightingTextCell.java Fri Mar 12 06:22:00 2010 @@ -25,24 +25,25 @@ */ public class HighlightingTextCell extends Cell { - private String highlightRegex; + private RegExp highlightRegex; @Override public void render(String value, StringBuilder sb) { -sb.append(""); -if (highlightRegex == null || highlightRegex.length() == 0) { +// sb.append(""); +sb.append(""); +if (highlightRegex == null) { sb.append(value); sb.append(""); return; } -RegExp regExp = RegExp.compile(highlightRegex, "gi"); int fromIndex = 0; int length = value.length(); MatchResult result; +highlightRegex.setLastIndex(0); while (fromIndex < length) { // Find the next match of the highlight regex - result = regExp.exec(value); + result = highlightRegex.exec(value); if (result == null) { // No more matches break; @@ -58,7 +59,7 @@ sb.append(""); // Skip past the matched string fromIndex = index + match.length(); - regExp.setLastIndex(fromIndex); + highlightRegex.setLastIndex(fromIndex); } // Append the tail of the string if (fromIndex < length) { @@ -67,7 +68,11 @@ sb.append(""); } - public void setHighlightRegex(String highlightRegex) { -this.highlightRegex = highlightRegex; + public void setHighlightRegex(String highlightText) { +if (highlightText != null && highlightText.length() > 0) { + highlightRegex = RegExp.compile(highlightText, "gi"); +} else { + highlightRegex = null; +} } } === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockQueryWidget.java Thu Mar 11 11:11:10 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockQueryWidget.java Fri Mar 12 06:22:00 2010 @@ -78,7 +78,7 @@ private String normalize(String input) { String output = input; -output = output.replaceAll("\\|+", "|"); +output = output.replaceAll("\\|+", " "); output = output.replaceAll("^[\\| ]+", ""); output = output.replaceAll("[\\| ]+$", ""); output = output.replaceAll("[ ]+", "|"); === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/StockServiceImpl.java Thu Mar 11 09:45:33 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/StockServiceImpl.java Fri Mar 12 06:22:00 2010 @@ -299,7 +299,7 @@ } } -return new Result(toRet, symbols.size()); +return new Result(toRet, toRet.size()); } // If a query is alpha-only ([A-Za-z]+), return stocks for which: @@ -339,7 +339,9 @@ } // (2) - getTickersByNameRegex(pattern, symbols); + if (query.length() > 2) { +getTickersByNameRegex(pattern, symbols); + } } return getQuotes(symbols, searchRange); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding missing package descriptions to javadoc
committed as r7716 http://gwt-code-reviews.appspot.com/176801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7718 committed - Adding list of top players to the game.
Revision: 7718 Author: gwt.mirror...@gmail.com Date: Fri Mar 12 11:14:43 2010 Log: Adding list of top players to the game. http://code.google.com/p/google-web-toolkit/source/detail?r=7718 Added: /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.ui.xml /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/shared/PlayerInfo.java Modified: /trunk/bikeshed/.classpath /trunk/bikeshed/.project /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockSample.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockSample.ui.xml /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/common.css /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/PlayerStatus.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/StockServiceImpl.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/shared/StockResponse.java /trunk/bikeshed/war/Stocks.css /trunk/bikeshed/war/WEB-INF/web.xml === --- /dev/null +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.java Fri Mar 12 11:14:43 2010 @@ -0,0 +1,70 @@ +/* + * 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.bikeshed.sample.stocks.client; + +import com.google.gwt.bikeshed.cells.client.Cell; +import com.google.gwt.bikeshed.list.client.SimpleCellList; +import com.google.gwt.bikeshed.list.shared.ListModel; +import com.google.gwt.bikeshed.sample.stocks.shared.PlayerInfo; +import com.google.gwt.core.client.GWT; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiFactory; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.Widget; + +/** + * Widget to display player scores. + */ +public class PlayerScoresWidget extends Composite { + + interface Binder extends UiBinder { + } + + private static final Binder binder = GWT.create(Binder.class); + + /** + * A {...@link Cell} that displays the status of a single player. + */ + private static final class PlayerInfoCell extends Cell { +@Override +public void render(PlayerInfo value, StringBuilder sb) { + sb.append(""); + sb.append("Name: "); + sb.append(value.getDisplayName()); + sb.append("Net Worth: "); + sb.append(StockSample.getFormattedPrice(value.getNetWorth())); + sb.append("Cash: "); + sb.append(StockSample.getFormattedPrice(value.getCash())); + sb.append(""); +} + } + + @UiField + SimpleCellList listView; + + private final ListModel model; + + public PlayerScoresWidget(ListModel model) { +this.model = model; +initWidget(binder.createAndBindUi(this)); + } + + @UiFactory + SimpleCellList createListView() { +return new SimpleCellList(model, new PlayerInfoCell()); + } +} === --- /dev/null +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.ui.xml Fri Mar 12 11:14:43 2010 @@ -0,0 +1,21 @@ + + + + + + + Everyone Else + + + + + + + + + === --- /dev/null +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/shared/PlayerInfo.java Fri Mar 12 11:14:43 2010 @@ -0,0 +1,129 @@ +/* + * 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.bikeshed.sample.stocks.shared; + +import java.io.Serializable; + +/** + * Information about a single player. + */ +public class PlayerInfo implements Serializable { + + /** + * The initial amount of cash that the player starts with, in cents. + */ + private static final int INITIAL_CASH =
[gwt-contrib] [google-web-toolkit] r7719 committed - Adding app engine files to bikeshed.
Revision: 7719 Author: jlaba...@google.com Date: Fri Mar 12 07:26:16 2010 Log: Adding app engine files to bikeshed. http://code.google.com/p/google-web-toolkit/source/detail?r=7719 Added: /trunk/bikeshed/war/WEB-INF/appengine-web.xml /trunk/bikeshed/war/WEB-INF/lib /trunk/bikeshed/war/WEB-INF/lib/appengine-api-1.0-sdk-1.2.5.jar /trunk/bikeshed/war/WEB-INF/lib/appengine-api-labs-1.2.5.jar /trunk/bikeshed/war/WEB-INF/lib/datanucleus-appengine-1.0.3.jar /trunk/bikeshed/war/WEB-INF/lib/datanucleus-core-1.1.5.jar /trunk/bikeshed/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar /trunk/bikeshed/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar /trunk/bikeshed/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar /trunk/bikeshed/war/WEB-INF/lib/gwt-servlet.jar /trunk/bikeshed/war/WEB-INF/lib/jdo2-api-2.3-eb.jar === --- /dev/null +++ /trunk/bikeshed/war/WEB-INF/appengine-web.xml Fri Mar 12 07:26:16 2010 @@ -0,0 +1,11 @@ + +http://appengine.google.com/ns/1.0";> + + 1 + + + + value="WEB-INF/logging.properties"/> + + + === --- /dev/null +++ /trunk/bikeshed/war/WEB-INF/lib/appengine-api-1.0-sdk-1.2.5.jar Fri Mar 12 07:26:16 2010 File is too large to display a diff. === --- /dev/null +++ /trunk/bikeshed/war/WEB-INF/lib/appengine-api-labs-1.2.5.jar Fri Mar 12 07:26:16 2010 Binary file, no diff available. === --- /dev/null +++ /trunk/bikeshed/war/WEB-INF/lib/datanucleus-appengine-1.0.3.jar Fri Mar 12 07:26:16 2010 Binary file, no diff available. === --- /dev/null +++ /trunk/bikeshed/war/WEB-INF/lib/datanucleus-core-1.1.5.jar Fri Mar 12 07:26:16 2010 File is too large to display a diff. === --- /dev/null +++ /trunk/bikeshed/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar Fri Mar 12 07:26:16 2010 Binary file, no diff available. === --- /dev/null +++ /trunk/bikeshed/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar Fri Mar 12 07:26:16 2010 Binary file, no diff available. === --- /dev/null +++ /trunk/bikeshed/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar Fri Mar 12 07:26:16 2010 @@ -0,0 +1,360 @@ +PK + â¢\A8 META-INF/PK + â\A8Ã] ú¬ V META-INF/MANIFEST.MF +RÃnÃ0 ¼ Ã? >�...@hk*Ã&2rp\·pa A öj°äÃf"q âââ¢Â¿ %à ²âºG Ãvvvgv¸âZe` +ý +Ã*Ã)â°Y S#vª s,ÃæÃTâ +â¬0Ë Ã $½~l9ç,ÃßÃâ¡i...@fxâ⢠sF Z° ap]©ÃuÂ[ \_âôâ¡|8²Ã¢â9ÃÂ¥  -¤dç\â¢Å½Ãûýžñââ¹ +04ÃqÃÃv¼\Ãæ7ë9MXÃ\ãâ¡.Š£·\<ðÂçÃóš7à ®- ÃûËýŸ«QÃâÃÃ+Å5|Râ¡ 9Ãò²´¤Knà +¥à H/9â°Ã¢â¹ÃI|yy~ â¡Ã¼ùÃÃnî¿WO*¿Ã»J¯FoÃG óâ¡[ äæÃP¾á +ñ ÆZ Hï +ÃxxcK CÃW°Ã¨Ãõù ¬⢠K° M-VF Q +O³ ÃxÃä±Å¬+MÃ)*órâ¢Ã¨ vÅâ°Ã¢ÃÃÃ¥;à +]«ç_7ËONühâ°&%ÃŽeÃËÂ...@¾¡Ã»m]Ã'²è r9 ÅïÞâ¡â°Ã«Ãâ ú?ßÃÃ8(:\â¡Âµ~,{çXwËyJÃ/ ùoâ$_^à A < PK + â¹\A8javax/PK + â¹\A8javax/transaction/PK + â¹\A8javax/transaction/xa/PK + â¹...@Ãyà + á 0 javax/transaction/HeuristicCommitException.class PÃJÃ@ ÅmÃFc´ÃZo + âÅ¡Å A+W {+UÃ`»MlUá jgû PK + â¹\A8ÃTô + à / javax/transaction/HeuristicMixedException.class PMKÃ@ ÅmÃFc´ÃZO^ �...@Æx¬ô"Å â¡Ã¨Â¥Ãû6]âJÅ¡Ãf#ù[ž + +ü þ(ñÃ6((â{Ë÷Ãì¼â¢eÃ?^à Å¡ëÃÞ ¶â¹Å½â¹}â æ +L¥ž0Ã{ý Æsâ¢- C+⩸+âs¡îù h ð úÿ~ Cç;õâ¹Ã êô]æÃÃÅ1¡KÃ9UFµ1X ½Ãë +B *hÃÃ16©óÃ"â·¨ ¿2Ë ÃhâºÆá +µŸ '¤<µ kUÃ¥`ºmìÃðâÃÃý PK + â¹\A82 dÅç 2 javax/transaction/HeuristicRollbackException.classâ¢PÃJÃ@ ÅmÃFc´ÃZ¯¢ Ã* +â±Ãâ¹( +â +½oâ WÃMÃl¤¿å©à à ð£Ã·iPP<¸â¡7ïÃÃâºYöýãõ +Ã)º + +lÃÃvÃq±ÃÃ<âJÅ¡ C½w4ap.²{Ãà +Â¥ 7à 4 úŽG)1Ã0â¹y:áZù" +ó sâ Aøßù<0š«ÅÃFf*¸ +â¹âñm⦠Ÿ.ç±Ëë!C·Wn )WI06ZªdhÃéÃsžâq¿ Ã8+t,®¤ÃÃý;a`w}4ôà g8ùÃû :ÃÃ_,öP§ ³§ f½©º4 2ÃF öR^¯Põ AK ö±J ¿ ¿Fh +üÃ`DJ«mö ¨ýt8 Ã¥aé°³TU ¶[ÃF Ã*w6? PK + â¹\A8Nà ¿! ï 3 javax/transaction/InvalidTransactionException.classâ¢PÃJÃ@ ÅmÃFc´ZÂxT Å ]ÃcÂ¥ Q â [zæK\I6⤥¿å©à à ð£Ã·Ã  ¸â¡7ïÃÃâºYöýãõ +à : + +lâ¢Ãv±Ãbâ¡Â¡y¥´*û õà dÃà \g Ãà +â¢â÷Ãt,ó¡ 'ôÃ, ÃHäÃà éâ ª`à áâËâ°9/s¡ â¢*ÃüNÃD¢&Ãoêf +ÃgÃô : ]áâ°Ã1 â¹ÃqÃû©, + ü_ o MóHÃ* ¾ÿgùy�...@à Ÿáì_/dóéyªøÆL³R~]á uú?sj`& ªKÃ%!#lt `/öz +ªG +Ãà V©óâ"âà _ ôIi´Ãîé µŸ ä ¬ÃîRU9Ën + 6¼ew6? PK + â¹\A8]8ýGà - javax/transaction/NotSupportedException
[gwt-contrib] [google-web-toolkit] r7720 committed - Fixing handling of nested switch statements in gflow....
Revision: 7720 Author: gwt.mirror...@gmail.com Date: Fri Mar 12 08:11:14 2010 Log: Fixing handling of nested switch statements in gflow. Added couple of toString methods which helped debugging the issue. Review by: sp...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=7720 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/AnalysisSolver.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/cfg/CfgBuilder.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantConditionTransformation.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/FoldConstantsTransformation.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/unreachable/DeleteNodeTransformation.java /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/OptimizerTestBase.java /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/DataflowOptimizerTest.java /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/cfg/CfgBuilderTest.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/AnalysisSolver.java Tue Mar 9 10:54:56 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/AnalysisSolver.java Fri Mar 12 08:11:14 2010 @@ -83,8 +83,8 @@ if (debug) { System.err.println("Applying transformation: " + transformation); System.err.println("Replacing"); -System.err.println(graph); -System.err.println("With"); +System.err.println(node); +System.err.println("With graph:"); System.err.println(newSubgraph); } @@ -271,6 +271,12 @@ */ private void iterate(G graph, final IntegratedAnalysis integratedAnalysis) { +if (debug) { + System.err.println("-"); + System.err.println("Iterate started on:"); + System.err.println(graph); + System.err.println("-"); +} final IntegratedFlowFunctionAdapter adapter = new IntegratedFlowFunctionAdapter(integratedAnalysis); === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/cfg/CfgBuilder.java Tue Mar 9 10:54:56 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/cfg/CfgBuilder.java Fri Mar 12 08:11:14 2010 @@ -610,12 +610,16 @@ accept(x.getExpr()); JSwitchStatement oldSwitchStatement = switchStatement; + // We don't want to mess with other case exits here + List oldCaseElseExits = removeExits(Exit.Reason.CASE_ELSE); + List oldCaseThenExits = removeExits(Exit.Reason.CASE_THEN); + List oldBreakExits = removeExits(Exit.Reason.BREAK); switchStatement = x; int defaultPos = -1; List breakExits = new ArrayList(); - + for (JStatement s : x.getBody().getStatements()) { if (s instanceof JCaseStatement) { if (((JCaseStatement) s).getExpr() != null) { @@ -660,6 +664,9 @@ } switchStatement = oldSwitchStatement; + addExits(oldCaseElseExits); + addExits(oldCaseThenExits); + addExits(oldBreakExits); popNode(); return false; } === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantConditionTransformation.java Tue Mar 9 10:54:56 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantConditionTransformation.java Fri Mar 12 08:11:14 2010 @@ -111,4 +111,10 @@ return newSubgraph; } -} + + @Override + public String toString() { +return "ConstantConditionTransformation(node=" + node + +", conditionValue=" + conditionValue + ")"; + } +} === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/FoldConstantsTransformation.java Tue Mar 9 10:54:56 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/FoldConstantsTransformation.java Fri Mar 12 08:11:14 2010 @@ -52,4 +52,10 @@ CfgNode newNode = new CfgNopNode(node.getParent(), node.getJNode()); return CfgUtil.createSingleNodeReplacementGraph(graph, node, newNode); } -} + + @Override + public String toString() { +return "FoldConstantsTransformation(node=" + node + +", assumptions=" + assumption + ")"; + } +} === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/unreachable/DeleteNodeTransformation.java Tue Mar 9 10:54:56 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/unreachable/DeleteNodeTransformation.java Fri Mar 12 08:11:14 2010 @@ -65,4 +65,9 @@ CfgNode newNode = new CfgNopNode(node.getParent(), node.getJNode()); return CfgUtil.createSingleNodeReplacementGraph(graph, node, newNode); } -} + + @Override + public String toString() { +return "DeleteNodeTransformation(node=" + node + ")"; + } +} ==
[gwt-contrib] Add quick-and-dirty wireshark packet dissector for GWT code server
Reviewers: scottb, Description: Add quick-and-dirty wireshark packet dissector for GWT code server protocol. Patch by: jat Review by: scottb Please review this at http://gwt-code-reviews.appspot.com/191801 Affected files: A plugins/wireshark/Makefile A plugins/wireshark/README.txt A plugins/wireshark/packet-gwtcs.c -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Start of sending an update request. Checking in mid-way to allow some
Reviewers: amitmanjhi, Description: Start of sending an update request. Checking in mid-way to allow some renaming work before Amit finishes it. Review by: amitman...@google.com Please review this at http://gwt-code-reviews.appspot.com/192801 Affected files: M bikeshed/src/com/google/gwt/sample/expenses/client/Expenses.java M bikeshed/src/com/google/gwt/sample/expenses/client/Shell.java M bikeshed/src/com/google/gwt/sample/expenses/client/Shell.ui.xml M bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java M bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRequests.java M bikeshed/src/com/google/gwt/sample/expenses/shared/ExpenseRequestFactory.java M bikeshed/src/com/google/gwt/sample/expenses/shared/MethodName.java A bikeshed/src/com/google/gwt/sample/expenses/shared/SyncRequest.java M bikeshed/src/com/google/gwt/valuestore/shared/Values.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Start of sending an update request. Checking in mid-way to allow some
LGTM http://gwt-code-reviews.appspot.com/192801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on CssResource in google-web-toolkit
Comment by thobias.karlsson: Has anybody solved the issue with style dependent names? This is what I want to do: HoverLabel.java {{{ public class HoverLabel extends Composite { private static HoverLabelUiBinder uiBinder = GWT.create(HoverLabelUiBinder.class); interface HoverLabelUiBinder extends UiBinder {} interface Style extends CssResource { String over(); } @UiField Style style; public HoverLabel(String firstName) { initWidget(uiBinder.createAndBindUi(this)); addDomHandler(new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { addStyleDependentName(style.over()); } }, MouseOverEvent.getType()); addDomHandler(new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { removeStyleDependentName(style.over()); } }, MouseOutEvent.getType()); } } }}} HoverLabel.ui.xml {{{ http://dl.google.com/gwt/DTD/xhtml.ent";> xmlns:g="urn:import:com.google.gwt.user.client.ui"> .lbl {} .lbl-over { background-color: red; } }}} Note: I don't want to have the style name 'lbl' inside of my Style interface. I want to be able to override the primary style name when referencing to HoverLabel from another widget UIBinder, like this: {{{ http://dl.google.com/gwt/DTD/xhtml.ent";> xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.google.test"> .blueLbl {} .blueLbl-over { background-color: blue; } Hover to make me blue! }}} For more information: http://code.google.com/p/google-web-toolkit/wiki/CssResource -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7721 committed - Start of sending an update request. Checking in mid-way to allow some...
Revision: 7721 Author: rj...@google.com Date: Fri Mar 12 09:35:24 2010 Log: Start of sending an update request. Checking in mid-way to allow some renaming work before Amit finishes it. Review at http://gwt-code-reviews.appspot.com/192801 Review by: amitman...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=7721 Added: /trunk/bikeshed/src/com/google/gwt/sample/expenses/shared/SyncRequest.java Modified: /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/Expenses.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/Shell.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/Shell.ui.xml /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRequests.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/shared/ExpenseRequestFactory.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/shared/MethodName.java /trunk/bikeshed/src/com/google/gwt/valuestore/shared/Values.java === --- /dev/null +++ /trunk/bikeshed/src/com/google/gwt/sample/expenses/shared/SyncRequest.java Fri Mar 12 09:35:24 2010 @@ -0,0 +1,23 @@ +/* + * 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.expenses.shared; + +/** + * Request to commit CRUD operations accumulated in a DeltaValueStore. + */ +public interface SyncRequest { + void fire(); +} === --- /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/Expenses.java Wed Mar 10 14:02:29 2010 +++ /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/Expenses.java Fri Mar 12 09:35:24 2010 @@ -21,6 +21,10 @@ import com.google.gwt.sample.expenses.shared.ExpenseRequestFactory; import com.google.gwt.sample.expenses.shared.Report; import com.google.gwt.user.client.ui.RootLayoutPanel; +import com.google.gwt.valuestore.shared.Values; + +import java.util.ArrayList; +import java.util.List; /** * Entry point classes define onModuleLoad(). @@ -46,6 +50,17 @@ final EmployeeList employees = new EmployeeList(shell.users); root.add(shell); + +shell.setListener(new Shell.Listener() { + public void setFirstPurpose(String purpose) { +ValuesImpl reportValues = (ValuesImpl )shell.getValues().get(0); +reportValues.setString(Report.PURPOSE, purpose); +List> deltaValueStore = new ArrayList>(); +deltaValueStore.add(reportValues); + +requestFactory.syncRequest(deltaValueStore).fire(); + } +}); employees.setListener(new EmployeeList.Listener() { public void onEmployeeSelected(Employee e) { === --- /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/Shell.java Wed Mar 10 14:02:29 2010 +++ /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/Shell.java Fri Mar 12 09:35:24 2010 @@ -22,13 +22,18 @@ import com.google.gwt.dom.client.TableCellElement; import com.google.gwt.dom.client.TableElement; import com.google.gwt.dom.client.TableRowElement; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.sample.expenses.shared.Report; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.uibinder.client.UiHandler; +import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HasValueList; import com.google.gwt.user.client.ui.ListBox; +import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.valuestore.shared.Property; import com.google.gwt.valuestore.shared.Values; @@ -41,9 +46,14 @@ * refactored into proper MVP pieces. */ public class Shell extends Composite implements HasValueList> { - - interface ShellUiBinder extends UiBinder { - } + interface Listener { +void setFirstPurpose(String purpose); + } + + interface ShellUiBinder extends UiBinder { + } + + private Listener listener; private static ShellUiBinder uiBinder = GWT.create(ShellUiBinder.class); @UiField @@ -54,6 +64,11 @@ TableRowElement header; @UiField ListBox users; + @UiField + TextBox purpose; + @UiField + Button save; + private List>
[gwt-contrib] Re: Add quick-and-dirty wireshark packet dissector for GWT code server
LGTM, just some food for thought. http://gwt-code-reviews.appspot.com/191801/diff/1/4 File plugins/wireshark/packet-gwtcs.c (right): http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode20 Line 20: * things like declaring all variables at the beginning of a block. Do you mean to avoid declaring all variables at the beginning of the block or to always declare all variables at the beginning of the block? http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode40 Line 40: #define DEFAULT_GWTCS_PORT 9997 this declaration could be externalized - 9997 is also declared as a constant in ../common/HostChannel.h http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode279 Line 279: gint32 i,j; The use of i,j below is a bit confusing to me. To me it would be clearer to create a third variable to use to walk through the packet (e.g. gint32 offset;) or to create a separate block {} for each case and give the variables meaningful names. (personal style: I usually reserve i,j,k for iterating and would use a different name for storing temp values read from the packet.) http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode366 Line 366: j += 4 + i; I don't see any bugs, but it seems like you could come up with a little pattern or macro here to make sure the size you increment j by always matches the size passed to proto_tree_add_item. http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode389 Line 389: #if 0 still need this code? Maybe just leave a comment instead. http://gwt-code-reviews.appspot.com/191801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: RR : Soft permutations
Mostly like where this is heading, there's a few spots like ReplaceRebinds I didn't completely sink teeth into. I still think, having looked at this, that making soft perm ids a first class thing in Permutation and SelectionScriptLinker would lead to the best result, even if it slightly breaks existing SelectionScriptLinker subclasses when used with soft perms. I think ReplaceRunAsyncs (for example) would get tons simpler. http://gwt-code-reviews.appspot.com/160801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7722 committed - Add multiplayer status messages to stock sample
Revision: 7722 Author: r...@google.com Date: Fri Mar 12 11:27:24 2010 Log: Add multiplayer status messages to stock sample http://code.google.com/p/google-web-toolkit/source/detail?r=7722 Modified: /trunk/bikeshed/src/com/google/gwt/bikeshed/list/shared/AbstractListModel.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.ui.xml /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockSample.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/TransactionTreeViewModel.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/server/StockServiceImpl.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/shared/PlayerInfo.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/shared/StockResponse.java /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/tree/client/MyTreeViewModel.java /trunk/bikeshed/src/com/google/gwt/bikeshed/tree/client/SideBySideTreeNodeView.java /trunk/bikeshed/src/com/google/gwt/bikeshed/tree/client/StandardTreeNodeView.java /trunk/bikeshed/src/com/google/gwt/bikeshed/tree/client/TreeNodeView.java /trunk/bikeshed/src/com/google/gwt/bikeshed/tree/client/TreeViewModel.java === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/list/shared/AbstractListModel.java Fri Feb 26 09:32:06 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/list/shared/AbstractListModel.java Fri Mar 12 11:27:24 2010 @@ -151,6 +151,10 @@ protected void updateViewData(int start, int length, List values) { int end = start + length; for (DefaultListRegistration reg : registrations) { + // Inform the views if there is no data + if (values.size() == 0) { +reg.getHandler().onSizeChanged(new SizeChangeEvent(0, true)); + } int curStart = reg.getStart(); int curLength = reg.getLength(); int curEnd = curStart + curLength; === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.java Fri Mar 12 07:16:19 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.java Fri Mar 12 11:27:24 2010 @@ -26,6 +26,8 @@ import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; +import java.util.List; + /** * Widget to display player scores. */ @@ -49,6 +51,14 @@ sb.append(StockSample.getFormattedPrice(value.getNetWorth())); sb.append("Cash: "); sb.append(StockSample.getFormattedPrice(value.getCash())); + + List status = value.getStatus(); + if (status != null) { +for (String s : status) { + sb.append(""); + sb.append(s); +} + } sb.append(""); } } === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.ui.xml Fri Mar 12 07:16:19 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/PlayerScoresWidget.ui.xml Fri Mar 12 11:27:24 2010 @@ -9,7 +9,7 @@ - Everyone Else + Player Status === --- /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockSample.java Fri Mar 12 07:16:19 2010 +++ /trunk/bikeshed/src/com/google/gwt/bikeshed/sample/stocks/client/StockSample.java Fri Mar 12 11:27:24 2010 @@ -187,12 +187,7 @@ // Update the favorites list. updateFavorites(response); updateSector(response); - -// Update the player scores. -List playerScores = response.getPlayers(); -int numPlayers = playerScores.size(); -playerScoresListModel.updateDataSize(numPlayers, true); -playerScoresListModel.updateViewData(0, numPlayers, playerScores); +updatePlayerScores(response); // Update available cash. int cash = response.getCash(); @@ -226,6 +221,7 @@ public void onSuccess(StockResponse response) { updateFavorites(response); + updatePlayerScores(response); } }); } else { @@ -237,6 +233,7 @@ public void onSuccess(StockResponse response) { updateFavorites(response); + updatePlayerScores(response); } }); } @@ -316,27 +313,6 @@ } }); } - - public void updateFavorites(StockResponse response) { -// Update the favorites list. -StockQuoteList favorites = response.getFavorites(); -favoritesListModel.updateDataSize(response.getNumFavorites(), true); -favoritesListModel.updateViewData(favorites.getStartIndex(), -favorites.size(), favorites); - } - - public void updateSector(StockResponse response) { -// Update the sector list. -StockQuoteList sectorList = response.getSector(); -if (sectorList
[gwt-contrib] Begone foul unsharable eclipse detritus.
Reviewers: amitmanjhi, Description: Begone foul unsharable eclipse detritus. Please review this at http://gwt-code-reviews.appspot.com/193801 Affected files: D bikeshed/.classpath D bikeshed/.project Index: bikeshed/.classpath === --- bikeshed/.classpath (revision 7721) +++ bikeshed/.classpath (working copy) @@ -1,12 +0,0 @@ - - - - - path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> - path="GWT_TOOLS/redist/json/r2_20080312/json.jar" sourcepath="/GWT_TOOLS/redist/json/r2_20080312/json-src.jar"/> - - path="com.google.gwt.eclipse.core.GWT_CONTAINER/trunk"/> - path="com.google.appengine.eclipse.core.GAE_CONTAINER"/> - - Index: bikeshed/.project === --- bikeshed/.project (revision 7721) +++ bikeshed/.project (working copy) @@ -1,52 +0,0 @@ - - - bikeshed - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.google.gwt.eclipse.core.gwtProjectValidator - - - - - com.google.gdt.eclipse.core.webAppProjectValidator - - - - - com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder - - - - - com.google.appengine.eclipse.core.enhancerbuilder - - - - - com.google.appengine.eclipse.core.projectValidator - - - - - - org.eclipse.jdt.core.javanature - com.google.gwt.eclipse.core.gwtNature - com.google.gdt.eclipse.core.webAppNature - com.atlassw.tools.eclipse.checkstyle.CheckstyleNature - org.eclipse.wst.common.project.facet.core.nature - com.google.appengine.eclipse.core.gaeNature - - -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Begone foul unsharable eclipse detritus.
LGTM On 2010/03/12 22:52:08, Ray Ryan wrote: http://gwt-code-reviews.appspot.com/193801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7723 committed - Begone foul unsharable eclipse detritus....
Revision: 7723 Author: rj...@google.com Date: Fri Mar 12 12:33:38 2010 Log: Begone foul unsharable eclipse detritus. Review at http://gwt-code-reviews.appspot.com/193801 Review by: amitman...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=7723 Deleted: /trunk/bikeshed/.classpath /trunk/bikeshed/.project /trunk/bikeshed/war/WEB-INF/lib === --- /trunk/bikeshed/.classpath Fri Mar 12 07:16:19 2010 +++ /dev/null @@ -1,12 +0,0 @@ - - - - - path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> - path="GWT_TOOLS/redist/json/r2_20080312/json.jar" sourcepath="/GWT_TOOLS/redist/json/r2_20080312/json-src.jar"/> - - path="com.google.gwt.eclipse.core.GWT_CONTAINER/trunk"/> - path="com.google.appengine.eclipse.core.GAE_CONTAINER"/> - - === --- /trunk/bikeshed/.projectFri Mar 12 07:16:19 2010 +++ /dev/null @@ -1,52 +0,0 @@ - - - bikeshed - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.google.gwt.eclipse.core.gwtProjectValidator - - - - - com.google.gdt.eclipse.core.webAppProjectValidator - - - - - com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder - - - - - com.google.appengine.eclipse.core.enhancerbuilder - - - - - com.google.appengine.eclipse.core.projectValidator - - - - - - org.eclipse.jdt.core.javanature - com.google.gwt.eclipse.core.gwtNature - com.google.gdt.eclipse.core.webAppNature - com.atlassw.tools.eclipse.checkstyle.CheckstyleNature - org.eclipse.wst.common.project.facet.core.nature - com.google.appengine.eclipse.core.gaeNature - - -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Disentangles CompilationResult from Permutation.
Permutation is a pretty deeply internal type that shouldn't be exposed. LGTM. http://gwt-code-reviews.appspot.com/194801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Quick inefficient fix for dates
Reviewers: amitmanjhi, Description: Fix dates inefficiently for a moment, pending Date fix to get JSO friendly again Please review this at http://gwt-code-reviews.appspot.com/195801 Affected files: bikeshed/eclipse.README bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java user/super/com/google/gwt/emul/java/util/Date.java Index: bikeshed/eclipse.README === --- bikeshed/eclipse.README (revision 0) +++ bikeshed/eclipse.README (revision 0) @@ -0,0 +1,22 @@ +To make eclipse go: + +* Set svn or git or whatever to exclude the following: + +.settings +.classpath +.project +bin +build +classes +com.google.gwt.* +eclipse-trunk +bikeshed/war/expenses +bikeshed/war/stocks +bikeshed/war/tree + +* Install the Google Plugin for Eclipse +* Import bikeshed as a new Java project with existing source +* Bring up the project properties and find the Google settings, and turn on AppEngine and WebKit +* Copy tools/redist/json/r2_20080312/json.jar to bikeshed/war/WEB_INF/lib +* Right click on the bikeshed project and choose Run as > Web Application. Choose from the various .html files + Index: bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java === --- bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java (revision 7723) +++ bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java (working copy) @@ -15,7 +15,6 @@ */ package com.google.gwt.sample.expenses.client; -import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArray; import com.google.gwt.valuestore.shared.Property; @@ -49,12 +48,13 @@ } if (Date.class.equals(property.getValueType())) { double millis = getDouble(property.getName()); - if (GWT.isScript()) { -return (V) initDate(new Date(), millis); - } else { + //TODO (rjrjr) bring this back when Date gets JSO friendly again +// if (GWT.isScript()) { +//return (V) initDate(new Date(), millis); +// } else { // In dev mode, we're using real JRE dates return (V) new Date((long) millis); - } +// } } return nativeGet(property); @@ -80,10 +80,10 @@ return this[name]; }-*/; - private native Date initDate(Date date, double millis) /*-{ -da...@java.util.date::init(D)(millis); -return date; - }-*/; +// private native Date initDate(Date date, double millis) /*-{ +//da...@java.util.date::init(D)(millis); +//return date; +// }-*/; private native > V nativeGet(P property) /*-{ return this[proper...@com.google.gwt.valuestore.shared.property::getName()()]; Index: user/super/com/google/gwt/emul/java/util/Date.java === --- user/super/com/google/gwt/emul/java/util/Date.java (revision 7723) +++ user/super/com/google/gwt/emul/java/util/Date.java (working copy) @@ -71,7 +71,11 @@ private final JsDate jsdate; public Date() { -jsdate = JsDate.create(); +this(JsDate.create()); + } + + protected Date(JsDate jsdate) { +this.jsdate = jsdate; } public Date(int year, int month, int date) { -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Quick inefficient fix for dates
LGTM On 2010/03/13 00:13:15, Ray Ryan wrote: http://gwt-code-reviews.appspot.com/195801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Add quick-and-dirty wireshark packet dissector for GWT code server
Reviewers: zundel, Description: Add quick-and-dirty wireshark packet dissector for GWT code server protocol. Public review: http://gwt-code-reviews.appspot.com/191801 Patch by: jat Review by: zundel Please review this at http://gwt-code-reviews.appspot.com/196801 Affected files: A plugins/wireshark/Makefile A plugins/wireshark/README.txt A plugins/wireshark/packet-gwtcs.c -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add quick-and-dirty wireshark packet dissector for GWT code server
http://gwt-code-reviews.appspot.com/191801/diff/1/4 File plugins/wireshark/packet-gwtcs.c (right): http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode20 Line 20: * things like declaring all variables at the beginning of a block. On 2010/03/12 22:25:36, zundel wrote: Do you mean to avoid declaring all variables at the beginning of the block or to always declare all variables at the beginning of the block? Clarified. http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode40 Line 40: #define DEFAULT_GWTCS_PORT 9997 On 2010/03/12 22:25:36, zundel wrote: this declaration could be externalized - 9997 is also declared as a constant in ../common/HostChannel.h Not without refactoring the existing code, since the dissector has to be pure C and HostChannel.h is C++. http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode279 Line 279: gint32 i,j; On 2010/03/12 22:25:36, zundel wrote: The use of i,j below is a bit confusing to me. To me it would be clearer to create a third variable to use to walk through the packet (e.g. gint32 offset;) or to create a separate block {} for each case and give the variables meaningful names. (personal style: I usually reserve i,j,k for iterating and would use a different name for storing temp values read from the packet.) Rewrote significantly as part of work to improve packet decoding. http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode366 Line 366: j += 4 + i; On 2010/03/12 22:25:36, zundel wrote: I don't see any bugs, but it seems like you could come up with a little pattern or macro here to make sure the size you increment j by always matches the size passed to proto_tree_add_item. I really hate macros with side effects (since it obscures the update), and without doing that I didn't see anything that would be better than what is there now. http://gwt-code-reviews.appspot.com/191801/diff/1/4#newcode389 Line 389: #if 0 On 2010/03/12 22:25:36, zundel wrote: still need this code? Maybe just leave a comment instead. Was there as part of the skeleton for decoding arguments, so I finished that. http://gwt-code-reviews.appspot.com/191801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] next patch of issue 191801
Reviewers: zundel, Description: For some reason, the auto-upload isn't working to push an update to issue http://gwt-code-reviews.appspot.com/191801 and I am not given the option to manually upload a new patch. Please review this at http://gwt-code-reviews.appspot.com/197801 Affected files: plugins/wireshark/Makefile plugins/wireshark/README.txt plugins/wireshark/packet-gwtcs.c -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add quick-and-dirty wireshark packet dissector for GWT code server
Couldn't update this issue, so I created a new one with the next patch: http://gwt-code-reviews.appspot.com/197801 http://gwt-code-reviews.appspot.com/191801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Quick inefficient fix for dates
http://gwt-code-reviews.appspot.com/195801/diff/1/4 File user/super/com/google/gwt/emul/java/util/Date.java (right): http://gwt-code-reviews.appspot.com/195801/diff/1/4#newcode77 Line 77: protected Date(JsDate jsdate) { I kind of like adding a version that takes a double better, because that way if you don't have a JsDate handy, you don't have to create one. And if you do, you might be wanting to make a defensive copy anyway.. http://gwt-code-reviews.appspot.com/195801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Quick inefficient fix for dates
Scott, I fully intend to com back and do the fix we talked about. This is just an interim check in to fix our build. Thanks for keeping an eye out! http://gwt-code-reviews.appspot.com/195801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Quick inefficient fix for dates
Oh! That wasn't supposed to be in this patch at all! http://gwt-code-reviews.appspot.com/195801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7724 committed - Disentangles CompilationResult from Permutation....
Revision: 7724 Author: sco...@google.com Date: Fri Mar 12 14:12:44 2010 Log: Disentangles CompilationResult from Permutation. http://gwt-code-reviews.appspot.com/194801 Review by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=7724 Modified: /trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardCompilationResult.java === --- /trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java Wed Mar 3 09:01:30 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java Fri Mar 12 14:12:44 2010 @@ -16,7 +16,6 @@ package com.google.gwt.core.ext.linker; import com.google.gwt.core.ext.Linker; -import com.google.gwt.dev.Permutation; import java.util.Map; import java.util.SortedMap; @@ -27,12 +26,9 @@ * result in identical JavaScript. */ public abstract class CompilationResult extends Artifact { - private final Permutation permutation; - - protected CompilationResult(Class linkerType, - Permutation permutation) { + + protected CompilationResult(Class linkerType) { super(linkerType); -this.permutation = permutation; } /** @@ -46,20 +42,11 @@ * runAsync. */ public abstract String[] getJavaScript(); - - /** - * Return the permutation that compiled to this result. - */ - public Permutation getPermutation() { -return permutation; - } /** * Returns the permutation ID. */ - public int getPermutationId() { -return getPermutation().getId(); - } + public abstract int getPermutationId(); /** * Provides values for {...@link SelectionProperty} instances that are not === --- /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java Wed Mar 3 09:01:30 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java Fri Mar 12 14:12:44 2010 @@ -26,8 +26,6 @@ import com.google.gwt.core.ext.linker.ScriptReference; import com.google.gwt.core.ext.linker.SelectionProperty; import com.google.gwt.core.ext.linker.StylesheetReference; -import com.google.gwt.dev.cfg.BindingProperty; -import com.google.gwt.dev.cfg.StaticPropertyOracle; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.collect.HashSet; import com.google.gwt.dev.util.collect.Lists; @@ -163,8 +161,7 @@ + result.getStrongName() + File.separator + i + FRAGMENT_EXTENSION)); } - toReturn.addAll(emitSelectionInformation(result.getPermutation().getId(), -result.getStrongName(), result.getPermutation().getPropertyOracles())); +toReturn.addAll(emitSelectionInformation(result.getStrongName(), result)); return toReturn; } @@ -434,18 +431,14 @@ } } - private List> emitSelectionInformation(int id, String strongName, - StaticPropertyOracle[] staticPropertyOracles) { + private List> emitSelectionInformation(String strongName, + CompilationResult result) { List> emitted = new ArrayList>(); -for (int propOracleId = 0; propOracleId < staticPropertyOracles.length; propOracleId++) { - StaticPropertyOracle propOracle = staticPropertyOracles[propOracleId]; +for (SortedMap propertyMap : result.getPropertyMap()) { TreeMap propMap = new TreeMap(); - - BindingProperty[] orderedProps = propOracle.getOrderedProps(); - String[] orderedPropValues = propOracle.getOrderedPropValues(); - for (int i = 0; i < orderedProps.length; i++) { -propMap.put(orderedProps[i].getName(), orderedPropValues[i]); + for (Map.Entry entry : propertyMap.entrySet()) { +propMap.put(entry.getKey().getName(), entry.getValue()); } emitted.add(new SelectionInformation(strongName, propMap)); } === --- /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardCompilationResult.java Wed Mar 3 09:01:30 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardCompilationResult.java Fri Mar 12 14:12:44 2010 @@ -19,7 +19,6 @@ import com.google.gwt.core.ext.linker.SelectionProperty; import com.google.gwt.core.ext.linker.StatementRanges; import com.google.gwt.core.ext.linker.SymbolData; -import com.google.gwt.dev.Permutation; import com.google.gwt.dev.jjs.PermutationResult; import com.google.gwt.dev.util.DiskCache; import com.google.gwt.dev.util.Util; @@ -84,18 +83,20 @@ private final long symbolToken; + private final int permutationId; + public StandardCompilationResult(PermutationResult permutationResult) { -super(StandardLinkerContext.class, permutationResult.getPermutation()); +super(StandardLinkerContext.class); byte[][] js = permutationResult.getJs(); -strongName = Util.computeStrongName(js); +this
[gwt-contrib] Mass renaming and segration of "code generated" Impl
Reviewers: amitmanjhi, Description: Mass renaming and segration of "code generated" Impl classes from "tool generated" public api Despite appearances, this is all mechanical moves, except for the introduction of the @LongString and @ServerType annotations. Review by: amitman...@google.com Please review this at http://gwt-code-reviews.appspot.com/198801 Affected files: D bikeshed/src/com/google/gwt/requestfactory/shared/Entity.java A bikeshed/src/com/google/gwt/requestfactory/shared/EntityRef.java A bikeshed/src/com/google/gwt/requestfactory/shared/FieldRef.java A bikeshed/src/com/google/gwt/requestfactory/shared/LongString.java A bikeshed/src/com/google/gwt/requestfactory/shared/ServerType.java D bikeshed/src/com/google/gwt/requestfactory/shared/Slot.java A bikeshed/src/com/google/gwt/requestfactory/shared/SyncRequest.java M bikeshed/src/com/google/gwt/sample/expenses/Expenses.gwt.xml M bikeshed/src/com/google/gwt/sample/expenses/client/EmployeeList.java M bikeshed/src/com/google/gwt/sample/expenses/client/Expenses.java M bikeshed/src/com/google/gwt/sample/expenses/client/Shell.java D bikeshed/src/com/google/gwt/sample/expenses/domain/CreationVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Currency.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Employee.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Entity.java D bikeshed/src/com/google/gwt/sample/expenses/domain/EntityVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/NullFieldFiller.java D bikeshed/src/com/google/gwt/sample/expenses/domain/RelationshipRefreshingVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/RelationshipValidationVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Report.java D bikeshed/src/com/google/gwt/sample/expenses/domain/ReportItem.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Status.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Storage.java A bikeshed/src/com/google/gwt/sample/expenses/gen/EmployeeRequestImpl.java A bikeshed/src/com/google/gwt/sample/expenses/gen/ExpenseRequestFactoryImpl.java A bikeshed/src/com/google/gwt/sample/expenses/gen/MethodName.java A bikeshed/src/com/google/gwt/sample/expenses/gen/ReportRequestImpl.java M bikeshed/src/com/google/gwt/sample/expenses/server/ExpensesDataServlet.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/CreationVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Currency.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Employee.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Entity.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/EntityVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/NullFieldFiller.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/RelationshipRefreshingVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/RelationshipValidationVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Report.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/ReportItem.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Status.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Storage.java D bikeshed/src/com/google/gwt/sample/expenses/shared/Employee.java A bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRef.java D bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRequests.java M bikeshed/src/com/google/gwt/sample/expenses/shared/ExpenseRequestFactory.java D bikeshed/src/com/google/gwt/sample/expenses/shared/MethodName.java D bikeshed/src/com/google/gwt/sample/expenses/shared/Report.java A bikeshed/src/com/google/gwt/sample/expenses/shared/ReportRef.java D bikeshed/src/com/google/gwt/sample/expenses/shared/ReportRequests.java D bikeshed/src/com/google/gwt/sample/expenses/shared/SyncRequest.java D bikeshed/test/com/google/gwt/sample/expenses/domain/CreationVisitorTest.java D bikeshed/test/com/google/gwt/sample/expenses/domain/EntityTester.java D bikeshed/test/com/google/gwt/sample/expenses/domain/NullFieldFillerTest.java D bikeshed/test/com/google/gwt/sample/expenses/domain/StorageTest.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/CreationVisitorTest.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/EntityTester.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/NullFieldFillerTest.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/StorageTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r7725 committed - Fix dates inefficiently for a moment, pending Date fix to get JSO...
Revision: 7725 Author: rj...@google.com Date: Fri Mar 12 14:33:11 2010 Log: Fix dates inefficiently for a moment, pending Date fix to get JSO friendly again http://gwt-code-reviews.appspot.com/195801 Review by: amitman...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=7725 Added: /trunk/bikeshed/eclipse.README Modified: /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java === --- /dev/null +++ /trunk/bikeshed/eclipse.README Fri Mar 12 14:33:11 2010 @@ -0,0 +1,22 @@ +To make eclipse go: + +* Set svn or git or whatever to exclude the following: + +.settings +.classpath +.project +bin +build +classes +com.google.gwt.* +eclipse-trunk +bikeshed/war/expenses +bikeshed/war/stocks +bikeshed/war/tree + +* Install the Google Plugin for Eclipse +* Import bikeshed as a new Java project with existing source +* Bring up the project properties and find the Google settings, and turn on AppEngine and WebKit +* Copy tools/redist/json/r2_20080312/json.jar to bikeshed/war/WEB_INF/lib +* Right click on the bikeshed project and choose Run as > Web Application. Choose from the various .html files + === --- /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java Fri Mar 12 09:35:24 2010 +++ /trunk/bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java Fri Mar 12 14:33:11 2010 @@ -15,7 +15,6 @@ */ package com.google.gwt.sample.expenses.client; -import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArray; import com.google.gwt.valuestore.shared.Property; @@ -49,12 +48,13 @@ } if (Date.class.equals(property.getValueType())) { double millis = getDouble(property.getName()); - if (GWT.isScript()) { -return (V) initDate(new Date(), millis); - } else { + //TODO (rjrjr) bring this back when Date gets JSO friendly again +// if (GWT.isScript()) { +//return (V) initDate(new Date(), millis); +// } else { // In dev mode, we're using real JRE dates return (V) new Date((long) millis); - } +// } } return nativeGet(property); @@ -80,10 +80,10 @@ return this[name]; }-*/; - private native Date initDate(Date date, double millis) /*-{ -da...@java.util.date::init(D)(millis); -return date; - }-*/; +// private native Date initDate(Date date, double millis) /*-{ +//da...@java.util.date::init(D)(millis); +//return date; +// }-*/; private native > V nativeGet(P property) /*-{ return this[proper...@com.google.gwt.valuestore.shared.property::getName()()]; -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Mass renaming and segration of "code generated" Impl
LGTM. Those 2 additional files look good and I'm assuming everything else is fine. Please run checkstyle before commiting. On 2010/03/13 01:47:23, Ray Ryan wrote: http://gwt-code-reviews.appspot.com/198801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Quick inefficient fix for dates
Heh, ok, I had a feeling maybe not. :) On Fri, Mar 12, 2010 at 8:24 PM, wrote: > Oh! That wasn't supposed to be in this patch at all! > > > http://gwt-code-reviews.appspot.com/195801 > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Mass renaming and segration of "code generated" Impl
Reviewers: amitmanjhi, Description: Mass renaming and segration of "code generated" Impl classes from "tool generated" public api Despite appearances, this is all mechanical moves, except for the introduction of the @LongString and @ServerType annotations. Review at http://gwt-code-reviews.appspot.com/198801 Review by: amitman...@google.com Please review this at http://gwt-code-reviews.appspot.com/199801 Affected files: D bikeshed/src/com/google/gwt/requestfactory/shared/Entity.java A bikeshed/src/com/google/gwt/requestfactory/shared/EntityRef.java A bikeshed/src/com/google/gwt/requestfactory/shared/FieldRef.java A bikeshed/src/com/google/gwt/requestfactory/shared/LongString.java A bikeshed/src/com/google/gwt/requestfactory/shared/RequestFactory.java A bikeshed/src/com/google/gwt/requestfactory/shared/ServerType.java D bikeshed/src/com/google/gwt/requestfactory/shared/Slot.java A bikeshed/src/com/google/gwt/requestfactory/shared/SyncRequest.java M bikeshed/src/com/google/gwt/sample/expenses/Expenses.gwt.xml M bikeshed/src/com/google/gwt/sample/expenses/client/EmployeeList.java M bikeshed/src/com/google/gwt/sample/expenses/client/Expenses.java M bikeshed/src/com/google/gwt/sample/expenses/client/Shell.java M bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java D bikeshed/src/com/google/gwt/sample/expenses/domain/CreationVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Currency.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Employee.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Entity.java D bikeshed/src/com/google/gwt/sample/expenses/domain/EntityVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/NullFieldFiller.java D bikeshed/src/com/google/gwt/sample/expenses/domain/RelationshipRefreshingVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/RelationshipValidationVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Report.java D bikeshed/src/com/google/gwt/sample/expenses/domain/ReportItem.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Status.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Storage.java A bikeshed/src/com/google/gwt/sample/expenses/gen/EmployeeRequestImpl.java A bikeshed/src/com/google/gwt/sample/expenses/gen/ExpenseRequestFactoryImpl.java A bikeshed/src/com/google/gwt/sample/expenses/gen/MethodName.java A bikeshed/src/com/google/gwt/sample/expenses/gen/ReportRequestImpl.java M bikeshed/src/com/google/gwt/sample/expenses/server/ExpensesDataServlet.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/CreationVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Currency.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Employee.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Entity.java bikeshed/src/com/google/gwt/sample/expenses/server/domain/EntityVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/NullFieldFiller.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/RelationshipRefreshingVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/RelationshipValidationVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Report.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/ReportItem.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Status.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Storage.java bikeshed/src/com/google/gwt/sample/expenses/shared/Employee.java A bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRef.java D bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRequests.java M bikeshed/src/com/google/gwt/sample/expenses/shared/ExpenseRequestFactory.java bikeshed/src/com/google/gwt/sample/expenses/shared/MethodName.java D bikeshed/src/com/google/gwt/sample/expenses/shared/Report.java A bikeshed/src/com/google/gwt/sample/expenses/shared/ReportRef.java D bikeshed/src/com/google/gwt/sample/expenses/shared/ReportRequests.java D bikeshed/src/com/google/gwt/sample/expenses/shared/SyncRequest.java M bikeshed/src/com/google/gwt/valuestore/shared/ValueStore.java D bikeshed/test/com/google/gwt/sample/expenses/domain/CreationVisitorTest.java D bikeshed/test/com/google/gwt/sample/expenses/domain/EntityTester.java D bikeshed/test/com/google/gwt/sample/expenses/domain/NullFieldFillerTest.java D bikeshed/test/com/google/gwt/sample/expenses/domain/StorageTest.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/CreationVisitorTest.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/EntityTester.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/NullFieldFillerTest.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/StorageTest.java -- http://groups.google.com/gro
[gwt-contrib] Re: Mass renaming and segration of "code generated" Impl
Abandoning this issue, appears to be corrupted. http://gwt-code-reviews.appspot.com/199801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Introduces RequestFactory interface and "tool generated"
Reviewers: amitmanjhi, Description: Introduces RequestFactory interface and "tool generated" interface ExpenseRequestFactory. Moves old ExpenseRequestFactory class to become "code generated" ExpenseRequestFactoryImpl, in new package gen. Introduces @LongString and @ServerType annotations Various other renames: Entity > EntityRef, and Ref suffix added to clients side entities to avoid confusion with server side. Lots of checkstyle Review by: amitman...@google.com Please review this at http://gwt-code-reviews.appspot.com/200801 Affected files: D bikeshed/src/com/google/gwt/requestfactory/shared/Entity.java A bikeshed/src/com/google/gwt/requestfactory/shared/EntityRef.java A bikeshed/src/com/google/gwt/requestfactory/shared/FieldRef.java A bikeshed/src/com/google/gwt/requestfactory/shared/LongString.java A bikeshed/src/com/google/gwt/requestfactory/shared/RequestFactory.java A bikeshed/src/com/google/gwt/requestfactory/shared/ServerType.java D bikeshed/src/com/google/gwt/requestfactory/shared/Slot.java A bikeshed/src/com/google/gwt/requestfactory/shared/SyncRequest.java M bikeshed/src/com/google/gwt/sample/expenses/Expenses.gwt.xml M bikeshed/src/com/google/gwt/sample/expenses/client/EmployeeList.java M bikeshed/src/com/google/gwt/sample/expenses/client/Expenses.java M bikeshed/src/com/google/gwt/sample/expenses/client/Shell.java M bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java D bikeshed/src/com/google/gwt/sample/expenses/domain/CreationVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Currency.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Employee.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Entity.java D bikeshed/src/com/google/gwt/sample/expenses/domain/EntityVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/NullFieldFiller.java D bikeshed/src/com/google/gwt/sample/expenses/domain/RelationshipRefreshingVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/RelationshipValidationVisitor.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Report.java D bikeshed/src/com/google/gwt/sample/expenses/domain/ReportItem.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Status.java D bikeshed/src/com/google/gwt/sample/expenses/domain/Storage.java A bikeshed/src/com/google/gwt/sample/expenses/gen/EmployeeRequestImpl.java A bikeshed/src/com/google/gwt/sample/expenses/gen/ExpenseRequestFactoryImpl.java A bikeshed/src/com/google/gwt/sample/expenses/gen/MethodName.java A bikeshed/src/com/google/gwt/sample/expenses/gen/ReportRequestImpl.java M bikeshed/src/com/google/gwt/sample/expenses/server/ExpensesDataServlet.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/CreationVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Currency.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Employee.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Entity.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/EntityVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/NullFieldFiller.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/RelationshipRefreshingVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/RelationshipValidationVisitor.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Report.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/ReportItem.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Status.java A bikeshed/src/com/google/gwt/sample/expenses/server/domain/Storage.java D bikeshed/src/com/google/gwt/sample/expenses/shared/Employee.java A bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRef.java D bikeshed/src/com/google/gwt/sample/expenses/shared/EmployeeRequests.java M bikeshed/src/com/google/gwt/sample/expenses/shared/ExpenseRequestFactory.java D bikeshed/src/com/google/gwt/sample/expenses/shared/MethodName.java D bikeshed/src/com/google/gwt/sample/expenses/shared/Report.java A bikeshed/src/com/google/gwt/sample/expenses/shared/ReportRef.java D bikeshed/src/com/google/gwt/sample/expenses/shared/ReportRequests.java D bikeshed/src/com/google/gwt/sample/expenses/shared/SyncRequest.java M bikeshed/src/com/google/gwt/valuestore/shared/ValueStore.java D bikeshed/test/com/google/gwt/sample/expenses/domain/CreationVisitorTest.java D bikeshed/test/com/google/gwt/sample/expenses/domain/EntityTester.java D bikeshed/test/com/google/gwt/sample/expenses/domain/NullFieldFillerTest.java D bikeshed/test/com/google/gwt/sample/expenses/domain/StorageTest.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/CreationVisitorTest.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/EntityTester.java A bikeshed/test/com/google/gwt/sample/expenses/server/domain/NullField
[gwt-contrib] Re: Introduces RequestFactory interface and "tool generated"
http://gwt-code-reviews.appspot.com/200801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Introduces RequestFactory interface and "tool generated"
LGTM http://gwt-code-reviews.appspot.com/200801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Introduces RequestFactory interface and "tool generated"
The LongString and ServerType annotation files look good. btw, I was unable to view some diffs. But the diff looked okay for the files I checked. On 2010/03/13 03:54:27, amitmanjhi wrote: LGTM http://gwt-code-reviews.appspot.com/200801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Introduces RequestFactory interface and "tool generated"
http://gwt-code-reviews.appspot.com/200801 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Removes trivially-delegating clinits, plus some
Reviewers: Lex, cromwellian, Message: Hey guys, I was working on a patch to JsInlining and it really started to bug me how many silly clinits are just hanging around. So I wrote this patch that does a couple of neat things: 1) A trivial clinit that merely delegates to a superclass doesn't emit code; instead, call sites that would have targeted the subclass will target the superclass instead. 2) As an added bonus, in situations where you have two classes that sharing a supertype, where only the supertype has a clinit, calls between the two classes won't trigger clinit checks anymore. This also works when a supetype calls into a subtype when only the supertype has a clinit, which is exactly the case that enums are currently tripping over. Description: Hey guys, I was working on a patch to JsInlining and it really started to bug me how many silly clinits are just hanging around. So I wrote this patch that does a couple of neat things: 1) A trivial clinit that merely delegates to a superclass doesn't emit code; instead, call sites that would have targeted the subclass will target the superclass instead. 2) As an added bonus, in situations where you have two classes that sharing a supertype, where only the supertype has a clinit, calls between the two classes won't trigger clinit checks anymore. This also works when a supetype calls into a subtype when only the supertype has a clinit, which is exactly the case that enums are currently tripping over. Please review this at http://gwt-code-reviews.appspot.com/184802 Affected files: M dev/core/src/com/google/gwt/dev/jjs/ast/JDeclaredType.java M dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java M dev/core/src/com/google/gwt/dev/jjs/impl/DeadCodeElimination.java M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java M dev/core/src/com/google/gwt/dev/jjs/impl/MethodInliner.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Only setup prototypes on constructors which are the direct target of new operations.
Reviewers: Lex, cromwellian, Description: This is a simple change to removes the need to install a prototype on constructors which are merely used as targets of super()/this() calls. Please review this at http://gwt-code-reviews.appspot.com/176802 Affected files: M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Allow static-dispatch style JS .call invocations to be inlined.
Reviewers: Lex, cromwellian, Description: This is particularly relevant because super()/this() calls get translated as .call() ops, and this patch lets us inline them into the calling constructor. Please review this at http://gwt-code-reviews.appspot.com/201801 Affected files: M dev/core/src/com/google/gwt/dev/js/JsHoister.java M dev/core/src/com/google/gwt/dev/js/JsInliner.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Once again allow Dates from doubles, for JSON happiness
Reviewers: scottb, Description: Once again allow Dates from doubles, for JSON happiness Review by: sco...@google.com Please review this at http://gwt-code-reviews.appspot.com/202801 Affected files: M bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java M user/super/com/google/gwt/emul/java/util/Date.java Index: bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java === --- bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java (revision 7725) +++ bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java (working copy) @@ -15,6 +15,7 @@ */ package com.google.gwt.valuestore.client; +import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArray; import com.google.gwt.valuestore.shared.Property; @@ -48,13 +49,12 @@ } if (Date.class.equals(property.getValueType())) { double millis = getDouble(property.getName()); - // TODO (rjrjr) bring this back when Date gets JSO friendly again -// if (GWT.isScript()) { -//return (V) initDate(new Date(), millis); -// } else { + if (GWT.isScript()) { +return (V) dateForDouble(millis); + } else { // In dev mode, we're using real JRE dates return (V) new Date((long) millis); -// } + } } return nativeGet(property); @@ -89,10 +89,9 @@ return this[name]; }-*/; -// private native Date initDate(Date date, double millis) /*-{ -//da...@java.util.date::init(D)(millis); -//return date; -// }-*/; + private native Date dateForDouble(double millis) /*-{ +return @java.util.Date::createFrom(D)(millis); + }-*/; private native int getInt(String name) /*-{ return this[name]; Index: user/super/com/google/gwt/emul/java/util/Date.java === --- user/super/com/google/gwt/emul/java/util/Date.java (revision 7725) +++ user/super/com/google/gwt/emul/java/util/Date.java (working copy) @@ -93,6 +93,21 @@ jsdate = JsDate.create(date); } + /** + * Package private factory for JSNI use, to allow cheap creation of dates from + * doubles. + */ + static Date createFrom(double milliseconds) { +return new Date(milliseconds, false); + } + + /** + * For use by {...@link #createFrom(double)}, should inline away. + */ + Date(double milliseconds, boolean dummyArgForOverloadResolution) { +jsdate = JsDate.create(milliseconds); + } + public Date(String date) { this(Date.parse(date)); } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors