[gwt-contrib] Re: Added style getters to UiRenderers (issue1700803)
http://gwt-code-reviews.appspot.com/1700803/diff/7001/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java File user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java (right): http://gwt-code-reviews.appspot.com/1700803/diff/7001/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode1138 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:1138: private void ensureInjectedCssFields() { On 2012/05/27 19:26:12, rdayal wrote: I wonder if this leads to code bloat (i.e. having to litter these calls before accessing a CSSResource field). Why don't we just have a static init in CSSResource classes ACK. I agree, but I can't say why this strange design decision. Perhaps one of the old timers would know. I'll ask. http://gwt-code-reviews.appspot.com/1700803/diff/7001/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode1571 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:1571: * the getter must have a single parameter, the parameter type matches On 2012/05/27 19:26:12, rdayal wrote: How about - "If the getter return type is assignable to Element, the getter must have a single parameter, and the parameter type must be assignable to Element. Done. http://gwt-code-reviews.appspot.com/1700803/diff/7001/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode1576 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:1576: private void validateRendererGetters(JClassType owner) throws UnableToCompleteException { On 2012/05/27 19:26:12, rdayal wrote: Stupid question - when this method is called, isn't the owner that is passed in the name of the interface (i.e. MyUiBinder, which extends UiBinder)? In that case, how can there be any getters? Isn't it an empty interface in all cases? The difference here is that the interface is extending UiRenderer which does allow getters. See here: https://docs.google.com/document/d/1Oo_imxskoGX5O9l9LhHDtJ0yJkHvNTNQqU3dkkekZYI/edit http://gwt-code-reviews.appspot.com/1700803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Added style getters to UiRenderers (issue1700803)
http://gwt-code-reviews.appspot.com/1700803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Make CodeSplitter2 outputs a reasonable SOYC. (issue1726803)
LGTM http://gwt-code-reviews.appspot.com/1726803/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter2.java File dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter2.java (right): http://gwt-code-reviews.appspot.com/1726803/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter2.java#newcode703 dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter2.java:703: private ControlFlowAnalyzer computeAllButNCfas( ControlFlowAnalyzer liveAfterInitialSequence, Space after parenthesis http://gwt-code-reviews.appspot.com/1726803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Make CodeSplitter2 outputs a reasonable SOYC. (issue1726803)
Reviewers: cromwellian, Description: Make CodeSplitter2 outputs a reasonable SOYC. Please review this at http://gwt-code-reviews.appspot.com/1726803/ Affected files: M dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter2.java Index: dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter2.java === --- dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter2.java (revision 10971) +++ dev/core/src/com/google/gwt/dev/jjs/impl/CodeSplitter2.java (working copy) @@ -88,7 +88,6 @@ * TODO(acleung): Figure out how to integrate with SOYC and dependency tracker. * TODO(acleung): Insert SpeedTracer calls at performance sensitive places. * TODO(acleung): Insert logger calls to generate meaningful logs. - * TODO(acleung): May be add back the old heuristics if needed. */ public class CodeSplitter2 { @@ -107,9 +106,6 @@ private FragmentPartitioningResult(int[] splitPointToFragmentMap, int numFragments) { this.splitPointToFragmentMap = splitPointToFragmentMap; fragmentToSplitPoint = new int[numFragments]; - for (int i = 0, len = splitPointToFragmentMap.length - 1; i < len; i++) { -System.out.println("splitPointToFragmentMap[" + i + "] = " + splitPointToFragmentMap[i]); - } for (int i = 1, len = splitPointToFragmentMap.length - 1; i < len; i++) { if (fragmentToSplitPoint[splitPointToFragmentMap[i]] == 0) { fragmentToSplitPoint[splitPointToFragmentMap[i]] = i; @@ -303,8 +299,10 @@ return; } Event codeSplitterEvent = SpeedTracerLogger.start(CompilerEventType.CODE_SPLITTER); +dependencyRecorder.open(); new CodeSplitter2( logger, jprogram, jsprogram, map, fragmentsToMerge, dependencyRecorder).execImpl(); +dependencyRecorder.close(); codeSplitterEvent.end(); } @@ -606,6 +604,8 @@ } ExclusivityMap fragmentMap = new ExclusivityMap(); + + private MultipleDependencyGraphRecorder dependencyRecorder; private final Map fieldToLiteralOfClass; @@ -656,6 +656,7 @@ this.jprogram = jprogram; this.jsprogram = jsprogram; this.splitPointsMerge = splitPointsMerge; +this.dependencyRecorder = dependencyRecorder; this.fragmentExtractor = new FragmentExtractor(jprogram, jsprogram, map); this.initialLoadSequence = new LinkedHashSet(jprogram.getSplitPointInitialSequence()); @@ -699,10 +700,13 @@ fragmentStats.put(splitPoint, stats); } - private ControlFlowAnalyzer computeAllButNCfas( - ControlFlowAnalyzer liveAfterInitialSequence, List sp) { + private ControlFlowAnalyzer computeAllButNCfas( ControlFlowAnalyzer liveAfterInitialSequence, + List sp, int fragmentIndex, String extnds) { List allButOnes = new ArrayList(); ControlFlowAnalyzer cfa = new ControlFlowAnalyzer(liveAfterInitialSequence); + +dependencyRecorder.startDependencyGraph("sp" + fragmentIndex, extnds); + for (JRunAsync otherRunAsync : jprogram.getRunAsyncs()) { if (isInitial(otherRunAsync.getSplitPoint())) { continue; @@ -712,6 +716,9 @@ } cfa.traverseFromRunAsync(otherRunAsync); } + +dependencyRecorder.endDependencyGraph(); + return cfa; } @@ -786,16 +793,25 @@ } ControlFlowAnalyzer liveAfterInitialSequence = new ControlFlowAnalyzer(initiallyLive); +String extendsCfa = "initial"; int cacheIndex = 1; // Initial Split Point. { for (final int sp : initialLoadSequence) { -splitPointToCodeIndexMap[sp] = cacheIndex; +splitPointToCodeIndexMap[sp] = cacheIndex; +String depGraphName = "sp" + cacheIndex; + +// Records dependency Graph. +dependencyRecorder.startDependencyGraph(depGraphName, extendsCfa); +extendsCfa = depGraphName; + LivenessPredicate alreadyLoaded = new CfaLivenessPredicate(liveAfterInitialSequence); ControlFlowAnalyzer liveAfterSp = new ControlFlowAnalyzer(liveAfterInitialSequence); JRunAsync runAsync = jprogram.getRunAsyncs().get(sp - 1); liveAfterSp.traverseFromRunAsync(runAsync); +dependencyRecorder.endDependencyGraph(); + LivenessPredicate liveNow = new CfaLivenessPredicate(liveAfterSp); List statsToAppend = fragmentExtractor.createOnLoadedCall(cacheIndex); addFragment(sp, alreadyLoaded, liveNow, statsToAppend, fragmentStats); @@ -847,7 +863,8 @@ } } - ControlFlowAnalyzer allButOne = computeAllButNCfas(liveAfterInitialSequence, splitPoints); + ControlFlowAnalyzer allButOne = computeAllButNCfas( + liveAfterInitialSequence, splitPoints, cacheIndex, extendsCfa); Set allLiveNodes = union(allButOne.getLiveFieldsAndMethods(), allButOne.getFieldsWritten()); updateReverseMap(i, fragmentMap.fields, allLiveNodes, allFields); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] VerticalSplitPanel should not use DeferredCommand (issue1725803)
Reviewers: , Description: VerticalSplitPanel is using DeferredCommand which is deprecated. Resubmitting 1693803 Please review this at http://gwt-code-reviews.appspot.com/1725803/ Affected files: user/src/com/google/gwt/user/client/ui/VerticalSplitPanel.java Index: user/src/com/google/gwt/user/client/ui/VerticalSplitPanel.java === --- user/src/com/google/gwt/user/client/ui/VerticalSplitPanel.java (revision 11007) +++ user/src/com/google/gwt/user/client/ui/VerticalSplitPanel.java (working copy) @@ -16,13 +16,13 @@ package com.google.gwt.user.client.ui; import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Style.TextAlign; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ImageResource; import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Timer; @@ -399,7 +399,7 @@ * This first call is simply to try to avoid a jitter effect if possible. */ setSplitPosition(lastSplitPosition); -DeferredCommand.addCommand(new Command() { +Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { setSplitPosition(lastSplitPosition); } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: DEFAULT_FAST_FORWARD_ROWS should be final (issue1724803)
Submitted as r11007 http://gwt-code-reviews.appspot.com/1724803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] DEFAULT_FAST_FORWARD_ROWS should be final (issue1724803)
Reviewers: rdayal, Description: DEFAULT_FAST_FORWARD_ROWS should be final Add constructor SimplePager(TextLocation, boolean, boolean) Resubmitting issue 1692803 Thanks Patrick! Please review this at http://gwt-code-reviews.appspot.com/1724803/ Affected files: M user/src/com/google/gwt/user/cellview/client/SimplePager.java Index: user/src/com/google/gwt/user/cellview/client/SimplePager.java === --- user/src/com/google/gwt/user/cellview/client/SimplePager.java (revision 10982) +++ user/src/com/google/gwt/user/cellview/client/SimplePager.java (working copy) @@ -1,12 +1,12 @@ /* * 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 @@ -38,7 +38,7 @@ /** * A pager for controlling a {@link HasRows} that only supports simple page * navigation. - * + * * * Example * {@example com.google.gwt.examples.cellview.SimplePagerExample} @@ -46,7 +46,7 @@ */ public class SimplePager extends AbstractPager { /** - * Constant for labeling the simple pager navigational {@link ImageButton}s + * Constant for labeling the simple pager navigational {@link ImageButton}s */ @DefaultLocale("en_US") public interface ImageButtonsConstants extends Constants { @@ -212,7 +212,7 @@ } } - private static int DEFAULT_FAST_FORWARD_ROWS = 1000; + private static final int DEFAULT_FAST_FORWARD_ROWS = 1000; private static Resources DEFAULT_RESOURCES; private static Resources getDefaultResources() { @@ -256,7 +256,7 @@ /** * Construct a {@link SimplePager} with the specified text location. - * + * * @param location the location of the text relative to the buttons */ @UiConstructor @@ -267,8 +267,38 @@ } /** + * Construct a {@link SimplePager} with the default resources, fast forward rows and + * default image button names. + * + * @param location the location of the text relative to the buttons + * @param showFastForwardButton if true, show a fast-forward button that + * advances by a larger increment than a single page + * @param showLastPageButton if true, show a button to go the the last page + */ + public SimplePager(TextLocation location, boolean showFastForwardButton, + boolean showLastPageButton) { +this(location, showFastForwardButton, DEFAULT_FAST_FORWARD_ROWS, +showLastPageButton); + } + + /** + * Construct a {@link SimplePager} with the default resources and default image button names. + * + * @param location the location of the text relative to the buttons + * @param showFastForwardButton if true, show a fast-forward button that + * advances by a larger increment than a single page + * @param fastForwardRows the number of rows to jump when fast forwarding + * @param showLastPageButton if true, show a button to go the the last page + */ + public SimplePager(TextLocation location, boolean showFastForwardButton, + final int fastForwardRows, boolean showLastPageButton) { +this(location, getDefaultResources(), showFastForwardButton, fastForwardRows, +showLastPageButton); + } + + /** * Construct a {@link SimplePager} with the specified resources. - * + * * @param location the location of the text relative to the buttons * @param resources the {@link Resources} to use * @param showFastForwardButton if true, show a fast-forward button that @@ -284,7 +314,7 @@ this.fastForwardRows = fastForwardRows; this.style = resources.simplePagerStyle(); this.style.ensureInjected(); - + // Create the buttons. String disabledStyle = style.disabledButton(); firstPage = new ImageButton(resources.simplePagerFirstPage(), @@ -304,7 +334,7 @@ } }); prevPage = new ImageButton(resources.simplePagerPreviousPage(), -resources.simplePagerPreviousPageDisabled(), disabledStyle, +resources.simplePagerPreviousPageDisabled(), disabledStyle, imageButtonConstants.prevPage()); prevPage.addClickHandler(new ClickHandler() { @Override @@ -326,7 +356,7 @@ } if (showFastForwardButton) { fastForward = new ImageButton(resources.simplePagerFastForward(), - resources.simplePagerFastForwardDisabled(), disabledStyle, + resources.simplePagerFastForwardDisabled(), disabledStyle, imageButtonConstants.fastForward()); fastForward.addClickHandler(new ClickHandler() { @Override @@ -376,10 +406,10 @@ // Disab
[gwt-contrib] Re: Complete text-* support for Style (issue1723803)
I just realized that 'text-overflow' is a CSS3 property. How do you guys feel about adding CSS3 properties to Style? If its ok, I will add 'text-justify' and 'text-shadow' which are the only other widely supported text properties. http://gwt-code-reviews.appspot.com/1723803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Issue 7038: CompositeEditor and ListEditor optimizations (issue1664803)
On Sat, May 19, 2012 at 6:16 PM, Thomas Broyer wrote: > > CheckBox turns 'null' into 'Boolean.FALSE' and TextBox turns 'null' into the > empty string, and people have complained. > See http://code.google.com/p/google-web-toolkit/issues/detail?id=5976#c1 > (I'm sure this was discussed, with John or Ray R, and I started working on a > patch; can't find this though) Yay! Just stumbled upon it, so for reference: http://code.google.com/p/google-web-toolkit/issues/detail?id=6713#c8 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors