Revision: 6837 Author: jasonpar...@google.com Date: Wed Nov 11 08:22:19 2009 Log: Merging trunk at r6836 into releases/2.0. Merge was performed with the command:
svn merge --ignore-ancestry -c 6836 http://google-web-toolkit.googlecode.com/svn/trunk/ . http://code.google.com/p/google-web-toolkit/source/detail?r=6837 Added: /releases/2.0/user/src/com/google/gwt/uibinder/resources/UiBinder.xsd /releases/2.0/user/src/com/google/gwt/uibinder/resources/com.google.gwt.user.client.ui.xsd ======================================= --- /dev/null +++ /releases/2.0/user/src/com/google/gwt/uibinder/resources/UiBinder.xsd Wed Nov 11 08:22:19 2009 @@ -0,0 +1,302 @@ +<?xml version="1.0"?> + + <!-- + WARNING: This schema is a temporary, implementation detail. It is NOT + meant to be used for validation. It violates Unique Particle Attribution + (and thus is an invalid schema) and regularly does not have the same + constraints as the actual UiBinder parsers. The sole purpose is to + provide autocompletion proposals within Eclipse. + --> + <!-- + Eclipse may still try to validate using this (e.g. if user right-clicks + on the file and chooses "Validate"). This schema is left completely + extensible (you will see <xs:any> and <xs:anyAttribute> everywhere + possible, along with mixed content) in hopes of never flagging a + validation error. + --> + <!-- + Even though we do not use this for validation, it is useful to set + attributes as required. Eclipse uses this information to automatically + insert that attribute in the autocompletion. + --> + <!-- + An example case where we violate Unique Particle Attribution is when we + have an optional <ui:style> as a child of <ui:UiBinder> AND we allow + <xs:any /> as a child of <ui:UiBinder> too. This causes this schema to + be invalid (Eclipse still gladly accepts it and at least uses it for + offering autocomplete choices.) + --> + + <!-- + <xs:choice maxOccurs="unbounded" minOccurs="0"> allows for optional + children, with multiple occurrences of a child, and without any ordering + constraints. + --> + <!-- + <xs:sequence> <xs:any></xs:any> </xs:sequence> allows for a single + required child. + --> + <!-- + An attribute that is defined locally within an element will be without a + namespace (unprefixed). This means that the interpretation of the + attribute is up to its parent element. An attribute that is defined + globally will have the namespace of the targetNamespace. An unprefixed + "global" attribute can be defined via attribute groups. + --> + <!-- + <xs:any /> are used to allow for additional elements (which is required + for allowing third-party widgets, etc.) Similarly, <xs:anyAttribute /> + allows for additional attributes. + --> + <!-- + elementFormQualified="qualified" means child elements will need to be + namespaced also. (It will be a validation error if they are not + namespaced.) For example, this is what is used to have the "north" child + of "DockLayoutPanel" require the gwt-user namespace. + --> + <!-- + targetNamespace defines the namespace for elements and global attributes + defined in this file. + --> + <!-- + <complexType ... mixed="true"> allows for mixed content (text and child + elements, e.g. allowing HTML content). + --> + +<xs:schema + xmlns:xs="http://www.w3.org/2001/XMLSchema" + targetNamespace="urn:ui:com.google.gwt.uibinder" + xmlns="urn:ui:com.google.gwt.uibinder" + elementFormDefault="qualified"> + + <xs:element + name="UiBinder"> + <xs:complexType + mixed="true"> + + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + + <xs:element + name="style" + type="StyleType" /> + <xs:element + name="with" + type="WithType" /> + <xs:element + name="data" + type="DataType" /> + <xs:element + name="image" + type="ImageType" /> + + <!-- Allow any elements (e.g. widgets from any package) --> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="defaultLocale" + type="xs:string" /> + <xs:attribute + name="generateKeys" + type="xs:string" /> + <xs:attribute + name="generateFormat" + type="xs:string" /> + <xs:attribute + name="generateFilename" + type="xs:string" /> + <xs:attribute + name="generateLocales" + type="xs:string" /> + + <!-- Allow any attributes (e.g. namespace definitions) --> + <xs:anyAttribute + processContents="lax" /> + + </xs:complexType> + </xs:element> + + <xs:complexType + name="StyleType"> + <!-- Only allow text content --> + <xs:simpleContent> + <xs:extension + base="xs:string"> + + <xs:attribute + name="src" + type="xs:string" /> + <xs:attribute + name="field" + type="xs:string" /> + <xs:attribute + name="import" + type="xs:string" /> + <xs:attribute + name="type" + type="xs:string" /> + + <!-- Allow any attributes (e.g. from other schemas) --> + <xs:anyAttribute + processContents="lax" /> + + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:complexType + name="WithType" + mixed="true"> + <!-- + Be safe by allowing any content (text or elements). This pattern is + used below too. + --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="field" + type="xs:string" + use="required" /> + <xs:attribute + name="type" + type="xs:string" + use="required" /> + + <xs:anyAttribute + processContents="lax" /> + + </xs:complexType> + + <xs:complexType + name="DataType" + mixed="true"> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="field" + type="xs:string" + use="required" /> + <xs:attribute + name="src" + type="xs:string" + use="required" /> + + <xs:anyAttribute + processContents="lax" /> + + </xs:complexType> + + <xs:complexType + name="ImageType" + mixed="true"> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="field" + type="xs:string" + use="required" /> + <xs:attribute + name="src" + type="xs:string" /> + <xs:attribute + name="flipRtl" + type="xs:string" /> + <xs:attribute + name="repeatStyle" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + + </xs:complexType> + + <xs:element + name="attribute"> + <xs:complexType + mixed="true"> + <xs:complexContent> + <xs:extension + base="MsgType"> + <xs:attribute + name="name" + type="xs:string" + use="required" /> + </xs:extension> + </xs:complexContent> + </xs:complexType> + </xs:element> + + <xs:complexType + name="MsgType" + mixed="true"> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="description" + type="xs:string" /> + <xs:attribute + name="key" + type="xs:string" /> + <xs:attribute + name="meaning" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + + </xs:complexType> + + <xs:element + name="msg" + type="MsgType"> + </xs:element> + + <xs:element + name="ph"> + <xs:complexType + mixed="true"> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="name" + type="xs:string" + use="required" /> + <xs:attribute + name="example" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + + </xs:complexType> + </xs:element> + +</xs:schema> ======================================= --- /dev/null +++ /releases/2.0/user/src/com/google/gwt/uibinder/resources/com.google.gwt.user.client.ui.xsd Wed Nov 11 08:22:19 2009 @@ -0,0 +1,645 @@ +<?xml version="1.0"?> + + <!-- See UiBinder.xsd for some XML Schema tips. --> + +<xs:schema + xmlns:xs="http://www.w3.org/2001/XMLSchema" + targetNamespace="urn:import:com.google.gwt.user.client.ui" + xmlns="urn:import:com.google.gwt.user.client.ui" + elementFormDefault="qualified"> + + <xs:complexType + name="CellPanelType"> + + <!-- Any ordering, any number of occurrences --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + + <!-- The "cell" child --> + <xs:element + name="cell"> + <xs:complexType> + + <!-- Require one widget --> + <xs:sequence> + <xs:any + processContents="lax" /> + </xs:sequence> + + <xs:attribute + name="horizontalAlignment" + type="xs:string" /> + <xs:attribute + name="verticalAlignment" + type="xs:string" /> + <xs:attribute + name="width" + type="xs:string" /> + <xs:attribute + name="height" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <!-- Any widget --> + <xs:any + processContents="lax" /> + + </xs:choice> + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <xs:element + name="DockPanel" + type="CellPanelType" /> + + <xs:element + name="HorizontalPanel" + type="CellPanelType" /> + + <xs:element + name="VerticalPanel" + type="CellPanelType" /> + + <!-- CustomButton extends ButtonBase which implements HasHTML --> + <xs:complexType + name="CustomButtonType" + mixed="true"> + <xs:all + minOccurs="0" + maxOccurs="1"> + <xs:element + name="upFace" + type="CustomButtonChildElement" + minOccurs="0" /> + <xs:element + name="downFace" + type="CustomButtonChildElement" + minOccurs="0" /> + <xs:element + name="upHoveringFace" + type="CustomButtonChildElement" + minOccurs="0" /> + <xs:element + name="downHoveringFace" + type="CustomButtonChildElement" + minOccurs="0" /> + <xs:element + name="upDisabledFace" + type="CustomButtonChildElement" + minOccurs="0" /> + <xs:element + name="downDisabledFace" + type="CustomButtonChildElement" + minOccurs="0" /> + </xs:all> + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <!-- Allow mixed content (text and elements) --> + <xs:complexType + name="CustomButtonChildElement" + mixed="true"> + + <!-- Allow any children (HTML elements) --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="image" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <xs:element + name="PushButton" + type="CustomButtonType" /> + + <xs:element + name="ToggleButton" + type="CustomButtonType" /> + + <!-- + TODO: AFAICT, we cannot properly express the constraints of + DisclosurePanel. These constraints are that the header is optional and + any number of widgets are optional (and ordering is not enforced). Only + one of "header" or "customHeader" can appear. Ideally, this would be + something like <all><choice of header><choice minOccurs=0 + maxOccurs=unbounded><any /></choice></all>, but nesting <choice> inside + <all> is not possible, nor is having a <any /> appear in <all>. It is + currently not that important since we do not use this for validation. + --> + <xs:element + name="DisclosurePanel"> + <xs:complexType> + + <!-- + Allow any number of these (this allows multiple headers, which + is inconsistent with the actual parser logic, but we cannot + express the true constraints in an XSD.) + --> + <xs:choice + maxOccurs="unbounded" + minOccurs="0"> + + <xs:element + name="header"> + + <!-- Allow mixed content --> + <xs:complexType + mixed="true"> + + <!-- Allow any children (HTML elements) --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="openImage" + type="xs:string" /> + <xs:attribute + name="closedImage" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <xs:element + name="customHeader"> + <xs:complexType> + + <!-- Require one widget --> + <xs:sequence> + <xs:any + processContents="lax" /> + </xs:sequence> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <!-- Allow any widget(s) --> + <xs:any + processContents="lax" /> + + </xs:choice> + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <xs:complexType + name="DockLayoutPanelType"> + + <!-- + Allow any number of occurrences of child elements ("center" can only + really occur once, which this schema does not enforce.) + --> + <xs:choice + maxOccurs="unbounded" + minOccurs="0"> + <xs:element + name="north" + type="DockDirectionType"> + </xs:element> + <xs:element + name="south" + type="DockDirectionType"> + </xs:element> + <xs:element + name="west" + type="DockDirectionType"> + </xs:element> + <xs:element + name="east" + type="DockDirectionType"> + </xs:element> + <!-- The center element does not require the size, only a widget --> + <xs:element + name="center" + type="SingleChildWidgetType"> + </xs:element> + </xs:choice> + + <xs:attribute + name="unit" + type="xs:string"> + </xs:attribute> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <!-- Used for north, south, west, and east in the DockLayoutPanel. --> + <xs:complexType name="DockDirectionType"> + <xs:complexContent> + <xs:extension base="SingleChildWidgetType"> + <xs:attribute name="size" type="xs:string" use="required" /> + </xs:extension> + </xs:complexContent> + </xs:complexType> + + <xs:complexType + name="SingleChildWidgetType"> + + <!-- Require one widget --> + <xs:sequence> + <xs:any + processContents="lax" /> + </xs:sequence> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <xs:element + name="DockLayoutPanel" + type="DockLayoutPanelType" /> + + <xs:element + name="SplitLayoutPanel" + type="DockLayoutPanelType" /> + + <xs:element + name="HTMLPanel"> + + <!-- Allow mixed content --> + <xs:complexType + mixed="true"> + + <!-- Allow any children (HTML elements) --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="tag" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <xs:complexType + name="MenuBarType"> + + <!-- Allow any number of "MenuItem" children --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:element + name="MenuItem"> + <!-- MenuItem implements HasHTML --> + <xs:complexType + mixed="true"> + + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:element + name="MenuBar" + type="MenuBarType" /> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + </xs:choice> + + <xs:attribute + name="vertical" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <xs:element + name="MenuBar" + type="MenuBarType" /> + + + <xs:element + name="RadioButton"> + <!-- RadioButton extends ButtonBase which HasHTML --> + <xs:complexType + mixed="true"> + + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:attribute + name="name" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <xs:element + name="StackLayoutPanel"> + <xs:complexType> + + <!-- Allow any number of "stack" children --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:element + name="stack" + type="StackLayoutPanelStack"> + </xs:element> + </xs:choice> + + <xs:attribute + name="unit" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <xs:complexType + name="StackLayoutPanelStack"> + + <!-- + The constraints we want are one header and one widget in any order. + I don't think we can easily express this in XSD, so we do a closer + approximation of requiring at least two from {header, custom header, + or widget} (this violates the constraints in that two headers would + be valid.) + --> + <xs:choice + minOccurs="2" + maxOccurs="unbounded"> + + <xs:element + name="header" + type="MixedContentType" /> + + <xs:element + name="customHeader"> + <xs:complexType> + + <!-- Require one widget in the custom header --> + <xs:sequence> + <xs:any + processContents="lax" /> + </xs:sequence> + + <xs:attribute + name="size" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <!-- Require one widget in the stack --> + <xs:any + processContents="lax" /> + + </xs:choice> + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <xs:element + name="TabLayoutPanel"> + <xs:complexType> + + <!-- Any number of tabs --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + + <xs:element + name="tab"> + <xs:complexType> + + <!-- + Another instance of our inability to express the + constraints. We require one body (a widget) and + optionally one of the two headers. Instead, this + schema allows any number of these. + --> + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + + <xs:element + name="header" + type="MixedContentType"> + </xs:element> + + <xs:element + name="customHeader" + type="SingleChildWidgetType" /> + + <!-- One widget --> + <xs:any + processContents="lax" /> + + </xs:choice> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + </xs:choice> + + <xs:attribute + name="barHeight" + type="xs:string" + use="required" /> + + <xs:attribute + name="barUnit" + type="xs:string" /> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + </xs:element> + + <!-- + A complex type that contains both text and elements. There is no schema + for the elements, they can be any elements. + --> + <xs:complexType + name="MixedContentType" + mixed="true"> + + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <!-- + A complex type that contains only elements. There is no schema for the + elements, they can be any elements. + --> + <xs:complexType + name="ElementContentType"> + + <xs:choice + minOccurs="0" + maxOccurs="unbounded"> + <xs:any + processContents="lax" /> + </xs:choice> + + <xs:anyAttribute + processContents="lax" /> + </xs:complexType> + + <!-- + Below are widgets that do not have a custom parser, but that implement + the HasHTML interface. We must list these in the schema to allow Eclipse + to show autocomplete proposals in the element's text content (e.g. a + proposal for <ui:msg>) + --> + <xs:element + name="Anchor" + type="MixedContentType" /> + <xs:element + name="Button" + type="MixedContentType" /> + <xs:element + name="CheckBox" + type="MixedContentType" /> + <xs:element + name="DialogBox" + type="MixedContentType" /> + <xs:element + name="HTML" + type="MixedContentType" /> + <xs:element + name="InlineHTML" + type="MixedContentType" /> + <xs:element + name="Hyperlink" + type="MixedContentType" /> + <xs:element + name="InlineHyperlink" + type="MixedContentType" /> + <xs:element + name="RichTextArea" + type="MixedContentType" /> + <xs:element + name="TreeItem" + type="MixedContentType" /> + + <!-- + Below are widgets that do not have a custom parser, but that implement + the HasWidgets interface. We must list these in the schema to allow + Eclipse to show autocomplete proposals for children of these elements. + --> + <xs:element + name="CaptionPanel" + type="ElementContentType" /> + <xs:element + name="AbsolutePanel" + type="ElementContentType" /> + <xs:element + name="RootPanel" + type="ElementContentType" /> + <xs:element + name="DeckPanel" + type="ElementContentType" /> + <xs:element + name="FlowPanel" + type="ElementContentType" /> + <xs:element + name="LayoutPanel" + type="ElementContentType" /> + <xs:element + name="RootLayoutPanel" + type="ElementContentType" /> + <xs:element + name="StackPanel" + type="ElementContentType" /> + <xs:element + name="DecoratedStackPanel" + type="ElementContentType" /> + <xs:element + name="FlexTable" + type="ElementContentType" /> + <xs:element + name="Grid" + type="ElementContentType" /> + <xs:element + name="SimplePanel" + type="ElementContentType" /> + <xs:element + name="DecoratorPanel" + type="ElementContentType" /> + <xs:element + name="FocusPanel" + type="ElementContentType" /> + <xs:element + name="FormPanel" + type="ElementContentType" /> + <xs:element + name="PopupPanel" + type="ElementContentType" /> + <xs:element + name="DecoratedPopupPanel" + type="ElementContentType" /> + <xs:element + name="ScrollPanel" + type="ElementContentType" /> + <xs:element + name="HorizontalSplitPanel" + type="ElementContentType" /> + <xs:element + name="VerticalSplitPanel" + type="ElementContentType" /> + <xs:element + name="TabPanel" + type="ElementContentType" /> + <xs:element + name="DecoratedTabPanel" + type="ElementContentType" /> + <xs:element + name="Tree" + type="ElementContentType" /> + +</xs:schema> --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---