Re: Why isn't Anchor a container?
On Saturday, June 4, 2011 4:05:04 AM UTC+2, Jeff Schnitzer wrote: On Fri, Jun 3, 2011 at 5:48 PM, Thomas Broyer t.br...@gmail.com wrote: It's not impossible today to do it so it's OK as a limitation: GWT let's you do it, not as easily as you'd have wished, but still (even though in most case you really don't need it, I mean, I couldn't find a single use case for a widget within an anchor that wouldn't have a better alternative) I guess this is what I find most confusing. I have wanted this on multiple occasions - I often have an anchor whose content is programmatically determined. It may contain image resources. I just want to stuff the anchor with any of several widgets rather than mucking about with HTML text. This seems like a common case. What design patterns should I use instead? Widgets have a (performance) cost; I try to avoid them unless I do need them. For everything else, I use HTMLPanel (with UiBinder), Messages, SafeHtmlTemplates and/or ClientBundle/ImageResource/CssResource. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/aHJyNkY0aEpFeFlK. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Html website - GWT
Ricky, I would really encourage you to put your website aside, and spend some time learning GWT. That will really position you to then look at your website and consider whether it makes sense to head down the GWT path. -Brett On Saturday, 4 June 2011 13:52:20 UTC+10, Ricky Button wrote: I have an entire html website, all static content, and I want to make it dynamic by using GWT/GAE. How should I go about using this html to create a website with GWT that is about half static and half dynamic content? Thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/SUFNdWVKSTh3Nm9K. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Simulating button click in GWT Unit test?
I have to simulate a button click on a button that is created in a GWT Unit test (that extends from GWTTestCase). However, it's almost impossible to get a direct reference to the button to simulate the click directly on the button event. The button, however, has a unique id through the HTML tag id property. Is there away to find the button element and then simulate the button click in a GWT Unit test ? I am not sure how to do this. Finding the element through Document.get().getElementById(bla) I don't think works as RootPanel.get() doesn't contain the expected application elements but rather GWT Junit stuff...? :( And then how to simulate a button click on the found element :(... Please some advice? - Ed -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Simulating button click in GWT Unit test?
Shouldn't this test be an acceptance test run by something like selenium, instead of using GWTTestCase? On Sat, Jun 4, 2011 at 10:51 AM, Ed post2edb...@gmail.com wrote: I have to simulate a button click on a button that is created in a GWT Unit test (that extends from GWTTestCase). However, it's almost impossible to get a direct reference to the button to simulate the click directly on the button event. The button, however, has a unique id through the HTML tag id property. Is there away to find the button element and then simulate the button click in a GWT Unit test ? I am not sure how to do this. Finding the element through Document.get().getElementById(bla) I don't think works as RootPanel.get() doesn't contain the expected application elements but rather GWT Junit stuff...? :( And then how to simulate a button click on the found element :(... Please some advice? - Ed -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- Magno Machado Paulo http://blog.magnomachado.com.br http://code.google.com/p/emballo/ -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Simulating button click in GWT Unit test?
Shouldn't this test be an acceptance test run by something like selenium, instead of using GWTTestCase? It's also run by Selenium under different circumstances (that's why it has an idea). So you know how to do the above test? On Jun 4, 4:06 pm, Magno Machado magn...@gmail.com wrote: Shouldn't this test be an acceptance test run by something like selenium, instead of using GWTTestCase? On Sat, Jun 4, 2011 at 10:51 AM, Ed post2edb...@gmail.com wrote: I have to simulate a button click on a button that is created in a GWT Unit test (that extends from GWTTestCase). However, it's almost impossible to get a direct reference to the button to simulate the click directly on the button event. The button, however, has a unique id through the HTML tag id property. Is there away to find the button element and then simulate the button click in a GWT Unit test ? I am not sure how to do this. Finding the element through Document.get().getElementById(bla) I don't think works as RootPanel.get() doesn't contain the expected application elements but rather GWT Junit stuff...? :( And then how to simulate a button click on the found element :(... Please some advice? - Ed -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- Magno Machado Paulohttp://blog.magnomachado.com.brhttp://code.google.com/p/emballo/ -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Simulating button click in GWT Unit test?
Can you directly call the click handler in the activity. If you are testing the functionality that seems the best place to test. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/dXNDVURLd0UxRVlK. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
How to set background color for button?
Hello, how to change the background color of a ToggleButton? I want to have ToggleButtons in various colours displayed on my page. The buttons are actually for choosing a color in the application. regards, Lars -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Simulating button click in GWT Unit test?
On 06/04/2011 06:51 AM, Ed wrote: I have to simulate a button click on a button that is created in a GWT Unit test (that extends from GWTTestCase). However, it's almost impossible to get a direct reference to the button to simulate the click directly on the button event. The button, however, has a unique id through the HTML tag id property. Is there away to find the button element and then simulate the button click in a GWT Unit test ? I am not sure how to do this. Finding the element through Document.get().getElementById(bla) I don't think works as RootPanel.get() doesn't contain the expected application elements but rather GWT Junit stuff...? :( And then how to simulate a button click on the found element :(... Please some advice? - Ed Create a MouseOutEvent. You'll want to modify to fit your circumstances. This includes locating tb. final Button tb; /* * Synthesize and fire an event */ final NativeEvent evt = Document.get().createMouseOutEvent(1 /* detail */ , 0 /* screenX */ , 0 /* screenY */ , 0 /* clientX */ , 0 /* clientY */ , false /* ctrlKey */ , false /* altKey */ , false /* shiftKey */ , false /* metaKey */ , NativeEvent.BUTTON_LEFT /* button */ , null /* relatedTarget */); tb.getElement().dispatchEvent(evt); -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT Designer Eclipse Problem
Which are versions of your Ubuntu, GWT GWT Designer? Have you got WebKitGTK libs installed? On Jun 4, 2:21 pm, Noor baken...@gmail.com wrote: Hi, I am using Ubuntu , Eclipse 3.5 with GWT designer. But when I placing a control on the my interface, the whole interface is becomming black, I have installed Eclipse 3.6 and getting the same problem Snapshot:http://i.stack.imgur.com/Z8jwD.png -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Simulating button click in GWT Unit test?
How about: myButton.getElement().ButtonElementcast().click() ? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/WFExLXQ0NXdxSWdK. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Medical Emergency - please read
Hi Friends Kindly do some donation for the Medical Exigency for my Uncle for Legs Bone replacement, it is cost around 3lks for both the legs, he doesn,t have an Income. I kindly reqeuest you to help him from your side As much as possible, a small amount all so will be help full for him, cascade the information to all your friens Please send it to the below account number, I will make sure it will reach that person Name : SANAKR RAVICHANDRAN Account Number :025101518056 Bank :ICICI Branch : Jayanagar 7th Block Kindly Help Dear Friends, I request all Colleagues to extend the financial help for Mourthy ( Patent Name) and his family in this hour of need. Any smallest contribution/help from all of us can be of great help for him. Pleae kindly let me know if you have any questions on my mobile number 9731966355 Warm Regards Sankar Ravichandran -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Shortcomings in Places
I'm trying to implement a simple pattern that is *very* common in the world of normal webapps: 1) Most of my application requires authentication in order to access. 2) I allow deep links to protected content. 3) When visiting a deep link, you are given a login page - after logging in, you get the content. I have a single-page GWT app that uses Places. I've spent a lot of time on this issue, and I *almost* have it working - but it's not elegant and there are still broken edge cases. If you want to experience it firsthand, visit http://www.similarity.com/#matches: The specific issues with the Places system are: * The default place is different in authenticated mode vs anonymous mode. When you are anonymous, your default place is the hello, stranger place but when you're logged in, the default place is all about your account. Since I can't reset the default place in the PlaceHistoryHandler, I need to swap out the instance when I switch modes. * The PlaceController has no way to reset the current place. When an anonymous user tries to go to the #matches: link, the place is set to MatchesPlace (which my special handler translates into a you must log in first message). When the user logs in, I force another handleCurrentHistory(), but it doesn't actually do anything - because the PlaceController is already at MatchesPlace. I'll have to swap out the PlaceController instance when I switch modes. And now a little rant: All in all, this seems ludicrously difficult for something I could have done with dozen lines of code if I wasn't trying to use the standard GWT tools. I feel like I've wasted a lot of time learning the system, and what I've ultimately learned is that I would be better off building it from scratch. Am I the only one that thinks the Places system is WAY over-engineered, yet not all that useful? Jeff -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
CellTable Column Sort
Hi, I have a custom Header. In the header I have a Cell that is similar to TextInputCell. When I make the column sortable, and I click inside the text box, the column sorts and the text box looses focus. I tried adding a click to the listening events to stop the event propagation, but the onBrowserEvent for the cell is called after the sorting happens. Any ideas on how to prevent the sorting from happening when selecting the text box? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Layout Panels, IE, and PX vs EM bug
Check out http://code.google.com/p/google-web-toolkit/issues/detail?id=5220 Seems to be the same thing. Hasn't been resolved yet. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/d0pIR0xKNnNpSzhK. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Minimizing CellTable height inside center area of DockLayoutPanel
Hi, I'm using a DockLayoutPanel for my app's main panel. In the center area, I'd like to display a CellTable. However I'm struggling with layout. With my current code, if the CellTable has few rows - not enough to fill the height of the center area - the table header expands to fill the entire center panel. I'd like to have the table header be just large enough to display the header text, and then vertically align at the top of of the center area. |--- | Menu Bar | | Column1 Column2 Column 3 |- | | (empty space if no row data) | |- How is this best accomplished? Maybe I'm doing this wrong and I should be doing some entirely different layout widget. I'm using FireFox 4.0.1, not sure if that matters. - Todd Sample code: package com.somecompany.sample.client; import java.util.Date; import com.google.gwt.cell.client.DateCell; import com.google.gwt.cell.client.NumberCell; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.cellview.client.CellTable; import com.google.gwt.user.cellview.client.Column; import com.google.gwt.user.cellview.client.TextColumn; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.DockLayoutPanel; import com.google.gwt.user.client.ui.MenuBar; import com.google.gwt.user.client.ui.MenuItem; import com.google.gwt.user.client.ui.RootLayoutPanel; import com.google.gwt.user.client.ui.Widget; /** * Entry point classes define codeonModuleLoad()/code. */ public class SampleLayout implements EntryPoint { /** * Keep a convenience handle on the root panel */ public RootLayoutPanel rootLayoutPanel; /** * This is the main panel for the application */ public DockLayoutPanel dockLayoutPanel; /** * Keep a handle on the dock panel's center widget, we want to change this dynamically */ public Widget dockPanelMainWidget; /** * Show just the menu bar when app is initially loaded */ public void onModuleLoad() { rootLayoutPanel = RootLayoutPanel.get(); dockLayoutPanel = new DockLayoutPanel(Unit.EM); rootLayoutPanel.add(dockLayoutPanel); MenuBar menuBar = new MenuBar(false); dockLayoutPanel.addNorth(menuBar, 2); MenuBar menuBar_1 = new MenuBar(true); MenuItem mntmFile = new MenuItem(File, false, menuBar_1); MenuItem mntmRetrieveFiles = new MenuItem(Save, false, (Command) null); menuBar_1.addItem(mntmRetrieveFiles); MenuItem mntmAddLocations = new MenuItem(Edit, false, new EditCommand()); menuBar_1.addItem(mntmAddLocations); menuBar.addItem(mntmFile); } /** * Local private class to store the File locations we're going to display */ private class FileLocation { public String serverName; public String directoryName; public Integer numFiles; public DatelastSearched; public FileLocation(String serverName, String directoryName, Integer numFiles, Date lastSearched) { this.serverName = serverName; this.directoryName = directoryName; this.numFiles = numFiles; this.lastSearched = lastSearched; } } /** * GUI commend executed from menu items to edit file locations */ public class EditCommand implements Command { public void execute() { SampleLayout.this.showLocationsGrid(); } } /** * Show the list of root locations we search for files in */ public void showLocationsGrid() { /* delete the contents of the current browser pain */ if (dockPanelMainWidget != null) { dockLayoutPanel.remove(dockPanelMainWidget); } /* add new contents - ie a grid that lists locations to search */ CellTableFileLocation table = new CellTableFileLocation(); // Add a text column to show the server name TextColumnFileLocation serverNameColumn = new TextColumnFileLocation() { @Override public String getValue(FileLocation object) { return object.serverName; } }; table.addColumn(serverNameColumn, Server Name); // add a text column to show the directory name TextColumnFileLocation directoryNameColumn = new TextColumnFileLocation() { @Override public String getValue(FileLocation object) { return object.directoryName; } }; table.addColumn(serverNameColumn, Server Name); // add an integer column to show the number of Files in that location NumberCell numberCell = new NumberCell(); ColumnFileLocation, Number numberColumn = new ColumnFileLocation, Number(numberCell) { @Override public Integer getValue(FileLocation object) { return object.numFiles; } }; table.addColumn(numberColumn, Num Files); // add an date column to show the last time the location was searched for new Files DateCell dateCell = new DateCell();
Re: Shortcomings in Places
Hi Jeff, Glad to see someone else voice the same frustrations that I had to work through with getting Places to work for me. You are right, the pattern of substituting a login form for content is so very common. Here are some tips on how I handled the situation: - Have an method on the authentication state machine that determines the 'default' place to be A or B or whatever is best for the user. I called it CurrentState.getHomePlace() - Create an abstract subclass of Place for all places that require authentication. For the main region ActivityMapper, try this piece of logic @Override public Activity getActivity(Place place) { //- // check if the user is authenticated and the place requires it if ( place instanceof AuthenticatedPlace !currentState.isLoggedIn() ) { logger.warning(unauthenticated place violation, displaying login); LoginFormActivity loginForm = loginFormActivityProvider.get(); // add place holder to capture current login parameter to forward to... currentState.setForwardLoginTo(place); return loginForm; } if( place.equals( Place.NOWHERE ) ) { // should redirect auto-login user to proper home place logger.info( place = NOWHERE ); place = currentState.getHomePlace(); } - and to get around the caching of the place after authenticating, instead of using PlaceController.goTo(), bypass the place caching by forcing a PlaceChangeEvent to the final destination eventBus.fireEvent( new PlaceChangeEvent( currentState.getForwardLoginToPlace() )); - I also set up an auto-login function using hashed cookies which requires a round trip with the server. The ActivityMapper forces the display to show the login form while the auto-login pops up a dialog box saying login is in process. When the auto-login succeeds, it clears the dialog and uses the currentState.forwardLoginToPlace to put the user in the right place. Otherwise the user just sees the login form and proceeds from there. - My next issue with places is validating that the object context built by the parameters (object ids) should be visible to that authenticated user. Currently my Activity.start() is doing all the checking and the code seems different for every page. Would like to see it handled in a semi-generic sense instead of down in the weeds. On Sat, Jun 4, 2011 at 2:47 PM, Jeff Schnitzer j...@infohazard.org wrote: I'm trying to implement a simple pattern that is *very* common in the world of normal webapps: 1) Most of my application requires authentication in order to access. 2) I allow deep links to protected content. 3) When visiting a deep link, you are given a login page - after logging in, you get the content. I have a single-page GWT app that uses Places. I've spent a lot of time on this issue, and I *almost* have it working - but it's not elegant and there are still broken edge cases. If you want to experience it firsthand, visit http://www.similarity.com/#matches: The specific issues with the Places system are: * The default place is different in authenticated mode vs anonymous mode. When you are anonymous, your default place is the hello, stranger place but when you're logged in, the default place is all about your account. Since I can't reset the default place in the PlaceHistoryHandler, I need to swap out the instance when I switch modes. * The PlaceController has no way to reset the current place. When an anonymous user tries to go to the #matches: link, the place is set to MatchesPlace (which my special handler translates into a you must log in first message). When the user logs in, I force another handleCurrentHistory(), but it doesn't actually do anything - because the PlaceController is already at MatchesPlace. I'll have to swap out the PlaceController instance when I switch modes. And now a little rant: All in all, this seems ludicrously difficult for something I could have done with dozen lines of code if I wasn't trying to use the standard GWT tools. I feel like I've wasted a lot of time learning the system, and what I've ultimately learned is that I would be better off building it from scratch. Am I the only one that thinks the Places system is WAY over-engineered, yet not all that useful? Jeff -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- -- A. Stevko === If everything seems under control, you're just not going fast enough. M. Andretti -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to
Re: JSNI and Flex Intercommunication Problem (through Javascript Interface)
Oops, forgot to report back just in case anyone else has this problem. My solution was just to make sure that any array objects created by GWT are done with new $wnd.Array(), as nino hinted. Weirdly there are no type conversion errors with Function objects or normal javascript Object. On May 26, 6:34 pm, nino jazzmatad...@googlemail.com wrote: Sorry i got back at you this late. You allready spot the problem. try doing somethinf like this var network_json = new $wnd.Object(); network_json.data = { data: { nodes: [ { id: 1 }, { id: 2 } ], edges: [ { id: 2to1, target: 1, source: 2 } ] } }; this.draw({network: network_json}); Regards, Alain -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
[gwt-contrib] Earn $1000-$2500 per month
Earn $1000-$2500 per month If you Register your name You Get Sign-up bonus $5 AND Get $.20 cent for each referral. Further details http://www.earnbyforex.com/index.php?id=35678365 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix enum ordinalization black-listing for upcasts in new array initializers (issue1449812)
LGTM http://gwt-code-reviews.appspot.com/1449812/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: CompileModule creates a serialized set of compilation units to represent (issue1448808)
http://gwt-code-reviews.appspot.com/1448808/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10278 committed - Adds some more docs to TypeTightener and MethodCallTightener...
Revision: 10278 Author: zun...@google.com Date: Sat Jun 4 04:09:38 2011 Log: Adds some more docs to TypeTightener and MethodCallTightener Review at http://gwt-code-reviews.appspot.com/1447814 http://code.google.com/p/google-web-toolkit/source/detail?r=10278 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/MethodCallTightener.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/MethodCallTightener.java Thu Jun 2 11:49:52 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/MethodCallTightener.java Sat Jun 4 04:09:38 2011 @@ -35,6 +35,17 @@ * * This is possible because the qualifier might have been tightened by * {@link com.google.gwt.dev.jjs.impl.TypeTightener}. + * + * For example, given the code: + * + * pre + * List foo = new ArrayListString(); + * foo.add(bar); + * /pre + * + * The type of foo is tightened by TypeTightener from type List to be of type + * ArrayList. This means that MethodCallTightener can analyze the polymorphic + * call List.add() on foo and tighten it to the more specific ArrayList.add(). */ public class MethodCallTightener { /** === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java Thu Jun 2 11:49:52 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java Sat Jun 4 04:09:38 2011 @@ -71,6 +71,31 @@ * types can be inferred for locals, fields, parameters, and method return * types. We also optimize dynamic casts and instanceof operations. * + * Examples: + * + * This declaration of variable foo: + * + * pre + * final List foo = new ArrayList(); + * /pre + * + * can be tightened from List to ArrayList because no type other than ArrayList + * can ever be assigned to foo. + * + * The return value of the method bar: + * + * pre + * Collection bar() { + * return new LinkedHashSet; + * } + * /pre + * + * can be tightened from Collection to LinkedHashSet since it + * will never return any other type. + * + * By working in conjunction with {@link MethodCallTightener}, Type tightening + * can eliminate generating run-time dispatch code for polymorphic methods. + * * Type flow occurs automatically in most JExpressions. But locals, fields, * parameters, and method return types serve as way points where type * information is fixed based on the declared type. Type tightening can be done -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: CompileModule creates a serialized set of compilation units to represent (issue1448808)
http://gwt-code-reviews.appspot.com/1448808/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: CompileModule creates a serialized set of compilation units to represent (issue1448808)
FYI, here are some timings of a web mode compile of Showcase with one permutation and -draftCompile PersistentCache off Archives off : 39.990s PersistentCache off Archives on : 34.184s PersistentCache on Archives off : 29.429s PersistentCache on Archives on : 29.680s This is pretty much as expected, as the CompileModule patch doesn't have any effect on the code in the showcase project itself or generated code. http://gwt-code-reviews.appspot.com/1448808/diff/1/dev/core/src/com/google/gwt/dev/CompileModule.java File dev/core/src/com/google/gwt/dev/CompileModule.java (right): http://gwt-code-reviews.appspot.com/1448808/diff/1/dev/core/src/com/google/gwt/dev/CompileModule.java#newcode271 dev/core/src/com/google/gwt/dev/CompileModule.java:271: + ex); On 2011/06/03 03:53:58, zundel wrote: needs to bail here too. Done. http://gwt-code-reviews.appspot.com/1448808/diff/6001/dev/core/src/com/google/gwt/dev/CompileModule.java#newcode54 dev/core/src/com/google/gwt/dev/CompileModule.java:54: * are assumed good and loaded first. CachedCompilationUnits that already exist On 2011/06/03 19:48:40, jbrosenberg wrote: Can we automatically re-order a set of modules so they will be processed in optimal order? Perhaps add a utility method to ModuleDefLoader? Otherwise, users could fail to get optimal benefit from the caching, and not be aware of it? I think that would be nice and I'd like to do it, but after spending about an hour trying to work through it, I'd rather it be in a follow-on patch. Unfortunately, ModuleDefLoader doesn't leave any trail of the inheritance hierarchy behind at the moment, so first we'd have to go through and something for that, then perform the determination of which modules were least dependent on other modules (since dependencies can be circular) and sort. Then, in order for this to work properly, we'd have go through gwt-user and insure that all modules are properly inheriting the other modules they truly depend on. There is no enforcement of that right now (figure out a way to add warnings?) For example (I'm just picking on logging, I'm sure it not the only one): MyProject -- Logging.gwt.xml -- no inherits of User -- User.gwt.xml -- no inherits of Logging From the inherits lines, it looks like you could Compile User without Logging and Logging without User. But in fact, you can't compile Logging as a top level module. Its just a mistake, but we'd need to go in and patch it up to make the auto-sorting work properly. If we got all that working, then we could just throw every .gwt.xml file from gwt-user onto the command line (or point this tool at a directory) and have it correctly create archive files - hooray! http://gwt-code-reviews.appspot.com/1448808/diff/6001/dev/core/src/com/google/gwt/dev/CompileModule.java#newcode173 dev/core/src/com/google/gwt/dev/CompileModule.java:173: TreeLogger nodeBranch = topBranch.branch(TreeLogger.ERROR, msg, null); On 2011/06/03 19:48:40, jbrosenberg wrote: Also add moduleToCompile attribute to this event? Done. http://gwt-code-reviews.appspot.com/1448808/diff/6001/dev/core/src/com/google/gwt/dev/CompileModule.java#newcode185 dev/core/src/com/google/gwt/dev/CompileModule.java:185: return new UnableToCompleteException(); On 2011/06/03 19:48:40, jbrosenberg wrote: maybe change module to dependentModule here; or subModule? Done. http://gwt-code-reviews.appspot.com/1448808/diff/6001/dev/core/src/com/google/gwt/dev/CompileModule.java#newcode191 dev/core/src/com/google/gwt/dev/CompileModule.java:191: public CompileModule(CompileModuleOptions options) { I shuffled the code so that if the topLevelModule.gwt is around, we will load it, (but not keep track of the units in it like we do for other pre-loaded modules) http://gwt-code-reviews.appspot.com/1448808/diff/6001/dev/core/src/com/google/gwt/dev/CompileModule.java#newcode192 dev/core/src/com/google/gwt/dev/CompileModule.java:192: this.options = new CompileModuleOptionsImpl(options); I've changed the code to go ahead and load the top level module and worked out the bug I was trying to prevent another way. A clean build takes 17secs to execute the ant precompile.modules task. Before this change, any change to the dependencies of precompile.modules would cause the invocation to take 17secs again. After this change, a rebuild with just one file with a whitespace change takes 9secs. Unfortunately, this change isn't going to be a big win in all environments. In some build environments the foo.gwt output file is erased from the classpath before CompileModule is invoked. One unspoken assumption I've used throughout this design is that there is an external build tool, like ant, that is doing dependency checking for us. See the outofdate clause in the build file. That build tool can often evaulate staleness a lot better than this tool. For example, this tool can't easily tell when the version of GWT has changed out from underneath us. I've added that assumption to the