Revision: 7227 Author: [email protected] Date: Tue Dec 1 21:26:37 2009 Log: Merging /trunk c7221, c7223, c7225, c7226 into this branch.
http://code.google.com/p/google-web-toolkit/source/detail?r=7227 Modified: /releases/2.0/branch-info.txt /releases/2.0/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/global.css /releases/2.0/user/src/com/google/gwt/user/client/ui/CustomButton.java /releases/2.0/user/src/com/google/gwt/user/client/ui/DialogBox.java /releases/2.0/user/src/com/google/gwt/user/client/ui/DisclosurePanel.java /releases/2.0/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java /releases/2.0/user/src/com/google/gwt/user/client/ui/HasHTML.java /releases/2.0/user/src/com/google/gwt/user/client/ui/HasText.java /releases/2.0/user/src/com/google/gwt/user/client/ui/LayoutPanel.java /releases/2.0/user/src/com/google/gwt/user/client/ui/MenuBar.java /releases/2.0/user/src/com/google/gwt/user/client/ui/PopupPanel.java /releases/2.0/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java /releases/2.0/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImpl.java /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImplIE6.java /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java /releases/2.0/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css /releases/2.0/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css /releases/2.0/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css /releases/2.0/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css /releases/2.0/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css /releases/2.0/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css /releases/2.0/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml ======================================= --- /releases/2.0/branch-info.txt Tue Dec 1 15:25:46 2009 +++ /releases/2.0/branch-info.txt Tue Dec 1 21:26:37 2009 @@ -1129,3 +1129,22 @@ tr...@7222 was merged into this branch Increase stack size of JUnit tests. svn merge --ignore-ancestry -c7222 https://google-web-toolkit.googlecode.com/svn/trunk/ . + +tr...@7221 was merged into this branch + Fix for hosted.html missing plugin warning in IE7+ quirks mode. + svn merge --ignore-ancestry -c7221 https://google-web-toolkit.googlecode.com/svn/trunk/ . + +tr...@7223 was merged into this branch + Adding UiBinder doc for widgets that require it. + svn merge --ignore-ancestry -c7223 https://google-web-toolkit.googlecode.com/svn/trunk/ . + +tr...@7225 was merged into this branch + Removes the use of FinallyCommand in StackLayoutPanel. This works around + a Scheduler bug that's causing StackLayoutPanel to misbehave slightly. + svn merge --ignore-ancestry -c7225 https://google-web-toolkit.googlecode.com/svn/trunk/ . + +tr...@7226 was merged into this branch + Fixes issues 2907, 4277 and 4278. + Also fixes mail icon showing up in front of the about dialog. + svn merge --ignore-ancestry -c7226 https://google-web-toolkit.googlecode.com/svn/trunk/ . + ======================================= --- /releases/2.0/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html Mon Nov 30 07:55:10 2009 +++ /releases/2.0/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html Tue Dec 1 21:26:37 2009 @@ -173,20 +173,19 @@ } else { topDoc.documentElement.style["overflow"] = "hidden"; } - + // Steal focus. glass.focus(); - - if (navigator.userAgent.indexOf("MSIE 6") >= 0) { + + if ((navigator.userAgent.indexOf("MSIE") >= 0) && (topDoc.compatMode == "BackCompat")) { + // IE quirks mode doesn't support right/bottom, but does support this. + glassStyle.width = "125%"; + glassStyle.height = "100%"; + } else if (navigator.userAgent.indexOf("MSIE 6") >= 0) { + // IE6 doesn't have a real standards mode, so we have to use hacks. glassStyle.width = "125%"; // Get past scroll bar area. - if (topDoc.compatMode == "BackCompat") { - // Works in quirks mode. - glassStyle.height = "100%"; - } else { - // Use a nasty CSS expression in standards mode; ideally we'd use the - // onresize event, but the outer window won't let us add one in IE6. - glassStyle.setExpression("height", "document.documentElement.clientHeight"); - } + // Nasty CSS; onresize would be better but the outer window won't let us add a listener IE. + glassStyle.setExpression("height", "document.documentElement.clientHeight"); } } ======================================= --- /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/global.css Tue Nov 24 14:21:51 2009 +++ /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/global.css Tue Dec 1 21:26:37 2009 @@ -18,6 +18,7 @@ .gwt-DialogBox { background-color: white; border: 1px solid #666; + z-index: 2; } .gwt-DialogBox .Caption { background: #d3d6dd url(gradient_bg_th.png) repeat-x bottom left; @@ -33,10 +34,11 @@ .gwt-DialogBox .gwt-Button { margin: 10px; } -.gwt-PopupGlass { +.gwt-PopupPanelGlass { background-color: #000; opacity: 0.3; filter: literal("alpha(opacity=30)"); + z-index: 2; } /* GWT Tree */ ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/CustomButton.java Wed Nov 4 10:52:58 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/CustomButton.java Tue Dec 1 21:26:37 2009 @@ -99,6 +99,38 @@ * </table> * </p> * + * <h3>Use in UiBinder Templates</h3> + * + * When working with CustomButton subclasses in + * {...@link com.google.gwt.uibinder.client.UiBinder UiBinder} templates, you + * can set text and assign ImageResources for their various faces via + * child elements: + * <p> + * <dl> + * <dt><g:upFace> + * <dt><g:downFace> + * <dt><g:upHoveringFace> + * <dt><g:downHoveringFace> + * <dt><g:upDisabledFace> + * <dt><g:downDisabledFace> + * </dl> + * + * Each face element can take an optional <code>image</code> attribute + * and an html body. For example:<pre> + * <ui:image field='downButton'/> <!-- define an {...@link ImageResource} --> + * + * <g:PushButton ui:field='pushButton' enabled='true'> + * <g:upFace> + * <b>click me</b> + * </gwt:upFace> + * <g:upHoveringFace> + * <b>Click ME!</b> + * </gwt:upHoveringFace> + * + * <g:downFace image='{downButton}'/> + * <g:downHoveringFace image='{downButton}'/> + * </g:PushButton> + * </pre> */ public abstract class CustomButton extends ButtonBase { /** ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/DialogBox.java Wed Nov 4 10:24:42 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/DialogBox.java Tue Dec 1 21:26:37 2009 @@ -79,6 +79,26 @@ * <h3>Example</h3> * {...@example com.google.gwt.examples.DialogBoxExample} * </p> + * + * <h3>Use in UiBinder Templates</h3> + * <p> + * DialogBox elements in + * {...@link com.google.gwt.uibinder.client.UiBinder UiBinder} templates can + * have one widget child and one <g:caption> child. (Note the lower case + * "c", meant to signal that the caption is not a runtime object, and so cannot + * have a <code>ui:field</code> attribute.) The body of the + * caption can be html. + * <p> + * For example: <pre> + * <g:DialogBox autoHide="true" modal="true"> + * <g:caption><b>Caption text</b></g:caption> + * <g:HTMLPanel> + * Body text + * <g:Button ui:field='cancelButton'>Cancel</g:Button> + * <g:Button ui:field='okButton'>Okay</g:Button> + * </g:HTMLPanel> + * </g:DialogBox> + * </pre> */ @SuppressWarnings("deprecation") public class DialogBox extends DecoratedPopupPanel implements HasHTML, ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/DisclosurePanel.java Wed Nov 4 07:16:01 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/DisclosurePanel.java Tue Dec 1 21:26:37 2009 @@ -37,11 +37,15 @@ * A widget that consists of a header and a content panel that discloses the * content when a user clicks on the header. * - * <h3>CSS Style Rules</h3> <ul class="css"> <li>.gwt-DisclosurePanel { the - * panel's primary style }</li> <li>.gwt-DisclosurePanel-open { dependent style - * set when panel is open }</li> <li>.gwt-DisclosurePanel-closed { dependent - * style set when panel is closed }</li> - * + * <h3>CSS Style Rules</h3> + * <dl class="css"> + * <dt>.gwt-DisclosurePanel + * <dd>the panel's primary style + * <dt>.gwt-DisclosurePanel-open + * <dd> dependent style set when panel is open + * <dt>.gwt-DisclosurePanel-closed + * <dd> dependent style set when panel is closed + * </dl> * <p> * <img class='gallery' src='DisclosurePanel.png'/> * </p> @@ -51,6 +55,29 @@ * selector:<br/> * .gwt-DisclosurePanel-open .header { ... } * </p> + * <h3>Use in UiBinder Templates</h3> + * <p> + * DisclosurePanel elements in + * {...@link com.google.gwt.uibinder.client.UiBinder UiBinder} templates can + * have one widget child and one of two types of header elements. A + * <g:header> element can hold html, or a <g:customHeader> element + * can hold a widget. (Note that the tags of the header elements are not + * capitalized. This is meant to signal that the head is not a runtime object, + * and so cannot have a <code>ui:field</code> attribute.) + * <p> + * For example:<pre> + * <g:DisclosurePanel> + * <g:header><b>Text header</b></gwt:caption> + * <g:Label>Widget body</g:Label> + * </g:DisclosurePanel> + * + * <g:DisclosurePanel> + * <g:customeHeader> + * <g:Label>Widget header</g:Label> + * </g:customeHeader> + * <g:Label>Widget body</g:Label> + * </g:DisclosurePanel> + * </pre> */ @SuppressWarnings("deprecation") public final class DisclosurePanel extends Composite implements ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java Tue Nov 24 14:41:20 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java Tue Dec 1 21:26:37 2009 @@ -35,6 +35,50 @@ * <h3>Example</h3> * {...@example com.google.gwt.examples.DockLayoutPanelExample} * </p> + * + * <h3>Use in UiBinder Templates</h3> + * <p> + * DockLayoutPanel elements in + * {...@link com.google.gwt.uibinder.client.UiBinder UiBinder} templates + * lay out their children in elements tagged with the cardinal directions, + * and center: + * + * <p> + * <dl> + * <dt><g:center> + * <dt><g:north> + * <dt><g:south> + * <dt><g:west> + * <dt><g:east> + * </dl> + * + * <p> + * Each child can hold only widget, and there can be only one <g:center>. + * However, there can be any number of the directional children. + *<p> + * (Note that the tags of the child elements are not + * capitalized. This is meant to signal that they are not runtime objects, + * and so cannot have a <code>ui:field</code> attribute.) + * <p> + * For example:<pre> + * <g:DockLayoutPanel unit='EM'> + * <g:north size='5'> + * <g:Label>Top</g:Label> + * </g:north> + * <g:center> + * <g:Label>Body</g:Label> + * </g:center> + * <g:west size='192'> + * <g:HTML> + * <ul> + * <li>Sidebar</li> + * <li>Sidebar</li> + * <li>Sidebar</li> + * </ul> + * </g:HTML> + * </g:west> + * </g:DockLayoutPanel> + * </pre> */ public class DockLayoutPanel extends ComplexPanel implements AnimatedLayout, RequiresResize, ProvidesResize { ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/HasHTML.java Wed Dec 27 15:03:26 2006 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/HasHTML.java Tue Dec 1 21:26:37 2009 @@ -19,6 +19,16 @@ * An object that implements this interface contains text, which can be set and * retrieved using these methods. The object's text can be set either as HTML or * as text. + * + * <h3>Use in UiBinder Templates</h3> + * <p> + * The body of an XML element representing a widget that implements + * HasHTML will be parsed as HTML and be used in a call to its + * {...@link #setHTML(String)} method. + * + * <p>For example:<pre> + * <g:PushButton><b>Click me!</b></g:PushButton> + * </pre> */ public interface HasHTML extends HasText { ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/HasText.java Wed Dec 27 15:03:26 2006 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/HasText.java Tue Dec 1 21:26:37 2009 @@ -18,6 +18,18 @@ /** * An object that implements this interface contains text, which can be set and * retrieved using these methods. + * + * <h3>Use in UiBinder Templates</h3> + * <p> + * The body of an XML element representing a widget that implements + * HasText will be parsed as text and be used in a call to its + * {...@link #setText(String)} method. HasText elements must only + * contain text. (This behavior is overridden for {...@link HasHTML} + * widgets.) + * + * <p>For example:<pre> + * <g:Label>Hello.</g:Label> + * </pre> */ public interface HasText { ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/LayoutPanel.java Tue Nov 24 14:41:20 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/LayoutPanel.java Tue Dec 1 21:26:37 2009 @@ -38,6 +38,69 @@ * <h3>Example</h3> * {...@example com.google.gwt.examples.LayoutPanelExample} * </p> + * + * <h3>Use in UiBinder Templates</h3> + * <p> + * LayoutPanel elements in {...@link com.google.gwt.uibinder.client.UiBinder + * UiBinder} templates lay out their children with arbitrary constraints, using + * <g:layer> elements. Each layer may have any of the following constraint + * attributes specified as CSS length attributes: <code>left</code>, + * <code>top</code>, <code>right</code>, <code>bottom</code>, <code>width</code> + * , and <code>height</code>. + * + * <p> + * Precisely zero or two constraints are required for each axis (horizontal and + * vertial). Specifying no constraints implies that the child should fill that + * axis completely. + * + * <p> + * The valid sets of horizontal constraints are: + * <dl> + * <dt>(none) + * <dd>Fill the parent's horizontal axis + * <dt>left, width + * <dd>Fixed width, positioned from parent's left edge + * <dt>right, width + * <dd>Fixed width, positioned from parent's right edge + * <dt>left, right + * <dd>Width implied by fixed distance from parent's left and right edges + * </dl> + * + * <p> + * The valid sets of vertical constraints are: + * <dl> + * <dt>(none) + * <dd>Fill the parent's vertical axis + * <dt>top, height + * <dd>Fixed height, positioned from parent's top edge + * <dt>bottom, height + * <dd>Fixed height, positioned from parent's bottom edge + * <dt>top, bottom + * <dd>Height implied by fixed distance from parent's top and bottom edges + * </dl> + * + * <p> + * The values of constraint attributes can be any valid <a + * href='http://www.w3.org/TR/CSS21/syndata.html#length-units'>CSS length</a>, + * such as <code>1px</code>, <code>3em</code>, or <code>0</code> (zero lengths require no + * units). + * + * <p> + * For example: + * + * <pre> + * <g:LayoutPanel> + * <!-- No constraints causes the layer to fill the parent --> + * <g:layer> + * <g:Label>Lorem ipsum...</g:Label> + * </g:layer> + * <!-- Position horizontally 25% from each edge; + * Vertically 4px from the top and 10em tall. --> + * <g:layer left='25%' right='25%' top='4px' height='10em'> + * <g:Label>Header</g:Label> + * </g:layer> + * </g:LayoutPanel> + * </pre> */ public class LayoutPanel extends ComplexPanel implements AnimatedLayout, RequiresResize, ProvidesResize { ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/MenuBar.java Mon Nov 2 08:09:39 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/MenuBar.java Tue Dec 1 21:26:37 2009 @@ -104,6 +104,40 @@ * <h3>Example</h3> * {...@example com.google.gwt.examples.MenuBarExample} * </p> + * + * <h3>Use in UiBinder Templates</h3> + * <p> + * MenuBar elements in UiBinder template files can have a <code>vertical</code> + * boolean attribute (which defaults to false), and may have only MenuItem + * elements as children. MenuItems may contain HTML and MenuBars. + * <p> + * For example: + * + * <pre> + * <g:MenuBar> + * <g:MenuItem>Higgledy + * <g:MenuBar vertical="true"> + * <g:MenuItem>able</g:MenuItem> + * <g:MenuItem>baker</g:MenuItem> + * <g:MenuItem>charlie</g:MenuItem> + * </g:MenuBar> + * </g:MenuItem> + * <g:MenuItem>Piggledy + * <g:MenuBar vertical="true"> + * <g:MenuItem>foo</g:MenuItem> + * <g:MenuItem>bar</g:MenuItem> + * <g:MenuItem>baz</g:MenuItem> + * </g:MenuBar> + * </g:MenuItem> + * <g:MenuItem><b>Pop!</b> + * <g:MenuBar vertical="true"> + * <g:MenuItem>uno</g:MenuItem> + * <g:MenuItem>dos</g:MenuItem> + * <g:MenuItem>tres</g:MenuItem> + * </g:MenuBar> + * </g:MenuItem> + * </g:MenuBar> + * </pre> */ // Nothing we can do about MenuBar implementing PopupListener until next // release. ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/PopupPanel.java Thu Nov 5 11:50:57 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/PopupPanel.java Tue Dec 1 21:26:37 2009 @@ -63,6 +63,14 @@ * <img class='gallery' src='PopupPanel.png'/> * </p> * + * <p> + * The PopupPanel can be optionally displayed with a "glass" element behind it, + * which is commonly used to gray out the widgets behind it. It can be enabled + * using {...@link #setGlassEnabled(boolean)}. It has a default style name of + * "gwt-PopupPanelGlass", which can be changed using + * {...@link #setGlassStyleName()}. + * </p> + * * <p> * <h3>Example</h3> * {...@example com.google.gwt.examples.PopupPanelExample} @@ -73,7 +81,7 @@ * <dd>the outside of the popup</dd> * <dt>.gwt-PopupPanel .popupContent</dt> * <dd>the wrapper around the content</dd> - * <dt>.gwt-PopupGlass</dt> + * <dt>.gwt-PopupPanelGlass</dt> * <dd>the glass background behind the popup</dd> * </dl> */ @@ -267,6 +275,7 @@ if (showing) { if (curPanel.isGlassEnabled) { Document.get().getBody().appendChild(curPanel.glass); + impl.onShow(curPanel.glass); glassShowing = true; Window.addResizeHandler(curPanel.glassResizer); @@ -274,6 +283,7 @@ } } else if (glassShowing) { Document.get().getBody().removeChild(curPanel.glass); + impl.onHide(curPanel.glass); glassShowing = false; } } @@ -360,6 +370,8 @@ */ private Element glass; + private String glassStyleName = "gwt-PopupPanelGlass"; + /** * A boolean indicating that a glass element should be used. */ @@ -386,7 +398,7 @@ */ public PopupPanel() { super(); - DOM.appendChild(super.getContainerElement(), impl.createElement()); + super.getContainerElement().appendChild(impl.createElement()); // Default position of popup should be in the upper-left corner of the // window. By setting a default position, the popup will not appear in @@ -478,6 +490,16 @@ } } } + + /** + * Gets the style name to be used on the glass element. By default, this is + * "gwt-PopupPanelGlass". + * + * @return the glass element's style name + */ + public String getGlassStyleName() { + return glassStyleName; + } /** * Gets the panel's offset height in pixels. Calls to @@ -681,7 +703,7 @@ autoHidePartners.remove(partner); } } - + /** * @deprecated Use the {...@link HandlerRegistration#removeHandler} method on the * object returned by {...@link #addCloseHandler} instead @@ -716,13 +738,26 @@ this.isGlassEnabled = enabled; if (enabled && glass == null) { glass = Document.get().createDivElement(); - glass.setClassName("gwt-PopupGlass"); + glass.setClassName(glassStyleName); glass.getStyle().setPosition(Position.ABSOLUTE); glass.getStyle().setLeft(0, Unit.PX); glass.getStyle().setTop(0, Unit.PX); } } + + /** + * Sets the style name to be used on the glass element. By default, this is + * "gwt-PopupPanelGlass". + * + * @param glassStyleName the glass element's style name + */ + public void setGlassStyleName(String glassStyleName) { + this.glassStyleName = glassStyleName; + if (glass != null) { + glass.setClassName(glassStyleName); + } + } /** * Sets the height of the panel's child widget. If the panel's child widget @@ -850,6 +885,9 @@ // If the PopupImpl creates an iframe shim, it's also necessary to hide it // as well. impl.setVisible(getElement(), visible); + if (glass != null) { + impl.setVisible(glass, visible); + } } @Override @@ -914,7 +952,7 @@ @Override protected com.google.gwt.user.client.Element getContainerElement() { - return impl.getContainerElement(getPopupImplElement()); + return impl.getContainerElement(getPopupImplElement()).cast(); } /** @@ -929,7 +967,7 @@ @Override protected com.google.gwt.user.client.Element getStyleElement() { - return impl.getStyleElement(getPopupImplElement()); + return impl.getStyleElement(getPopupImplElement()).cast(); } protected void onPreviewNativeEvent(NativePreviewEvent event) { ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java Tue Nov 24 14:41:20 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java Tue Dec 1 21:26:37 2009 @@ -15,8 +15,6 @@ */ package com.google.gwt.user.client.ui; -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.Event; @@ -29,8 +27,8 @@ * with a header for each child which the user can click to display. * * <p> - * This widget will <em>only</em> work in standards mode, which requires - * that the HTML page in which it is run have an explicit <!DOCTYPE> + * This widget will <em>only</em> work in standards mode, which requires that + * the HTML page in which it is run have an explicit <!DOCTYPE> * declaration. * </p> * @@ -38,6 +36,38 @@ * <h3>Example</h3> * {...@example com.google.gwt.examples.StackLayoutPanelExample} * </p> + * + * <h3>Use in UiBinder Templates</h3> + * <p> + * A StackLayoutPanel element in a + * {...@link com.google.gwt.uibinder.client.UiBinder UiBinder} template may have a + * <code>unit</code> attribute with a + * {...@link com.google.gwt.dom.client.Style.Unit Style.Unit} value (it defaults to + * PX). + * <p> + * The children of a StackLayoutPanel element are laid out in <g:stack> + * elements. Each stack can have one widget child and one of two types of header + * elements. A <g:header> element can hold html, or a <g:customHeader> + * element can hold a widget. (Note that the tags of the header elements are not + * capitalized. This is meant to signal that the head is not a runtime object, + * and so cannot have a <code>ui:field</code> attribute.) + * <p> + * For example: + * + * <pre> + * <g:StackLayoutPanel unit='PX'> + * <g:stack> + * <g:header size='3'><b>HTML</b> header</g:header> + * <g:Label>able</g:Label> + * </g:stack> + * <g:stack> + * <g:customHeader size='3'> + * <g:Label>Custom header</g:Label> + * </g:customHeader> + * <g:Label>baker</g:Label> + * </g:stack> + * </g:StackLayoutPanel> + * </pre> */ public class StackLayoutPanel extends Composite implements HasWidgets, RequiresResize, ProvidesResize { @@ -100,7 +130,7 @@ * @param header the header widget * @param headerSize the size of the header widget */ - public void add(Widget widget, Widget header, double headerSize) { + public void add(final Widget widget, Widget header, double headerSize) { ClickWrapper wrapper = new ClickWrapper(widget, header); layoutPanel.add(wrapper); layoutPanel.add(widget); @@ -112,8 +142,9 @@ layoutData.add(data); if (visibleWidget == null) { - // Don't animate the initial widget display. - showWidget(widget, 0); + // If there's no visible widget, display the first one. The layout will + // be updated onLoad(). + visibleWidget = widget; } } @@ -172,6 +203,12 @@ public void showWidget(Widget widget) { showWidget(widget, ANIMATION_TIME); } + + @Override + protected void onLoad() { + // When the widget becomes attached, update its layout. + animate(0); + } private void animate(int duration) { int top = 0, bottom = 0; @@ -209,10 +246,6 @@ private void showWidget(Widget widget, final int duration) { visibleWidget = widget; - Scheduler.get().scheduleFinally(new ScheduledCommand() { - public void execute() { - animate(duration); - } - }); + animate(duration); } } ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java Wed Nov 25 08:25:16 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java Tue Dec 1 21:26:37 2009 @@ -45,18 +45,47 @@ * </p> * * <h3>CSS Style Rules</h3> - * <ul class='css'> - * <li>.gwt-TabLayoutPanel { the panel itself }</li> - * <li>.gwt-TabLayoutPanel .gwt-TabLayoutPanelTabs { the tab bar element }</li> - * <li>.gwt-TabLayoutPanel .gwt-TabLayoutPanelTab { an individual tab }</li> - * <li>.gwt-TabLayoutPanel .gwt-TabLayoutPanelTabInner { an element nested in - * each tab (useful for styling) }</li> - * </ul> + * <dl> + * <dt>.gwt-TabLayoutPanel <dd> the panel itself + * <dt>.gwt-TabLayoutPanel .gwt-TabLayoutPanelTabs <dd> the tab bar element + * <dt>.gwt-TabLayoutPanel .gwt-TabLayoutPanelTab <dd> an individual tab + * <dt>.gwt-TabLayoutPanel .gwt-TabLayoutPanelTabInner <dd> an element nested in + * each tab (useful for styling) + * </dl> * * <p> * <h3>Example</h3> * {...@example com.google.gwt.examples.TabLayoutPanelExample} - * </p> + * + * <h3>Use in UiBinder Templates</h3> + * <p> + * A TabLayoutPanel element in a {...@link com.google.gwt.uibinder.client.UiBinder + * UiBinder} template must have a <code>barHeight</code> attribute with a double + * value, and may have a <code>barUnit</code> attribute with a + * {...@link com.google.gwt.dom.client.Style.Unit Style.Unit} value. + * <code>barUnit</code> defaults to PX. + * <p> + * The children of a TabLayoutPanel element are laid out in <g:tab> + * elements. Each tab can have one widget child and one of two types of header + * elements. A <g:header> element can hold html, or a <g:customHeader> + * element can hold a widget. (Note that the tags of the header elements are + * not capitalized. This is meant to signal that the head is not a runtime + * object, and so cannot have a <code>ui:field</code> attribute.) + * <p> + * For example:<pre> + * <g:TabLayoutPanel barUnit='PX' barHeight='3'> + * <g:tab> + * <g:header size='7'><b>HTML</b> header</g:header> + * <g:Label>able</g:Label> + * </g:tab> + * <g:tab> + * <g:customHeader size='7'> + * <g:Label>Custom header</g:Label> + * </g:customHeader> + * <g:Label>baker</g:Label> + * </g:tab> + * </g:TabLayoutPanel> + * </pre> */ public class TabLayoutPanel extends ResizeComposite implements HasWidgets, ProvidesResize, IndexedPanel, HasBeforeSelectionHandlers<Integer>, @@ -113,7 +142,7 @@ private int selectedIndex = -1; /** - * Creates an empty tab panel. + * Creates an empty tab panel. * * @param barHeight the size of the tab bar * @param barUnit the unit in which the tab bar size is specified @@ -250,8 +279,8 @@ } /** - * Inserts a widget into the panel. If the Widget is already attached, it will be - * moved to the requested index. + * Inserts a widget into the panel. If the Widget is already attached, it will + * be moved to the requested index. * * @param child the widget to be added * @param text the text to be shown on its tab @@ -269,8 +298,8 @@ } /** - * Inserts a widget into the panel. If the Widget is already attached, it will be - * moved to the requested index. + * Inserts a widget into the panel. If the Widget is already attached, it will + * be moved to the requested index. * * @param child the widget to be added * @param text the text to be shown on its tab @@ -281,8 +310,8 @@ } /** - * Inserts a widget into the panel. If the Widget is already attached, it will be - * moved to the requested index. + * Inserts a widget into the panel. If the Widget is already attached, it will + * be moved to the requested index. * * @param child the widget to be added * @param tab the widget to be placed in the associated tab @@ -344,8 +373,7 @@ // Fire the before selection event, giving the recipients a chance to // cancel the selection. - BeforeSelectionEvent<Integer> event = - BeforeSelectionEvent.fire(this, index); + BeforeSelectionEvent<Integer> event = BeforeSelectionEvent.fire(this, index); if ((event != null) && event.isCanceled()) { return; } ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImpl.java Wed Nov 4 06:59:39 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImpl.java Tue Dec 1 21:26:37 2009 @@ -15,8 +15,8 @@ */ package com.google.gwt.user.client.ui.impl; -import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.Element; +import com.google.gwt.dom.client.Document; +import com.google.gwt.dom.client.Element; /** * Implementation class used by {...@link com.google.gwt.user.client.ui.PopupPanel}. @@ -24,7 +24,7 @@ public class PopupImpl { public Element createElement() { - return DOM.createDiv(); + return Document.get().createDivElement(); } public Element getContainerElement(Element popup) { @@ -32,7 +32,7 @@ } public Element getStyleElement(Element popup) { - return DOM.getParent(popup); + return popup.getParentElement(); } /** @@ -52,7 +52,7 @@ * @param rect the clip rect */ public void setClip(Element popup, String rect) { - DOM.setStyleAttribute(popup, "clip", rect); + popup.getStyle().setProperty("clip", rect); } /** ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImplIE6.java Mon Jul 14 16:21:15 2008 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImplIE6.java Tue Dec 1 21:26:37 2009 @@ -15,7 +15,7 @@ */ package com.google.gwt.user.client.ui.impl; -import com.google.gwt.user.client.Element; +import com.google.gwt.dom.client.Element; /** * Internet Explorer 6 implementation of @@ -59,7 +59,7 @@ style.filter = 'alpha(opacity=0)'; // Visibility of frame should match visiblity of popup element. - style.visibility = popup.style.visibility; + style.visibility = popup.currentStyle.visibility; // Issue 2443: remove styles that affect the size of the iframe style.border = 0; @@ -71,14 +71,14 @@ style.top = popup.offsetTop; style.width = popup.offsetWidth; style.height = popup.offsetHeight; - style.zIndex = popup.style.zIndex; + style.zIndex = popup.currentStyle.zIndex; // updates position and dimensions as popup is moved & resized style.setExpression('left', 'this.__popup.offsetLeft'); style.setExpression('top', 'this.__popup.offsetTop'); style.setExpression('width', 'this.__popup.offsetWidth'); style.setExpression('height', 'this.__popup.offsetHeight'); - style.setExpression('zIndex', 'this.__popup.style.zIndex'); + style.setExpression('zIndex', 'this.__popup.currentStyle.zIndex'); popup.parentElement.insertBefore(frame, popup); }-*/; ======================================= --- /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java Wed Feb 25 09:37:22 2009 +++ /releases/2.0/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java Tue Dec 1 21:26:37 2009 @@ -15,10 +15,12 @@ */ package com.google.gwt.user.client.ui.impl; +import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Style.Display; +import com.google.gwt.dom.client.Style.Overflow; 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; /** * Implementation class used by {...@link com.google.gwt.user.client.ui.PopupPanel}. @@ -87,7 +89,7 @@ // of underlying scrollbars. To get around this problem, we introduce an // inner div which acts as the new containing element for the PopupPanel, // and this element is the one to which all styling is applied to. - DOM.setInnerHTML(outerElem, "<div></div>"); + outerElem.setInnerHTML("<div></div>"); // Mozilla determines the default stacking order for heavyweight elements // by their order on the page. If the PopupPanel is declared before @@ -99,7 +101,7 @@ // the PopupPanel becomes the highest element in the stacking order. DeferredCommand.addCommand(new Command() { public void execute() { - DOM.setStyleAttribute(outerElem, "overflow", "auto"); + outerElem.getStyle().setOverflow(Overflow.AUTO); } }); } @@ -109,7 +111,7 @@ @Override public Element getContainerElement(Element outerElem) { - return isFF2Mac ? DOM.getFirstChild(outerElem) : outerElem; + return isFF2Mac ? outerElem.getFirstChildElement() : outerElem; } @Override @@ -120,7 +122,7 @@ @Override public void setClip(Element popup, String rect) { super.setClip(popup, rect); - DOM.setStyleAttribute(popup, "display", "none"); - DOM.setStyleAttribute(popup, "display", ""); + popup.getStyle().setDisplay(Display.NONE); + popup.getStyle().clearDisplay(); } } ======================================= --- /releases/2.0/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css Thu Nov 5 11:50:57 2009 +++ /releases/2.0/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css Tue Dec 1 21:26:37 2009 @@ -479,7 +479,7 @@ overflow: hidden; } -.gwt-PopupGlass { +.gwt-PopupPanelGlass { background-color: #000; opacity: 0.3; filter: alpha(opacity=30); ======================================= --- /releases/2.0/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css Thu Nov 5 11:50:57 2009 +++ /releases/2.0/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css Tue Dec 1 21:26:37 2009 @@ -479,7 +479,7 @@ overflow: hidden; } -.gwt-PopupGlass { +.gwt-PopupPanelGlass { background-color: #000; opacity: 0.3; filter: alpha(opacity=30); ======================================= --- /releases/2.0/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css Thu Nov 5 11:50:57 2009 +++ /releases/2.0/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css Tue Dec 1 21:26:37 2009 @@ -463,7 +463,7 @@ overflow: hidden; } -.gwt-PopupGlass { +.gwt-PopupPanelGlass { background-color: #0cf; opacity: 0.3; filter: alpha(opacity=30); ======================================= --- /releases/2.0/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css Thu Nov 5 11:50:57 2009 +++ /releases/2.0/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css Tue Dec 1 21:26:37 2009 @@ -463,7 +463,7 @@ overflow: hidden; } -.gwt-PopupGlass { +.gwt-PopupPanelGlass { background-color: #0cf; opacity: 0.3; filter: alpha(opacity=30); ======================================= --- /releases/2.0/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css Thu Nov 5 11:50:57 2009 +++ /releases/2.0/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css Tue Dec 1 21:26:37 2009 @@ -479,7 +479,7 @@ overflow: hidden; } -.gwt-PopupGlass { +.gwt-PopupPanelGlass { background-color: #000; opacity: 0.3; filter: alpha(opacity=30); ======================================= --- /releases/2.0/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css Thu Nov 5 11:50:57 2009 +++ /releases/2.0/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css Tue Dec 1 21:26:37 2009 @@ -479,7 +479,7 @@ overflow: hidden; } -.gwt-PopupGlass { +.gwt-PopupPanelGlass { background-color: #000; opacity: 0.3; filter: alpha(opacity=30); ======================================= --- /releases/2.0/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml Wed Nov 25 08:09:45 2009 +++ /releases/2.0/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml Tue Dec 1 21:26:37 2009 @@ -32,7 +32,6 @@ which are not part of XML. (The file is also available as https://dl-ssl.google.com/gwt/DTD/xhtml.ent.) - Next, the bit in square brackets is even more optional. It shows how to add your own entities, in this case pulling in additional definitions for &point-left; and &point-right; from local file -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
