├── .gitignore ├── LICENSE ├── README.md ├── README.txt ├── archetype ├── LICENSE ├── README.txt ├── pom.xml └── src │ └── main │ └── resources │ ├── META-INF │ └── maven │ │ └── archetype-metadata.xml │ └── archetype-resources │ ├── .classpath │ ├── .project │ ├── .settings │ ├── com.google.gdt.eclipse.core.prefs │ └── com.google.gwt.eclipse.core.prefs │ ├── README.txt │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ ├── __projectName__.gwt.xml │ │ ├── client │ │ │ └── __projectName__.java │ │ └── public │ │ │ └── __projectName__.html │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ └── index.html │ └── test │ └── java │ └── __artifactId__ │ └── client │ └── __projectName__Test.java ├── change_version.sh ├── devtest ├── README.txt ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── google │ │ └── gwt │ │ └── query │ │ ├── DevTestRunner.gwt.xml │ │ ├── client │ │ ├── DevTestRunner.java │ │ └── MyTestCase.java │ │ └── public │ │ ├── jquery-1.4.4.js │ │ ├── jquery-1.6.2.js │ │ └── test.html │ └── webapp │ ├── WEB-INF │ └── web.xml │ └── index.html ├── extractInterface.pl ├── extractLazyInterfaces.sh ├── gwtquery-core ├── pom.xml ├── src │ ├── main │ │ ├── code-style │ │ │ ├── gwt-checkstyle.xml │ │ │ └── gwt-format.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── google │ │ │ │ ├── gwt │ │ │ │ └── query │ │ │ │ │ ├── Query.gwt.xml │ │ │ │ │ ├── QueryMin.gwt.xml │ │ │ │ │ ├── client │ │ │ │ │ ├── Browser.java │ │ │ │ │ ├── Console.java │ │ │ │ │ ├── Function.java │ │ │ │ │ ├── GQ.java │ │ │ │ │ ├── GQuery.java │ │ │ │ │ ├── IsProperties.java │ │ │ │ │ ├── Lazy.java │ │ │ │ │ ├── LazyBase.java │ │ │ │ │ ├── LazyGQuery.java │ │ │ │ │ ├── Predicate.java │ │ │ │ │ ├── Promise.java │ │ │ │ │ ├── Properties.java │ │ │ │ │ ├── Selector.java │ │ │ │ │ ├── Selectors.java │ │ │ │ │ ├── builders │ │ │ │ │ │ ├── JsniBundle.java │ │ │ │ │ │ ├── JsonBuilder.java │ │ │ │ │ │ ├── JsonBuilderBase.java │ │ │ │ │ │ ├── JsonFactory.java │ │ │ │ │ │ ├── Name.java │ │ │ │ │ │ ├── XmlBuilder.java │ │ │ │ │ │ └── XmlBuilderBase.java │ │ │ │ │ ├── css │ │ │ │ │ │ ├── BackgroundAttachmentProperty.java │ │ │ │ │ │ ├── BackgroundColorProperty.java │ │ │ │ │ │ ├── BackgroundImageProperty.java │ │ │ │ │ │ ├── BackgroundPositionProperty.java │ │ │ │ │ │ ├── BackgroundProperty.java │ │ │ │ │ │ ├── BackgroundRepeatProperty.java │ │ │ │ │ │ ├── BorderCollapseProperty.java │ │ │ │ │ │ ├── BorderColorProperty.java │ │ │ │ │ │ ├── BorderProperty.java │ │ │ │ │ │ ├── BorderSpacingProperty.java │ │ │ │ │ │ ├── BorderStyleProperty.java │ │ │ │ │ │ ├── BorderWidthProperty.java │ │ │ │ │ │ ├── CSS.java │ │ │ │ │ │ ├── CaptionSideProperty.java │ │ │ │ │ │ ├── ClearProperty.java │ │ │ │ │ │ ├── ClipProperty.java │ │ │ │ │ │ ├── ColorProperty.java │ │ │ │ │ │ ├── CssProperty.java │ │ │ │ │ │ ├── CursorProperty.java │ │ │ │ │ │ ├── DirectionProperty.java │ │ │ │ │ │ ├── DisplayProperty.java │ │ │ │ │ │ ├── EdgePositionProperty.java │ │ │ │ │ │ ├── EmptyCellsProperty.java │ │ │ │ │ │ ├── FloatProperty.java │ │ │ │ │ │ ├── FontSizeProperty.java │ │ │ │ │ │ ├── FontStyleProperty.java │ │ │ │ │ │ ├── FontVariantProperty.java │ │ │ │ │ │ ├── FontWeightProperty.java │ │ │ │ │ │ ├── HasCssValue.java │ │ │ │ │ │ ├── HeightProperty.java │ │ │ │ │ │ ├── Length.java │ │ │ │ │ │ ├── LetterSpacingProperty.java │ │ │ │ │ │ ├── LineHeightProperty.java │ │ │ │ │ │ ├── ListStyleImageProperty.java │ │ │ │ │ │ ├── ListStylePositionProperty.java │ │ │ │ │ │ ├── ListStyleProperty.java │ │ │ │ │ │ ├── ListStyleTypeProperty.java │ │ │ │ │ │ ├── MarginProperty.java │ │ │ │ │ │ ├── MultipleValueCssSetter.java │ │ │ │ │ │ ├── OutlineColorProperty.java │ │ │ │ │ │ ├── OutlineProperty.java │ │ │ │ │ │ ├── OutlineStyleProperty.java │ │ │ │ │ │ ├── OutlineWidthProperty.java │ │ │ │ │ │ ├── OverflowProperty.java │ │ │ │ │ │ ├── PaddingProperty.java │ │ │ │ │ │ ├── PositionProperty.java │ │ │ │ │ │ ├── RGBColor.java │ │ │ │ │ │ ├── SimpleCssSetter.java │ │ │ │ │ │ ├── TakesCssValue.java │ │ │ │ │ │ ├── TakesInteger.java │ │ │ │ │ │ ├── TakesLength.java │ │ │ │ │ │ ├── TakesNumber.java │ │ │ │ │ │ ├── TextAlignProperty.java │ │ │ │ │ │ ├── TextDecorationProperty.java │ │ │ │ │ │ ├── TextIdentProperty.java │ │ │ │ │ │ ├── TextTransformProperty.java │ │ │ │ │ │ ├── UnicodeBidiProperty.java │ │ │ │ │ │ ├── UriValue.java │ │ │ │ │ │ ├── VerticalAlignProperty.java │ │ │ │ │ │ ├── VisibilityProperty.java │ │ │ │ │ │ ├── WhiteSpaceProperty.java │ │ │ │ │ │ ├── WidthProperty.java │ │ │ │ │ │ ├── WordSpacingProperty.java │ │ │ │ │ │ └── ZIndexProperty.java │ │ │ │ │ ├── impl │ │ │ │ │ │ ├── AttributeImpl.java │ │ │ │ │ │ ├── AttributeTridentImpl.java │ │ │ │ │ │ ├── ConsoleBrowser.java │ │ │ │ │ │ ├── DocumentStyleImpl.java │ │ │ │ │ │ ├── DocumentStyleImplIE.java │ │ │ │ │ │ ├── HasSelector.java │ │ │ │ │ │ ├── SelectorEngine.java │ │ │ │ │ │ ├── SelectorEngineCssToXPath.java │ │ │ │ │ │ ├── SelectorEngineImpl.java │ │ │ │ │ │ ├── SelectorEngineNative.java │ │ │ │ │ │ ├── SelectorEngineNativeIE8.java │ │ │ │ │ │ ├── SelectorEngineNativeMin.java │ │ │ │ │ │ ├── SelectorEngineNativeMinIE8.java │ │ │ │ │ │ ├── SelectorEngineSizzle.java │ │ │ │ │ │ ├── SelectorEngineSizzleIE.java │ │ │ │ │ │ └── research │ │ │ │ │ │ │ ├── SelectorEngineJS.java │ │ │ │ │ │ │ ├── SelectorEngineJSIE.java │ │ │ │ │ │ │ ├── SelectorEngineSizzleGwt.java │ │ │ │ │ │ │ └── SelectorEngineXPath.java │ │ │ │ │ ├── js │ │ │ │ │ │ ├── JsCache.java │ │ │ │ │ │ ├── JsClosure.java │ │ │ │ │ │ ├── JsMap.java │ │ │ │ │ │ ├── JsNamedArray.java │ │ │ │ │ │ ├── JsNodeArray.java │ │ │ │ │ │ ├── JsObjectArray.java │ │ │ │ │ │ ├── JsRegexp.java │ │ │ │ │ │ └── JsUtils.java │ │ │ │ │ └── plugins │ │ │ │ │ │ ├── Effects.java │ │ │ │ │ │ ├── Events.java │ │ │ │ │ │ ├── LazyEffects.java │ │ │ │ │ │ ├── LazyEvents.java │ │ │ │ │ │ ├── LazyWidgets.java │ │ │ │ │ │ ├── MouseOptions.java │ │ │ │ │ │ ├── MousePlugin.java │ │ │ │ │ │ ├── Plugin.java │ │ │ │ │ │ ├── QueuePlugin.java │ │ │ │ │ │ ├── UiPlugin.java │ │ │ │ │ │ ├── Widgets.java │ │ │ │ │ │ ├── ajax │ │ │ │ │ │ ├── Ajax.java │ │ │ │ │ │ └── AjaxTransportJs.java │ │ │ │ │ │ ├── deferred │ │ │ │ │ │ ├── Callbacks.java │ │ │ │ │ │ ├── Deferred.java │ │ │ │ │ │ ├── FunctionDeferred.java │ │ │ │ │ │ ├── PromiseFunction.java │ │ │ │ │ │ ├── PromiseRPC.java │ │ │ │ │ │ ├── PromiseReqBuilder.java │ │ │ │ │ │ └── PromiseReqBuilderJSONP.java │ │ │ │ │ │ ├── effects │ │ │ │ │ │ ├── Bezier.java │ │ │ │ │ │ ├── ClipAnimation.java │ │ │ │ │ │ ├── Fx.java │ │ │ │ │ │ ├── PropertiesAnimation.java │ │ │ │ │ │ ├── Transform.java │ │ │ │ │ │ ├── Transitions.java │ │ │ │ │ │ └── TransitionsAnimation.java │ │ │ │ │ │ ├── events │ │ │ │ │ │ ├── EventsListener.java │ │ │ │ │ │ ├── GqEvent.java │ │ │ │ │ │ └── SpecialEvent.java │ │ │ │ │ │ └── widgets │ │ │ │ │ │ ├── ButtonWidgetFactory.java │ │ │ │ │ │ ├── HtmlPanelWidgetFactory.java │ │ │ │ │ │ ├── LabelWidgetFactory.java │ │ │ │ │ │ ├── PasswordTextBoxWidgetFactory.java │ │ │ │ │ │ ├── TextAreaWidgetFactory.java │ │ │ │ │ │ ├── TextBoxBaseWidgetFactory.java │ │ │ │ │ │ ├── TextBoxWidgetFactory.java │ │ │ │ │ │ ├── WidgetFactory.java │ │ │ │ │ │ ├── WidgetInitializer.java │ │ │ │ │ │ ├── WidgetsHtmlPanel.java │ │ │ │ │ │ └── WidgetsUtils.java │ │ │ │ │ ├── linker │ │ │ │ │ └── IFrameWithDocTypeLinker.java │ │ │ │ │ ├── rebind │ │ │ │ │ ├── BrowserGenerator.java │ │ │ │ │ ├── JsniBundleGenerator.java │ │ │ │ │ ├── JsonBuilderGenerator.java │ │ │ │ │ ├── LazyGenerator.java │ │ │ │ │ ├── SelectorGeneratorBase.java │ │ │ │ │ ├── SelectorGeneratorCssToXPath.java │ │ │ │ │ ├── SelectorGeneratorJS.java │ │ │ │ │ ├── SelectorGeneratorJSOptimal.java │ │ │ │ │ ├── SelectorGeneratorNative.java │ │ │ │ │ ├── SelectorGeneratorNativeIE8.java │ │ │ │ │ ├── SelectorGeneratorNativeIE9.java │ │ │ │ │ ├── SelectorGeneratorXPath.java │ │ │ │ │ └── XmlBuilderGenerator.java │ │ │ │ │ └── vm │ │ │ │ │ ├── AjaxTransportJre.java │ │ │ │ │ ├── CookieManager.java │ │ │ │ │ ├── JsonBuilderHandler.java │ │ │ │ │ ├── JsonFactoryJre.java │ │ │ │ │ └── ResponseJre.java │ │ │ │ └── web │ │ │ │ └── bindery │ │ │ │ └── requestfactory │ │ │ │ └── shared │ │ │ │ └── gquery │ │ │ │ └── PromiseRF.java │ │ └── super │ │ │ └── com │ │ │ └── google │ │ │ └── gwt │ │ │ └── query │ │ │ └── super │ │ │ └── com │ │ │ └── google │ │ │ └── gwt │ │ │ └── query │ │ │ └── client │ │ │ └── GQ.java │ └── test │ │ └── java │ │ └── com │ │ └── google │ │ └── gwt │ │ └── query │ │ ├── QueryTest.gwt.xml │ │ ├── client │ │ ├── GQueryAjaxTestGwt.java │ │ ├── GQueryCoreTestGwt.java │ │ ├── GQueryCssTestGwt.java │ │ ├── GQueryDeferredTestGwt.java │ │ ├── GQueryEffectsTestGwt.java │ │ ├── GQueryEventsTestGwt.java │ │ ├── GQueryGwtSuiteTest.java │ │ ├── GQueryJsInteropTestGwt.java │ │ ├── GQueryJsTestGwt.java │ │ ├── GQuerySelectorsTestGwt.java │ │ ├── GQueryWidgetsTestGwt.java │ │ ├── JreQueryCoreTest.java │ │ ├── ajax │ │ │ ├── AjaxTestGwt.java │ │ │ ├── AjaxTestJre.java │ │ │ └── AjaxTests.java │ │ ├── dbinding │ │ │ ├── DataBindingTestGwt.java │ │ │ └── DataBindingTestJre.java │ │ ├── deferred │ │ │ ├── DeferredTest.java │ │ │ └── DeferredTestGwt.java │ │ └── impl │ │ │ ├── SelectorEnginesTest.java │ │ │ └── SelectorEnginesTestGwt.java │ │ ├── rebind │ │ └── SelectorGeneratorsTest.java │ │ └── servlet │ │ └── GQAjaxTestServlet.java └── upload_sonatype.sh ├── jsquery ├── README.txt ├── pom.xml ├── samples │ ├── images │ │ └── zoom │ │ │ ├── thumb1.jpg │ │ │ ├── thumb2.jpg │ │ │ ├── thumb3.jpg │ │ │ ├── thumb4.jpg │ │ │ ├── thumb5.jpg │ │ │ ├── thumb6.jpg │ │ │ ├── thumb7.jpg │ │ │ ├── thumb8.jpg │ │ │ ├── thumb9.jpg │ │ │ └── thumb_bg.png │ └── zoom.html └── src │ └── main │ ├── java │ ├── com │ │ └── google │ │ │ └── gwt │ │ │ └── query │ │ │ └── jsquery │ │ │ ├── JsQuery.gwt.xml │ │ │ ├── JsQueryApi.gwt.xml │ │ │ ├── client │ │ │ ├── GQueryOverlay.java │ │ │ ├── JsQuery.java │ │ │ ├── JsQueryApi.java │ │ │ └── JsQueryUtils.java │ │ │ └── public │ │ │ └── JsQuery.html │ └── gwtquery │ │ └── jsplugins │ │ └── menu │ │ ├── JsQueryMenu.gwt.xml │ │ ├── client │ │ ├── JsMenu.java │ │ ├── JsQueryMenu.java │ │ └── jsmenu.diff │ │ └── public │ │ ├── arrow_right.gif │ │ ├── arrowdown.png │ │ ├── demo.html │ │ ├── myshadow.png │ │ └── style.css │ └── webapp │ ├── WEB-INF │ └── web.xml │ └── index.html ├── pom.xml ├── samples ├── pom.xml └── src │ └── main │ ├── java │ └── gwtquery │ │ └── samples │ │ ├── AnimationsSample.gwt.xml │ │ ├── ColorEffects.gwt.xml │ │ ├── FadeEffectsSample.gwt.xml │ │ ├── GwtQueryBench.gwt.xml │ │ ├── GwtQueryDemo.gwt.xml │ │ ├── GwtQueryEffects.gwt.xml │ │ ├── GwtQueryEffectsMin.gwt.xml │ │ ├── GwtQueryImageZoom.gwt.xml │ │ ├── GwtQuerySample.gwt.xml │ │ ├── HomePageSample.gwt.xml │ │ ├── JsCollectionVsJavaCollection.gwt.xml │ │ ├── SlideEffectsSample.gwt.xml │ │ ├── client │ │ ├── AnimationsSample.java │ │ ├── GwtQueryBenchModule.java │ │ ├── GwtQueryDemoModule.java │ │ ├── GwtQueryEffectsModule.java │ │ ├── GwtQueryImageZoom.java │ │ ├── GwtQuerySampleModule.java │ │ ├── HomePageSample.java │ │ ├── JsCollectionVsJavaCollection.java │ │ ├── MySelectors.java │ │ └── effects │ │ │ ├── ColorEffectsSample.java │ │ │ ├── FadeEffectsSample.java │ │ │ └── SlideEffectsSample.java │ │ └── public │ │ ├── AnimationsSample.html │ │ ├── ColorEffectsSample.html │ │ ├── FadeEffectsSample.html │ │ ├── GwtQueryBench.html │ │ ├── GwtQueryDemo.html │ │ ├── GwtQueryEffects.html │ │ ├── GwtQueryEffectsMin.html │ │ ├── GwtQueryImageZoom.html │ │ ├── GwtQuerySample.html │ │ ├── HomePageSample.html │ │ ├── JsCollectionVsJavaCollection.html │ │ ├── SlideEffectsSample.html │ │ ├── html │ │ ├── dojobench.html │ │ ├── domassistantbench.html │ │ ├── gwtbench.html │ │ ├── iframebench.html │ │ ├── jquerybench.html │ │ ├── prototypebench.html │ │ └── sizzlebench.html │ │ ├── images │ │ ├── bench │ │ │ ├── animated-flag.gif │ │ │ ├── grass-texture-small.jpg │ │ │ ├── grass-texture.jpg │ │ │ ├── horse.gif │ │ │ ├── horse.png │ │ │ ├── logo-dojo.gif │ │ │ ├── logo-domassistant.gif │ │ │ ├── logo-gwt.gif │ │ │ ├── logo-jquery.gif │ │ │ ├── logo-prototype.gif │ │ │ └── logo-sizzle.gif │ │ └── zoom │ │ │ ├── thumb1.jpg │ │ │ ├── thumb2.jpg │ │ │ ├── thumb3.jpg │ │ │ ├── thumb4.jpg │ │ │ ├── thumb5.jpg │ │ │ ├── thumb6.jpg │ │ │ ├── thumb7.jpg │ │ │ ├── thumb8.jpg │ │ │ ├── thumb9.jpg │ │ │ └── thumb_bg.png │ │ └── js │ │ ├── DOMAssistantComplete-2.7.js │ │ ├── dojo.js │ │ ├── ext-all.js │ │ ├── ext-base.js │ │ ├── ext-core.js │ │ ├── jquery-1.2.3.js │ │ ├── jquery-1.3.1.js │ │ ├── jquery-1.4.4.js │ │ ├── jquery-1.6.2.js │ │ ├── jquery-2.1.3.min.js │ │ ├── prototype-1.6.0.3.js │ │ ├── selector.js │ │ ├── sizzle.js │ │ └── sizzle.min.js │ └── webapp │ ├── WEB-INF │ └── web.xml │ └── index.html ├── svnignore.sh ├── update_demos_svn.sh └── update_docs_svn.sh /.gitignore: -------------------------------------------------------------------------------- 1 | #Mac OS X generated files 2 | .DS_Store* 3 | Thumbs.db 4 | 5 | #Compiled 6 | /build 7 | /classes 8 | *.jar 9 | *.class 10 | target 11 | 12 | #intellij 13 | /.idea 14 | #GWT generated file 15 | *~ 16 | *.log 17 | *.log.* 18 | *.ipr 19 | *.iml 20 | *.iws 21 | gen 22 | .gwt 23 | gwt-unitCache 24 | 25 | #eclipse 26 | .project 27 | .classpath 28 | .settings 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, gwtquery team 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GwtQuery 2 | ======== 3 | 4 | GwtQuery a.k.a. GQuery is a jQuery-like API written in GWT, which allows GWT to be used in progressive enhancement scenarios where perhaps GWT widgets are too heavyweight. It can also be used to find and improve your GWT widgets. 5 | 6 | GwtQuery is easy to learn for those using jQuery as they share the same api, aditionally gquery adds nice features like type-safe css, compile time optimisations, etc. 7 | 8 | Currently, almost the jQuery API is written and all CSS3 selectors should be supported. 9 | 10 | 11 | We are working in a brand new web site, in the meanwhile for more information/documentation 12 | visit gQuery doc pages at : http://dev.arcbees.com/gquery/ 13 | 14 | ## Thanks to 15 | 16 | [![Vaadin.com](https://rawgit.com/manolo/vaadin-stuff/master/vaadin-ui.png)](http://vaadin.com) 17 | 18 | [![Atlassian](http://i.imgur.com/BKkj8Rg.png)](https://www.atlassian.com/) 19 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | 2 | Introduction 3 | ------------ 4 | 5 | GwtQuery is a jQuery-like API written in GWT, which allows GWT to be used in 6 | progressive enhancement scenarios where perhaps GWT widgets are too 7 | heavyweight. 8 | 9 | Currently, only a part of the jQuery API is written. Most CSS3 selectors are 10 | supported. People feel free to contribute patches to bring the API more in 11 | line with jQuery. 12 | 13 | This code is alpha, so expect it to break, and expect the API to change 14 | in the future. 15 | 16 | I would like the thank John Resig for writing jQuery, a kick ass library, 17 | that is a pleasure to use, and I hope to capture that feeling in GWT. Also, 18 | thanks to Robery Nyman for writing the fastest CSS Selector API 19 | implementation (DOMAssistant), which I used as a guide for the GWT 20 | impementation. GwtQuery is in large part, a port of DOMAssistant. 21 | 22 | I am releasing this under the MIT License in the spirit for Robert Nyman's 23 | choice, since the performance of this library wouldn't have been possible 24 | without him. 25 | 26 | Thanks, 27 | Ray Cromwell 28 | CTO, TimeFire 29 | -------------------------------------------------------------------------------- /archetype/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, gwtquery team 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /archetype/README.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | This is the archetype to create new GwtQuery applications. 4 | 5 | - Assuming you have installed maven, compile and install it just running: 6 | $ mvn clean install 7 | 8 | - To use the archetype run: 9 | $ mvn archetype:generate -DarchetypeGroupId=com.googlecode.gwtquery \ 10 | -DarchetypeArtifactId=gquery-archetype \ 11 | -DarchetypeVersion=0.1 12 | -DartifactId=myproject \ 13 | -DpluginName=MyProject 14 | 15 | - Then change to the folder myplugin and run: 16 | $ mvn clean install 17 | 18 | - To run the application just run: 19 | $ mvn gwt:run 20 | -------------------------------------------------------------------------------- /archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | com.googlecode.gwtquery 6 | gquery-archetype 7 | 1.5-SNAPSHOT 8 | maven-archetype 9 | GwtQuery Archetype 10 | 11 | 12 | org.sonatype.oss 13 | oss-parent 14 | 3 15 | 16 | 17 | This archetype generates a GWT project with all set to use GwtQuery and its plugins. 18 | 19 | 20 | scm:git:https://code.google.com/p/gwtquery/ 21 | scm:git:git@github.com:gwtquery/gwtquery.git 22 | http://code.google.com/p/gwtquery/source/browse/ 23 | 24 | 25 | 26 | 27 | manolo 28 | Manuel Carrasco Moñino 29 | manolo@apache.org 30 | ASF 31 | 32 | Owner 33 | Developer 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.archetype 42 | archetype-packaging 43 | 2.0-alpha-5 44 | 45 | 46 | 47 | 48 | 49 | 50 | maven-archetype-plugin 51 | 2.0-alpha-5 52 | true 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /archetype/src/main/resources/META-INF/maven/archetype-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 1.0-SNAPSHOT 8 | 9 | 10 | 11 | 12 | 13 | .settings 14 | 15 | **/*.prefs 16 | 17 | 18 | 19 | 20 | 21 | .project 22 | .classpath 23 | README.txt 24 | 25 | 26 | 27 | src/main/java 28 | 29 | **/*.java 30 | **/*.xml 31 | **/*.html 32 | 33 | 34 | 35 | src/test/java 36 | 37 | **/*.java 38 | **/*.xml 39 | 40 | 41 | 42 | src/main/webapp 43 | 44 | **/*.html 45 | **/*.xml 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/.classpath: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/.project: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | ${projectName} 7 | ${projectName} is GwtQuery application 8 | 9 | 10 | 11 | 12 | org.eclipse.jdt.core.javabuilder 13 | 14 | 15 | 16 | 17 | com.google.gdt.eclipse.core.webAppProjectValidator 18 | 19 | 20 | 21 | 22 | com.google.gwt.eclipse.core.gwtProjectValidator 23 | 24 | 25 | 26 | 27 | org.maven.ide.eclipse.maven2Builder 28 | 29 | 30 | 31 | 32 | 33 | org.maven.ide.eclipse.maven2Nature 34 | org.eclipse.jdt.core.javanature 35 | com.google.gwt.eclipse.core.gwtNature 36 | 37 | 38 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/.settings/com.google.gdt.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | jarsExcludedFromWebInfLib= 3 | warSrcDir=src/main/webapp 4 | warSrcDirIsOutput=true 5 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/.settings/com.google.gwt.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | eclipse.preferences.version=1 5 | entryPointModules=${package}.${artifactId}.${projectName} 6 | filesCopiedToWebInfLib=gwt-servlet.jar 7 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/README.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | This is the project ${projectName} which uses the GwtQuery Library. 4 | 5 | - Assuming you have installed maven, compile and install it just running: 6 | $ mvn clean install 7 | 8 | - Run it in development mode: 9 | $ mvn gwt:run 10 | and point your browser to http://127.0.0.1:8888/${projectName}/${projectName}.html?gwt.codesvr=127.0.0.1:9997 11 | 12 | - Run superdev mode: 13 | $ mvn gwt:run-codeserver 14 | and point your browser to http://127.0.0.1:9876/${projectName}/${projectName}.html 15 | 16 | - Import and run in Eclipse: 17 | 18 | The archetype generates a project ready to be used in eclipse, 19 | but before importing it you have to install the following plugins: 20 | 21 | * Google plugin for eclipse (update-site: http://dl.google.com/eclipse/plugin/3.7 or 3.6 or 3.5) 22 | * Sonatype Maven plugin (update-site: http://m2eclipse.sonatype.org/site/m2e) 23 | 24 | Then you can import the project in your eclipse workspace: 25 | 26 | * File -> Import -> Existing Projects into Workspace 27 | 28 | Finally you should be able to run the project in development mode and to run the gwt test unit. 29 | 30 | * Right click on the project -> Run as -> Web Application 31 | * Right click on the test class -> Run as -> GWT JUnit Test 32 | 33 | - Although the project has the files .classpath and .project, you could generate them running any 34 | of the following commands: 35 | 36 | $ mvn eclipse:m2eclipse (if you like to use m2eclipse) 37 | $ mvn eclipse:eclipse (to use the project without m2eclipse) 38 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/src/main/java/__projectName__.gwt.xml: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/src/main/java/client/__projectName__.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.client; 5 | import com.google.gwt.dom.client.Element; 6 | import com.google.gwt.query.client.Function; 7 | import static com.google.gwt.query.client.GQuery.*; 8 | 9 | 10 | import com.google.gwt.core.client.EntryPoint; 11 | 12 | /** 13 | * Example code for a GwtQuery application 14 | */ 15 | public class ${projectName} implements EntryPoint { 16 | 17 | public void onModuleLoad() { 18 | 19 | ${symbol_dollar}("div") 20 | .hover(new Function() { 21 | public void f(Element e) { 22 | ${symbol_dollar}(e).css("color", "blue").stop(true, true).animate("fontSize: '+=10px'"); 23 | } 24 | }, new Function() { 25 | public void f(Element e) { 26 | ${symbol_dollar}(e).css("color", "").stop(true, true).animate("fontSize: '-=10px'"); 27 | } 28 | }); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/src/main/java/public/__projectName__.html: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | 7 | 8 | GwtQuery: ${projectName} plugin example 9 | 11 | 12 | 13 | 14 |
Hello world
15 | 16 | 17 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | ${projectName}/${projectName}.html 7 | 8 | 9 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 |

Loading the demo of the ${projectName} gwtquery application

13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /archetype/src/main/resources/archetype-resources/src/test/java/__artifactId__/client/__projectName__Test.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.client; 5 | 6 | import static com.google.gwt.query.client.GQuery.*; 7 | import com.google.gwt.junit.client.GWTTestCase; 8 | import com.google.gwt.query.client.GQuery; 9 | import com.google.gwt.query.client.plugins.Effects.Speed; 10 | import com.google.gwt.user.client.Event; 11 | import com.google.gwt.user.client.Timer; 12 | /** 13 | * Test class for ${projectName} entry-point 14 | */ 15 | public class ${projectName}Test extends GWTTestCase { 16 | 17 | public String getModuleName() { 18 | return "${package}.${projectName}"; 19 | } 20 | 21 | private double fontSize(GQuery g) { 22 | return $(g).cur("fontSize", true); 23 | } 24 | 25 | public void testOnModuleLoad() { 26 | 27 | // Create a container in the document 28 | final GQuery g = $("
").appendTo(document); 29 | 30 | // run onModuleLoad 31 | ${projectName} a = new ${projectName}(); 32 | a.onModuleLoad(); 33 | 34 | // delay the test 35 | delayTestFinish(Speed.DEFAULT * 5); 36 | 37 | // trigger mouse over event 38 | final double size1 = fontSize(g); 39 | g.trigger(Event.ONMOUSEOVER); 40 | new Timer() { 41 | public void run() { 42 | // assert that the font size increases 43 | assertTrue(fontSize(g) > size1); 44 | 45 | // trigger mouse out event 46 | final double size2 = fontSize(g); 47 | g.trigger(Event.ONMOUSEOUT); 48 | new Timer() { 49 | public void run() { 50 | // assert that the font size decreases 51 | assertTrue(fontSize(g) < size2); 52 | g.remove(); 53 | 54 | // finish the test 55 | finishTest(); 56 | } 57 | }.schedule(Speed.DEFAULT); 58 | } 59 | }.schedule(Speed.DEFAULT); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /change_version.sh: -------------------------------------------------------------------------------- 1 | 2 | [ -z "$1" ] && exit 3 | 4 | for i in pom.xml */pom.xml 5 | do 6 | V=`head -20 $i | grep "" | head -1 | cut -d ">" -f2 | cut -d "<" -f1` 7 | perl -pi -e "s;$V;$1;" $i 8 | echo $V $i 9 | done 10 | 11 | perl -pi -e "s;.+;$1;" \ 12 | archetype/src/main/resources/archetype-resources/pom.xml 13 | -------------------------------------------------------------------------------- /devtest/README.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | This module is thought to run tests in development mode in 4 | order to speed up TDD. 5 | 6 | - Put your tests in the DevTestRunner class. 7 | - Call gwtSetup() and your test in the entryPoint. 8 | - If you need any assertion method provided by the junit 9 | library put it in the class MyTestCase. 10 | There are already a bunch of them. 11 | - Run the module in development mode: mvn gwt:run 12 | or lauch it from eclipse 13 | - See the output of the tests. If there is a failure 14 | a stacktrace should be shown in the output. 15 | - Modify your test code and reload the application in your browser. 16 | - When your test was ready put it in your test class extending 17 | GWTTestCase. 18 | 19 | - If you prefer superdev mode run: mvn gwt:run-codeserver but 20 | you have to be familiar with debuging in javascript and use source maps. 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /devtest/src/main/java/com/google/gwt/query/DevTestRunner.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /devtest/src/main/java/com/google/gwt/query/public/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /devtest/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /devtest/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /extractLazyInterfaces.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | perl extractInterface.pl --lazy --input=./gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java 4 | perl extractInterface.pl --lazy --input=./gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java 5 | perl extractInterface.pl --lazy --input=./gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java 6 | perl extractInterface.pl --lazy --input=./gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java 7 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/Lazy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client; 17 | 18 | /** 19 | * A tagging interface which triggers the LazyGenerator for type T. 20 | * LazyGenerator creates an implementation of Type T for the class by forwarding 21 | * method calls to the class which implements the Lazy interface. Methods in the 22 | * generated class do not execute but instead queue up a deferred execution of 23 | * the method. 24 | * 25 | * @param 26 | * @param 27 | */ 28 | public interface Lazy { 29 | 30 | /** 31 | * Create a lazy instance of the current class. Most implementing classes will 32 | * automate this by simply invoking GWT.create(). 33 | */ 34 | T createLazy(); 35 | } 36 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/LazyBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client; 17 | 18 | /** 19 | * All lazy interfaces must extend this baseclass. This ensures the done() 20 | * method exists and returns an executable function. 21 | * 22 | * @param 23 | */ 24 | public interface LazyBase { 25 | Function done(); 26 | } 27 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/Predicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | 20 | /** 21 | * A predicate function used by some GQuery methods. 22 | */ 23 | public class Predicate { 24 | 25 | /** 26 | * Used by GQuery methods which loop over matched widgets and 27 | * invoke a callback on each widget expecting a boolean value. 28 | * 29 | * @param e 30 | * the element for this call 31 | * @param index 32 | * the element position in the gquery elements array. 33 | */ 34 | public boolean f(Element e, int index) { 35 | return f((Object) e, index); 36 | } 37 | 38 | public boolean f(T e, int index) { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/Selector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client; 17 | 18 | import static java.lang.annotation.ElementType.METHOD; 19 | 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Used to pass a CSS Selector to a generator at compile time 26 | */ 27 | @Target({METHOD}) 28 | @Retention(RetentionPolicy.RUNTIME) 29 | public @interface Selector { 30 | 31 | String value(); 32 | } 33 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/Selectors.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | import com.google.gwt.dom.client.Node; 20 | import com.google.gwt.dom.client.NodeList; 21 | 22 | /** 23 | * Tagging interface used to generate compile time selectors. 24 | */ 25 | public interface Selectors { 26 | 27 | /** 28 | * A compiled selector that can be lazily turned into a GQuery. 29 | */ 30 | public interface DeferredSelector { 31 | 32 | /** 33 | * Evaluate the compiled selector with the given DOM node as a context. 34 | * 35 | * Returns a NodeList as a result which you could transform into a GQuery 36 | * object passing it as argument to the $() function. 37 | */ 38 | NodeList runSelector(Node ctx); 39 | 40 | /** 41 | * The selector which was compiled. 42 | */ 43 | String getSelector(); 44 | } 45 | 46 | /** 47 | * Return all the selectors defined for this interface, so as 48 | * we can get the css representation of each one and lazily evaluate it 49 | * in runtime. 50 | */ 51 | DeferredSelector[] getAllSelectors(); 52 | 53 | /** 54 | * Set the context for all the selectors. 55 | * By default they are evaluated in all the document. 56 | */ 57 | void setRoot(Node node); 58 | 59 | /** 60 | * Get the configured root context. 61 | */ 62 | Node getRoot(); 63 | 64 | /** 65 | * Used for benchmarking purposes, it returns true if the selector engine 66 | * for this browser is using a pure javascript implementation or a native 67 | * one. 68 | * 69 | * It is useful to check if IE8 native selectors are being used. 70 | */ 71 | boolean isDegradated(); 72 | } 73 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.builders; 17 | 18 | import com.google.gwt.query.client.IsProperties; 19 | 20 | /** 21 | * Tagging interface used to generate JsonBuilder classes. 22 | */ 23 | public interface JsonBuilder extends IsProperties { 24 | 25 | /** 26 | * parses a json string and loads the resulting properties object, 27 | * if the param 'fix' is true, the syntax of the json string will be 28 | * checked previously and fixed when possible. 29 | */ 30 | J parse(String json, boolean fix); 31 | 32 | /** 33 | * Returns the wrapped object, normally a Properties jso in client 34 | * but can be used to return the underlying Json implementation in JVM. 35 | * 36 | * @deprecated use asObject() instead. 37 | */ 38 | J getProperties(); 39 | 40 | /** 41 | * return the short name of this class, to use in json structures. 42 | */ 43 | String getJsonName(); 44 | } 45 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.builders; 17 | 18 | import com.google.gwt.query.client.IsProperties; 19 | 20 | /** 21 | * Factory interface. 22 | */ 23 | public interface JsonFactory { 24 | T create(Class clz); 25 | 26 | IsProperties create(String s); 27 | 28 | IsProperties create(); 29 | } 30 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/builders/Name.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.builders; 17 | 18 | import static java.lang.annotation.ElementType.METHOD; 19 | 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Annotation used to specify the attribute, tag or property name 26 | * in Json or Xml builders. 27 | */ 28 | @Target({METHOD}) 29 | @Retention(RetentionPolicy.RUNTIME) 30 | public @interface Name { 31 | String value(); 32 | } 33 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/builders/XmlBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.builders; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | 20 | import java.util.Date; 21 | 22 | /** 23 | * Tagging interface used to generate XmlBuilder classes. 24 | */ 25 | public interface XmlBuilder { 26 | /** 27 | * load a string or a documentElement. 28 | */ 29 | J load(Object o); 30 | 31 | /** 32 | * parses a xml string and loads the resulting documentElement. 33 | */ 34 | J parse(String xml); 35 | 36 | /** 37 | * Returns the documentElement. 38 | */ 39 | Element getRootElement(); 40 | 41 | /** 42 | * Appends a node. 43 | */ 44 | void append(XmlBuilder x); 45 | 46 | /** 47 | * Appends xml content. 48 | */ 49 | void append(String x); 50 | 51 | /** 52 | * Returns the text content of the element. 53 | */ 54 | String getText(); 55 | 56 | /** 57 | * Sets the text content of the element. 58 | */ 59 | J setText(String t); 60 | 61 | /** 62 | * Returns the text content of the element as a number. 63 | */ 64 | double getTextAsNumber(); 65 | 66 | /** 67 | * Returns the text content of the element as a date. 68 | */ 69 | Date getTextAsDate(); 70 | 71 | /** 72 | * Returns whether the text content of the element is true or false. 73 | * It is false when the string matches false, off, 0 or empty. 74 | */ 75 | boolean getTextAsBoolean(); 76 | 77 | /** 78 | * Returns the Enum value of the text content of the element. 79 | */ 80 | > T getTextAsEnum(Class clazz); 81 | } 82 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundAttachmentProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * If a background image is specified, this property specifies whether it is 22 | * fixed with regard to the viewport ('fixed') or scrolls along with the 23 | * containing block ('scroll'). 24 | */ 25 | public class BackgroundAttachmentProperty extends 26 | CssProperty { 27 | 28 | /** 29 | * BackgroundAttachment. 30 | */ 31 | public static enum BackgroundAttachment implements HasCssName { 32 | /** 33 | * Background image is fixed. 34 | */ 35 | FIXED { 36 | @Override 37 | public String getCssName() { 38 | return FIXED_VALUE; 39 | } 40 | }, 41 | /** 42 | * Background image scrolls when viewport is scrolled. 43 | */ 44 | SCROLL { 45 | @Override 46 | public String getCssName() { 47 | return SCROLL_VALUE; 48 | } 49 | }; 50 | 51 | public abstract String getCssName(); 52 | } 53 | 54 | private static final String CSS_PROPERTY = "backgroundAttachment"; 55 | private static final String FIXED_VALUE = "fixed"; 56 | private static final String SCROLL_VALUE = "scroll"; 57 | 58 | public static void init() { 59 | CSS.BACKGROUND_ATTACHMENT = new BackgroundAttachmentProperty(); 60 | } 61 | 62 | private BackgroundAttachmentProperty() { 63 | super(CSS_PROPERTY); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundColorProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * This property sets the background color of an element, either a color 20 | * value or the keyword 'transparent', to make the underlying colors shine 21 | * through. 22 | */ 23 | public class BackgroundColorProperty extends CssProperty { 24 | 25 | private static final String CSS_PROPERTY = "backgroundColor"; 26 | 27 | public static void init() { 28 | CSS.BACKGROUND_COLOR = new BackgroundColorProperty(); 29 | } 30 | 31 | private BackgroundColorProperty() { 32 | super(CSS_PROPERTY); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundImageProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * This property sets the background image of an element. 20 | */ 21 | public class BackgroundImageProperty extends CssProperty { 22 | 23 | private static final String CSS_PROPERTY = "backgroundImage"; 24 | 25 | public static void init() { 26 | CSS.BACKGROUND_IMAGE = new BackgroundImageProperty(); 27 | } 28 | 29 | private BackgroundImageProperty() { 30 | super(CSS_PROPERTY); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundRepeatProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * If a background image is specified, this property specifies whether the image 22 | * is repeated (tiled), and how. All tiling covers the content and padding areas 23 | * of a box 24 | */ 25 | public class BackgroundRepeatProperty extends 26 | CssProperty { 27 | 28 | /** 29 | * Define possible values for backgroung-repeat property. 30 | * 31 | */ 32 | public static enum BackgroundRepeat implements HasCssName { 33 | /** 34 | * The image is not repeated: only one copy of the image is drawn. 35 | */ 36 | NO_REPEAT, 37 | /** 38 | * The image is repeated both horizontally and vertically. 39 | */ 40 | REPEAT, 41 | /** 42 | * The image is repeated horizontally only. 43 | */ 44 | REPEAT_X, 45 | /** 46 | * The image is repeated vertically only. 47 | */ 48 | REPEAT_Y; 49 | 50 | public String getCssName() { 51 | return name().toLowerCase().replace('_', '-'); 52 | } 53 | } 54 | 55 | private static final String CSS_PROPERTY = "backgroundRepeat"; 56 | 57 | public static void init() { 58 | CSS.BACKGROUND_REPEAT = new BackgroundRepeatProperty(); 59 | } 60 | 61 | private BackgroundRepeatProperty() { 62 | super(CSS_PROPERTY); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderCollapseProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | *The border-collapse selects a table's border model. 22 | */ 23 | public class BorderCollapseProperty extends 24 | CssProperty { 25 | 26 | /** 27 | * BorderCollapse. 28 | */ 29 | public static enum BorderCollapse implements HasCssName { 30 | /** 31 | * Borders are collapsed into a single border when possible (border-spacing 32 | * and empty-cells properties will be ignored) 33 | */ 34 | COLLAPSE, 35 | 36 | /** 37 | * Borders are detached (border-spacing and empty-cells properties will not 38 | * be ignored). 39 | */ 40 | SEPARATE; 41 | 42 | public String getCssName() { 43 | return name().toLowerCase(); 44 | } 45 | } 46 | 47 | private static final String CSS_PROPERTY = "borderCollapse"; 48 | 49 | public static void init() { 50 | CSS.BORDER_COLLAPSE = new BorderCollapseProperty(); 51 | } 52 | 53 | private BorderCollapseProperty() { 54 | super(CSS_PROPERTY); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderColorProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * The border-color property specifies the color of a border of a 20 | * box. 21 | */ 22 | public class BorderColorProperty extends CssProperty { 23 | 24 | public static final String BORDER_BOTTOM_COLOR_PROPERTY = "borderBottomColor"; 25 | public static final String BORDER_COLOR_PROPERTY = "borderColor"; 26 | public static final String BORDER_LEFT_COLOR_PROPERTY = "borderLeftColor"; 27 | public static final String BORDER_RIGHT_COLOR_PROPERTY = "borderRightColor"; 28 | public static final String BORDER_TOP_COLOR_PROPERTY = "borderTopColor"; 29 | 30 | public static void init() { 31 | CSS.BORDER_COLOR = new BorderColorProperty(BORDER_COLOR_PROPERTY); 32 | CSS.BORDER_BOTTOM_COLOR = new BorderColorProperty( 33 | BORDER_BOTTOM_COLOR_PROPERTY); 34 | CSS.BORDER_LEFT_COLOR = new BorderColorProperty(BORDER_LEFT_COLOR_PROPERTY); 35 | CSS.BORDER_RIGHT_COLOR = new BorderColorProperty( 36 | BORDER_RIGHT_COLOR_PROPERTY); 37 | CSS.BORDER_TOP_COLOR = new BorderColorProperty(BORDER_TOP_COLOR_PROPERTY); 38 | } 39 | 40 | private BorderColorProperty(String value) { 41 | super(value); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/CaptionSideProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * This property specifies the position of the caption box with respect to the 22 | * table box. 23 | */ 24 | public class CaptionSideProperty extends 25 | CssProperty { 26 | 27 | /** 28 | * Possible values for caption-side property. 29 | * 30 | */ 31 | public enum CaptionSide implements HasCssName { 32 | /** 33 | * Positions the caption box above the table box. 34 | */ 35 | TOP, 36 | 37 | /** 38 | * Positions the caption box below the table box. 39 | */ 40 | BOTTOM, 41 | 42 | /** 43 | * Positions the caption box to the left of the table box. 44 | */ 45 | LEFT, 46 | 47 | /** 48 | * Positions the caption box to the right of the table box. 49 | */ 50 | RIGHT; 51 | 52 | public String getCssName() { 53 | return name().toLowerCase(); 54 | }; 55 | } 56 | 57 | private static final String CSS_PROPERTY = "captionSide"; 58 | 59 | public static void init() { 60 | CSS.CAPTION_SIDE = new CaptionSideProperty(); 61 | } 62 | 63 | private CaptionSideProperty() { 64 | super(CSS_PROPERTY); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/ClearProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * The clear property specifies which sides of an element where other floating 22 | * elements are not allowed. 23 | */ 24 | public class ClearProperty extends CssProperty { 25 | 26 | /** 27 | * Possible values for clear property. 28 | * 29 | */ 30 | public static enum Clear implements HasCssName { 31 | 32 | /** 33 | * No floating elements allowed on either the left or the right side 34 | */ 35 | BOTH, 36 | 37 | /** 38 | * No floating elements allowed on the left side 39 | */ 40 | LEFT, 41 | 42 | /** 43 | * Allows floating elements on both sides 44 | */ 45 | NONE, 46 | 47 | /** 48 | * No floating elements allowed on the right side 49 | */ 50 | RIGHT; 51 | 52 | public String getCssName() { 53 | return name().toLowerCase(); 54 | } 55 | } 56 | 57 | private static final String CSS_PROPERTY = "clear"; 58 | 59 | public static void init() { 60 | CSS.CLEAR = new ClearProperty(); 61 | } 62 | 63 | private ClearProperty() { 64 | super(CSS_PROPERTY); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/ClipProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * A clipping region defines what portion of an element's rendered content is 22 | * visible. By default, the clipping region has the same size and shape as the 23 | * element's box(es). The clip property allows you to modify this 24 | * clipping region by defining a shape. 25 | */ 26 | public class ClipProperty extends CssProperty { 27 | 28 | /** 29 | * Object defining a clipping region used as value for clip property. 30 | * 31 | */ 32 | public static class Shape implements HasCssName { 33 | 34 | /** 35 | * Define a rectangular shape. 36 | */ 37 | public static Shape rect(int top, int right, int bottom, int left) { 38 | return new Shape("rect(" + top + "px," + right + "px," + bottom + "px," 39 | + left + "px)"); 40 | } 41 | 42 | private String value; 43 | 44 | private Shape(String value) { 45 | this.value = value; 46 | } 47 | 48 | public String getCssName() { 49 | return value; 50 | } 51 | } 52 | 53 | private static final String CSS_PROPERTY = "clip"; 54 | 55 | public static void init() { 56 | CSS.CLIP = new ClipProperty(); 57 | } 58 | 59 | private ClipProperty() { 60 | super(CSS_PROPERTY); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/ColorProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * The color property describes the foreground color of an element's text 20 | * content. 21 | */ 22 | public class ColorProperty extends CssProperty { 23 | 24 | private static final String CSS_PROPERTY = "color"; 25 | 26 | public static void init() { 27 | CSS.COLOR = new ColorProperty(); 28 | } 29 | 30 | private ColorProperty() { 31 | super(CSS_PROPERTY); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/CssProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | import com.google.gwt.dom.client.Style; 20 | import com.google.gwt.dom.client.Style.HasCssName; 21 | 22 | /** 23 | * Base class for Css property. 24 | * 25 | * @param Class of the value associated with the css property 26 | */ 27 | public class CssProperty implements 28 | TakesCssValue { 29 | 30 | /** 31 | * CssSetterImpl. 32 | */ 33 | protected class CssSetterImpl implements CssSetter { 34 | 35 | private T cssValue; 36 | 37 | public CssSetterImpl(T cssValue) { 38 | 39 | this.cssValue = cssValue; 40 | } 41 | 42 | public void applyCss(Element e) { 43 | assert e != null : "Impossible to apply css to a null object"; 44 | set(e.getStyle(), cssValue); 45 | } 46 | } 47 | 48 | private String cssName; 49 | 50 | protected CssProperty(String cssName) { 51 | this.cssName = cssName; 52 | } 53 | 54 | public String getCssName() { 55 | return cssName; 56 | } 57 | 58 | public String getCssValue(Style s) { 59 | return s.getProperty(getCssName()); 60 | } 61 | 62 | public CssSetter with(T value) { 63 | return new CssSetterImpl(value); 64 | } 65 | 66 | protected void set(Style s, T value) { 67 | s.setProperty(getCssName(), value != null ? value.getCssName() : ""); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/CursorProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.Cursor; 19 | 20 | /** 21 | * The cursor property specifies the type of cursor to be displayed for 22 | * the pointing device. 23 | */ 24 | public class CursorProperty extends CssProperty { 25 | 26 | private static final String CSS_PROPERTY = "cursor"; 27 | 28 | public static void init() { 29 | CSS.CURSOR = new CursorProperty(); 30 | } 31 | 32 | private CursorProperty() { 33 | super(CSS_PROPERTY); 34 | } 35 | 36 | public CssSetter with(UriValue url) { 37 | return new SimpleCssSetter(this, url); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/DirectionProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * The direction specifies the base writing direction of blocks and the 22 | * direction of embeddings and overrides (see 'unicode-bidi') for the Unicode 23 | * bidirectional algorithm. In addition, it specifies the direction of table 24 | * column layout, the direction of horizontal overflow, and the position of an 25 | * incomplete last line in a block in case of 'text-align: justify'. 26 | */ 27 | public class DirectionProperty extends 28 | CssProperty { 29 | 30 | /** 31 | * Possible values for direction property. 32 | * 33 | */ 34 | public static enum Direction implements HasCssName { 35 | 36 | /** 37 | * Left-to-right direction. 38 | */ 39 | LTR, 40 | 41 | /** 42 | * Right-to-left direction. 43 | */ 44 | RTL; 45 | 46 | public String getCssName() { 47 | return name().toLowerCase(); 48 | } 49 | } 50 | 51 | private static final String CSS_PROPERTY = "direction"; 52 | 53 | public static void init() { 54 | CSS.DIRECTION = new DirectionProperty(); 55 | } 56 | 57 | private DirectionProperty() { 58 | super(CSS_PROPERTY); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/DisplayProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.Display; 19 | 20 | /** 21 | * This property specifies the mechanism by which elements are rendered. 22 | */ 23 | public class DisplayProperty extends CssProperty { 24 | 25 | private static final String CSS_PROPERTY = "display"; 26 | 27 | public static void init() { 28 | CSS.DISPLAY = new DisplayProperty(); 29 | } 30 | 31 | private DisplayProperty() { 32 | super(CSS_PROPERTY); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/EdgePositionProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * Specify position of element's edges. 20 | */ 21 | public class EdgePositionProperty extends CssProperty { 22 | 23 | public static void init() { 24 | CSS.BOTTOM = new EdgePositionProperty("bottom"); 25 | CSS.LEFT = new EdgePositionProperty("left"); 26 | CSS.RIGHT = new EdgePositionProperty("right"); 27 | CSS.TOP = new EdgePositionProperty("top"); 28 | } 29 | 30 | private EdgePositionProperty(String value) { 31 | super(value); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/EmptyCellsProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * This property controls the rendering of borders around cells that have no 22 | * visible content. Empty cells and cells with the 'visibility' property set to 23 | * 'hidden' are considered to have no visible content. Visible content includes 24 | * " " and other whitespace except ASCII CR ("\0D"), LF ("\0A"), tab 25 | * ("\09"), and space ("\20"). 26 | */ 27 | public class EmptyCellsProperty extends 28 | CssProperty { 29 | 30 | /** 31 | * Possible values for empty-cells property.) 32 | * 33 | */ 34 | public enum EmptyCells implements HasCssName { 35 | /** 36 | * No background or borders are shown on empty cells 37 | */ 38 | HIDE, 39 | /** 40 | * Background and borders are shown on empty cells. 41 | */ 42 | SHOW; 43 | 44 | public String getCssName() { 45 | return name().toLowerCase(); 46 | }; 47 | } 48 | 49 | private static final String CSS_PROPERTY = "emptyCells"; 50 | 51 | public static void init() { 52 | CSS.EMPTY_CELLS = new EmptyCellsProperty(); 53 | } 54 | 55 | private EmptyCellsProperty() { 56 | super(CSS_PROPERTY); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/FloatProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style; 19 | import com.google.gwt.dom.client.Style.Float; 20 | 21 | /** 22 | * This property specifies whether a box should float to the left, right, or not 23 | * at all. It may be set for any element, but only applies to elements that 24 | * generate boxes that are not absolutely positioned. 25 | */ 26 | public class FloatProperty extends CssProperty { 27 | 28 | private static final String CSS_PROPERTY = "float"; 29 | 30 | public static void init() { 31 | CSS.FLOAT = new FloatProperty(); 32 | } 33 | 34 | private FloatProperty() { 35 | super(CSS_PROPERTY); 36 | } 37 | 38 | @Override 39 | protected void set(Style s, Float value) { 40 | s.setFloat(value); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/FontStyleProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.FontStyle; 19 | 20 | /** 21 | * The font-style property requests normal (sometimes referred to as 22 | * "roman" or "upright"), italic, and oblique faces within a font family. 23 | */ 24 | public class FontStyleProperty extends CssProperty { 25 | 26 | private static final String CSS_PROPERTY = "fontStyle"; 27 | 28 | public static void init() { 29 | CSS.FONT_STYLE = new FontStyleProperty(); 30 | } 31 | 32 | private FontStyleProperty() { 33 | super(CSS_PROPERTY); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/FontVariantProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * In a small-caps font, the glyphs for lowercase letters look similar to the 22 | * uppercase ones, but in a smaller size and with slightly different 23 | * proportions. The font-variant property requests such a font for 24 | * bicameral (having two cases, as with Latin script). This property has no 25 | * visible effect for scripts that are unicameral (having only one case, as with 26 | * most of the world's writing systems). 27 | */ 28 | public class FontVariantProperty extends 29 | CssProperty { 30 | 31 | /** 32 | * Possible values for the font-variant property. 33 | */ 34 | public static enum FontVariant implements HasCssName { 35 | 36 | /** 37 | * The browser displays a normal font 38 | */ 39 | NORMAL, 40 | 41 | /** 42 | * The browser displays a small-caps font 43 | */ 44 | SMALL_CAPS; 45 | 46 | public String getCssName() { 47 | return name().toLowerCase().replace('_', '-'); 48 | } 49 | } 50 | 51 | private static final String CSS_PROPERTY = "fontVariant"; 52 | 53 | public static void init() { 54 | CSS.FONT_VARIANT = new FontVariantProperty(); 55 | } 56 | 57 | private FontVariantProperty() { 58 | super(CSS_PROPERTY); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/FontWeightProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.FontWeight; 19 | 20 | /** 21 | * The font-weight property specifies the weight of the font. 22 | */ 23 | public class FontWeightProperty extends CssProperty { 24 | 25 | private static final String CSS_PROPERTY = "fontWeight"; 26 | 27 | public static void init() { 28 | CSS.FONT_WEIGHT = new FontWeightProperty(); 29 | } 30 | 31 | private FontWeightProperty() { 32 | super(CSS_PROPERTY); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/HasCssValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style; 19 | import com.google.gwt.dom.client.Style.HasCssName; 20 | 21 | /** 22 | * Minimal contract for an object defining a css property. 23 | * 24 | */ 25 | public interface HasCssValue extends HasCssName { 26 | 27 | /** 28 | * Return the value of the property as an enumerated type, or null, if the 29 | * value falls outside the enumerated set. 30 | */ 31 | String getCssValue(Style s); 32 | } 33 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/HeightProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * All height css properties : max-height, min-height, 20 | * height. 21 | */ 22 | public class HeightProperty extends CssProperty { 23 | 24 | private static final String HEIGHT_PROPERTY = "height"; 25 | private static final String MAX_HEIGHT_PROPERTY = "maxHeight"; 26 | private static final String MIN_HEIGHT_PROPERTY = "minHeight"; 27 | 28 | public static void init() { 29 | CSS.HEIGHT = new HeightProperty(HEIGHT_PROPERTY); 30 | CSS.MAX_HEIGHT = new HeightProperty(MAX_HEIGHT_PROPERTY); 31 | CSS.MIN_HEIGHT = new HeightProperty(MIN_HEIGHT_PROPERTY); 32 | } 33 | 34 | private HeightProperty(String cssName) { 35 | super(cssName); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/LetterSpacingProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * The letter-spacing property specifies spacing behavior between text 20 | * characters. 21 | */ 22 | public class LetterSpacingProperty extends CssProperty { 23 | 24 | private static final String CSS_PROPERTY = "letterSpacing"; 25 | 26 | public static void init() { 27 | CSS.LETTER_SPACING = new LetterSpacingProperty(); 28 | } 29 | 30 | private LetterSpacingProperty() { 31 | super(CSS_PROPERTY); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/LineHeightProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | *

20 | * If the property is set on a block-level element whose content is composed of 21 | * inline-level elements, it specifies the minimal height of each generated 22 | * inline box. 23 | *

24 | * 25 | *

26 | * If the property is set on an inline-level element, it specifies the exact 27 | * height of each box generated by the element. (Except for inline replaced 28 | * elements, where the height of the box is given by the height 29 | * property.) 30 | *

31 | */ 32 | public class LineHeightProperty extends CssProperty implements 33 | TakesNumber { 34 | 35 | private static final String CSS_PROPERTY = "lineHeight"; 36 | 37 | public static void init() { 38 | CSS.LINE_HEIGHT = new LineHeightProperty(); 39 | } 40 | 41 | private LineHeightProperty() { 42 | super(CSS_PROPERTY); 43 | } 44 | 45 | /** 46 | * The used value of the property is this value multiplied by the 47 | * element's font size. Negative values are illegal. 48 | */ 49 | public CssSetter with(Integer value) { 50 | return new SimpleCssSetter(CSS_PROPERTY, value != null ? "" + value : null); 51 | } 52 | 53 | /** 54 | * The used value of the property is this value multiplied by the 55 | * element's font size. Negative values are illegal. 56 | */ 57 | public CssSetter with(Double value) { 58 | return new SimpleCssSetter(CSS_PROPERTY, value != null ? "" + value : null); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/ListStyleImageProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * The list-style-image property sets the image that will be used as the 20 | * list item marker. When the image is available, it will replace the marker set 21 | * with the list-style-type marker. 22 | */ 23 | public class ListStyleImageProperty extends CssProperty { 24 | 25 | private static final String CSS_PROPERTY = "listStyleImage"; 26 | 27 | public static void init() { 28 | CSS.LIST_STYLE_IMAGE = new ListStyleImageProperty(); 29 | } 30 | 31 | private ListStyleImageProperty() { 32 | super(CSS_PROPERTY); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/ListStylePositionProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * The list-style-position property specifies the position of the marker 22 | * box in the principal block box. 23 | */ 24 | public class ListStylePositionProperty extends 25 | CssProperty { 26 | 27 | /** 28 | * Possible values for list-style-position property. 29 | * 30 | */ 31 | public static enum ListStylePosition implements HasCssName { 32 | 33 | /** 34 | * Indents the marker and the text. The bullets appear inside the content 35 | * flow 36 | */ 37 | INSIDE, 38 | 39 | /** 40 | * Keeps the marker to the left of the text. The bullets appears outside the 41 | * content flow. This is default 42 | */ 43 | OUTSIDE; 44 | 45 | public String getCssName() { 46 | return name().toLowerCase(); 47 | } 48 | } 49 | 50 | private static final String CSS_PROPERTY = "listStylePosition"; 51 | 52 | public static void init() { 53 | CSS.LIST_STYLE_POSITION = new ListStylePositionProperty(); 54 | } 55 | 56 | private ListStylePositionProperty() { 57 | super(CSS_PROPERTY); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/ListStyleProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style; 19 | import com.google.gwt.dom.client.Style.ListStyleType; 20 | import com.google.gwt.query.client.css.ListStylePositionProperty.ListStylePosition; 21 | import com.google.gwt.query.client.css.TakesCssValue.CssSetter; 22 | 23 | /** 24 | * The list-style property is a shorthand notation for setting the three 25 | * properties list-style-type, list-style-image, and 26 | * list-style-position at the same place in the style sheet. 27 | */ 28 | public class ListStyleProperty implements HasCssValue { 29 | 30 | private static final String CSS_PROPERTY = "listStyle"; 31 | 32 | static void init() { 33 | CSS.LIST_STYLE = new ListStyleProperty(); 34 | ListStyleImageProperty.init(); 35 | ListStylePositionProperty.init(); 36 | ListStyleTypeProperty.init(); 37 | } 38 | 39 | private ListStyleProperty() { 40 | } 41 | 42 | public String getCssValue(Style s) { 43 | return s.getProperty(CSS_PROPERTY); 44 | } 45 | 46 | public String getCssName() { 47 | return CSS_PROPERTY; 48 | } 49 | 50 | public CssSetter with(ListStyleType listStyleType, 51 | ListStylePosition listStylePosition, UriValue listStyleImage) { 52 | return new MultipleValueCssSetter(CSS_PROPERTY, listStyleType, 53 | listStylePosition, listStyleImage); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/ListStyleTypeProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.ListStyleType; 19 | 20 | /** 21 | * The list-style-type property specifies appearance of the list item 22 | * marker if list-style-image has the value 'none' or if the image 23 | * pointed to by the URI cannot be displayed. The value 'none' specifies no 24 | * marker, otherwise there are three types of marker: glyphs, numbering systems, 25 | * and alphabetic systems. Note. Numbered lists improve document accessibility 26 | * by making lists easier to navigate. 27 | */ 28 | public class ListStyleTypeProperty extends CssProperty { 29 | 30 | private static final String CSS_PROPERTY = "listStyleType"; 31 | 32 | public static void init() { 33 | CSS.LIST_STYLE_TYPE = new ListStyleTypeProperty(); 34 | } 35 | 36 | private ListStyleTypeProperty() { 37 | super(CSS_PROPERTY); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/MultipleValueCssSetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * MultipleValueCssSetter. 22 | */ 23 | public class MultipleValueCssSetter extends SimpleCssSetter { 24 | 25 | public MultipleValueCssSetter(String cssPropertyName, HasCssName... values) { 26 | super(cssPropertyName, computeValue(values)); 27 | } 28 | 29 | protected static String computeValue(HasCssName... values) { 30 | StringBuilder valueBuilder = new StringBuilder(); 31 | 32 | for (HasCssName cssValue : values) { 33 | valueBuilder.append(notNull(cssValue)); 34 | } 35 | 36 | return valueBuilder.toString().trim(); 37 | } 38 | 39 | private static String notNull(HasCssName value) { 40 | return value != null ? value.getCssName() + " " : ""; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/OutlineColorProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * An outline is a line that is drawn around elements (outside the borders) to 20 | * make the element "stand out". The outline-color property specifies the color 21 | * of an outline. 22 | */ 23 | public class OutlineColorProperty extends CssProperty { 24 | 25 | private static final String CSS_PROPERTY = "outlineColor"; 26 | 27 | public static void init() { 28 | CSS.OUTLINE_COLOR = new OutlineColorProperty(); 29 | } 30 | 31 | private OutlineColorProperty() { 32 | super(CSS_PROPERTY); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/OutlineProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style; 19 | import com.google.gwt.query.client.css.BorderStyleProperty.BorderStyle; 20 | import com.google.gwt.query.client.css.BorderWidthProperty.BorderWidth; 21 | import com.google.gwt.query.client.css.TakesCssValue.CssSetter; 22 | 23 | /** 24 | * An outline is a line that is drawn around elements (outside the borders) to 25 | * make the element "stand out". 26 | * 27 | * The outline shorthand property sets all the outline properties in one 28 | * declaration. 29 | */ 30 | public class OutlineProperty implements 31 | HasCssValue { 32 | 33 | private static final String CSS_PROPERTY = "outline"; 34 | 35 | static void init() { 36 | CSS.OUTLINE = new OutlineProperty(); 37 | OutlineStyleProperty.init(); 38 | OutlineColorProperty.init(); 39 | OutlineWidthProperty.init(); 40 | } 41 | 42 | private OutlineProperty() { 43 | } 44 | 45 | public String getCssValue(Style s) { 46 | return s.getProperty(CSS_PROPERTY); 47 | } 48 | 49 | public String getCssName() { 50 | return CSS_PROPERTY; 51 | } 52 | 53 | public CssSetter with(RGBColor outlineColor, BorderStyle outlineStyle, 54 | BorderWidth outlineWidth) { 55 | return new MultipleValueCssSetter(CSS_PROPERTY, outlineColor, outlineStyle, outlineWidth); 56 | } 57 | 58 | public CssSetter with(RGBColor outlineColor, BorderStyle outlineStyle, 59 | Length outlineWidth) { 60 | return new MultipleValueCssSetter(CSS_PROPERTY, outlineColor, outlineStyle, outlineWidth); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/OutlineStyleProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.query.client.css.BorderStyleProperty.BorderStyle; 19 | 20 | /** 21 | * An outline is a line that is drawn around elements (outside the borders) to 22 | * make the element "stand out". The outline-color property specifies the style 23 | * of an outline. 24 | */ 25 | public class OutlineStyleProperty extends CssProperty { 26 | 27 | private static final String CSS_PROPERTY = "outlineStyle"; 28 | 29 | public static void init() { 30 | CSS.OUTLINE_STYLE = new OutlineStyleProperty(); 31 | } 32 | 33 | private OutlineStyleProperty() { 34 | super(CSS_PROPERTY); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/OutlineWidthProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.query.client.css.BorderWidthProperty.BorderWidth; 19 | 20 | /** 21 | * An outline is a line that is drawn around elements (outside the borders) to 22 | * make the element "stand out". The outline-width specifies the width of an 23 | * outline 24 | */ 25 | public class OutlineWidthProperty extends CssProperty 26 | implements TakesLength { 27 | 28 | private static final String CSS_PROPERTY = "outlineWidth"; 29 | 30 | public static void init() { 31 | CSS.OUTLINE_WIDTH = new OutlineWidthProperty(); 32 | } 33 | 34 | private OutlineWidthProperty() { 35 | super(CSS_PROPERTY); 36 | } 37 | 38 | public CssSetter with(Length value) { 39 | return new SimpleCssSetter(this, value); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/OverflowProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.Overflow; 19 | 20 | /** 21 | * The overflow property specifies whether the content of a block-level 22 | * element is clipped when it overflows the element's box (which is acting as a 23 | * containing block for the content). 24 | */ 25 | public class OverflowProperty extends CssProperty { 26 | 27 | private static final String CSS_PROPERTY = "overflow"; 28 | 29 | public static void init() { 30 | CSS.OVERFLOW = new OverflowProperty(); 31 | } 32 | 33 | private OverflowProperty() { 34 | super(CSS_PROPERTY); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/PositionProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.Position; 19 | 20 | /** 21 | * The position property determines which of the CSS2 positioning 22 | * algorithms is used to calculate the position of a box. 23 | */ 24 | public class PositionProperty extends CssProperty { 25 | 26 | private static final String CSS_PROPERTY = "position"; 27 | 28 | public static void init() { 29 | CSS.POSITION = new PositionProperty(); 30 | } 31 | 32 | private PositionProperty() { 33 | super(CSS_PROPERTY); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/SimpleCssSetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | import com.google.gwt.dom.client.Style.HasCssName; 20 | import com.google.gwt.query.client.css.TakesCssValue.CssSetter; 21 | 22 | /** 23 | * Simple implementation of {@link CssSetter} interface. It does its job for the 24 | * most CSS property. 25 | * 26 | */ 27 | public class SimpleCssSetter implements CssSetter { 28 | 29 | private String property; 30 | private String value; 31 | 32 | public SimpleCssSetter(HasCssValue property, HasCssName value) { 33 | this(property.getCssName(), value != null ? value.getCssName() : null); 34 | } 35 | 36 | public SimpleCssSetter(String property, String value) { 37 | this.property = property; 38 | this.value = value; 39 | } 40 | 41 | public void applyCss(Element e) { 42 | assert e != null : "Impossible to apply css to a null object"; 43 | e.getStyle().setProperty(property, value != null ? value : ""); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/TakesCssValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | 20 | /** 21 | * An CSS property with values of type T. 22 | * 23 | * @param 24 | */ 25 | public interface TakesCssValue extends HasCssValue { 26 | 27 | /** 28 | * CssSetter. 29 | */ 30 | interface CssSetter { 31 | void applyCss(Element e); 32 | } 33 | 34 | CssSetter with(T value); 35 | } 36 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/TakesInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.query.client.css.TakesCssValue.CssSetter; 19 | 20 | /** 21 | * Interface to be implemented by properties which take a integer as defined in 22 | * css2 specification. 23 | * 24 | * @see http://www.w3.org/TR/CSS21/syndata.html#value-def-number 25 | */ 26 | public interface TakesInteger extends HasCssValue { 27 | 28 | CssSetter with(Integer value); 29 | } 30 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/TakesLength.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.query.client.css.TakesCssValue.CssSetter; 19 | 20 | /** 21 | * Interface to be implemented by properties which take length units in addition 22 | * to an other type. If the properties takes only length units, please use 23 | * {@link TakesCssValue} instead. 24 | */ 25 | public interface TakesLength { 26 | 27 | CssSetter with(Length value); 28 | } 29 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/TakesNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.query.client.css.TakesCssValue.CssSetter; 19 | 20 | /** 21 | * Interface to be implemented by properties which take a number as defined in 22 | * css2 specification. 23 | * 24 | * @see http://www.w3.org/TR/CSS21/syndata.html#value-def-number 25 | */ 26 | public interface TakesNumber extends TakesInteger { 27 | 28 | CssSetter with(Double value); 29 | } 30 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextAlignProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * The text-align property describes how inline-level content of a block 22 | * container is aligned. 23 | */ 24 | public class TextAlignProperty extends 25 | CssProperty { 26 | 27 | /** 28 | * Possible value for text-align property. 29 | */ 30 | public static enum TextAlign implements HasCssName { 31 | 32 | /** 33 | * Align the line box with the left side of the containing box. 34 | */ 35 | CENTER, 36 | 37 | /** 38 | * this property specifies that the inline boxes are to be made flush with 39 | * both sides of the block. If the computed value of text-align is 'justify' 40 | * while the computed value of white-space is 'pre' or 'pre-line', the 41 | * actual value of text-align is set to the initial value. 42 | */ 43 | JUSTIFY, 44 | 45 | /** 46 | * Align the line box with the left side of the containing box. 47 | */ 48 | LEFT, 49 | 50 | /** 51 | * Align the line box with the right side of the containing box. 52 | */ 53 | RIGHT; 54 | 55 | public String getCssName() { 56 | return name().toLowerCase(); 57 | } 58 | } 59 | 60 | private static final String CSS_PROPERTY = "textAlign"; 61 | 62 | public static void init() { 63 | CSS.TEXT_ALIGN = new TextAlignProperty(); 64 | } 65 | 66 | private TextAlignProperty() { 67 | super(CSS_PROPERTY); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextDecorationProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.TextDecoration; 19 | 20 | /** 21 | * The text-decoration property describes decorations that are added to 22 | * the text of an element using the element's color. When specified on or 23 | * propagated to an inline element, it affects all the boxes generated by that 24 | * element, and is further propagated to any in-flow block-level boxes that 25 | * split the inline. For block containers that establish an inline formatting 26 | * context, the decorations are propagated to an anonymous inline element that 27 | * wraps all the in-flow inline-level children of the block container. For all 28 | * other elements it is propagated to any in-flow children. Note that text 29 | * decorations are not propagated to floating and absolutely positioned 30 | * descendants, nor to the contents of atomic inline-level descendants such as 31 | * inline blocks and inline tables. 32 | */ 33 | public class TextDecorationProperty extends CssProperty { 34 | 35 | private static final String CSS_PROPERTY = "textDecoration"; 36 | 37 | public static void init() { 38 | CSS.TEXT_DECORATION = new TextDecorationProperty(); 39 | } 40 | 41 | private TextDecorationProperty() { 42 | super(CSS_PROPERTY); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextIdentProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * The text-ident property specifies the indentation of the first line of 20 | * text in a block container. More precisely, it specifies the indentation of 21 | * the first box that flows into the block's first line box. The box is indented 22 | * with respect to the left (or right, for right-to-left layout) edge of the 23 | * line box. User agents must render this indentation as blank space. 24 | */ 25 | public class TextIdentProperty extends CssProperty { 26 | 27 | private static final String CSS_PROPERTY = "textIdent"; 28 | 29 | public static void init() { 30 | CSS.TEXT_IDENT = new TextIdentProperty(); 31 | } 32 | 33 | private TextIdentProperty() { 34 | super(CSS_PROPERTY); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextTransformProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * The text-transform property controls capitalization effects of an 22 | * element's text. 23 | */ 24 | public class TextTransformProperty extends 25 | CssProperty { 26 | 27 | /** 28 | * Possible values for text-transform property. 29 | */ 30 | public enum TextTransform implements HasCssName { 31 | /** 32 | * Transforms the first character of each word to uppercase 33 | */ 34 | CAPITALIZE, 35 | /** 36 | * Transforms all characters to uppercase 37 | */ 38 | UPPERCASE, 39 | /** 40 | * Transforms all characters to lowercase 41 | */ 42 | LOWERCASE; 43 | 44 | public String getCssName() { 45 | return name().toLowerCase(); 46 | }; 47 | } 48 | 49 | private static final String CSS_PROPERTY = "textTransform"; 50 | 51 | public static void init() { 52 | CSS.TEXT_TRANSFORM = new TextTransformProperty(); 53 | } 54 | 55 | private TextTransformProperty() { 56 | super(CSS_PROPERTY); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/UriValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.HasCssName; 19 | 20 | /** 21 | * Image as css value. 22 | */ 23 | public class UriValue implements HasCssName { 24 | 25 | /** 26 | * Define an uri by an url. 27 | */ 28 | public static UriValue url(String url) { 29 | return new UriValue("url('" + url + "')"); 30 | } 31 | 32 | private String value; 33 | 34 | private UriValue(String value) { 35 | this.value = value; 36 | } 37 | 38 | public String getCssName() { 39 | return value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/VerticalAlignProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.VerticalAlign; 19 | 20 | /** 21 | * The vertical-align property affects the vertical positioning inside a 22 | * line box of the boxes generated by an inline-level element. 23 | */ 24 | public class VerticalAlignProperty extends CssProperty 25 | implements TakesLength { 26 | 27 | private static final String CSS_PROPERTY = "verticalAlign"; 28 | 29 | public static void init() { 30 | CSS.VERTICAL_ALIGN = new VerticalAlignProperty(); 31 | } 32 | 33 | private VerticalAlignProperty() { 34 | super(CSS_PROPERTY); 35 | } 36 | 37 | public CssSetter with(Length value) { 38 | return new SimpleCssSetter(this, value); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/VisibilityProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style.Visibility; 19 | 20 | /** 21 | * The visibility property specifies whether the boxes generated by an 22 | * element are rendered. Invisible boxes still affect layout (set the 23 | * display property to none to suppress box generation altogether). 24 | */ 25 | public class VisibilityProperty extends CssProperty { 26 | 27 | private static final String CSS_PROPERTY = "visibility"; 28 | 29 | public static void init() { 30 | CSS.VISIBILITY = new VisibilityProperty(); 31 | } 32 | 33 | private VisibilityProperty() { 34 | super(CSS_PROPERTY); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/WidthProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * All width css properties : max-width, min-width, width. 20 | */ 21 | public class WidthProperty extends CssProperty { 22 | 23 | private static final String WIDTH_PROPERTY = "width"; 24 | private static final String MAX_WIDTH_PROPERTY = "maxWidth"; 25 | private static final String MIN_WIDTH_PROPERTY = "minWidth"; 26 | 27 | public static void init() { 28 | CSS.WIDTH = new WidthProperty(WIDTH_PROPERTY); 29 | CSS.MAX_WIDTH = new WidthProperty(MAX_WIDTH_PROPERTY); 30 | CSS.MIN_WIDTH = new WidthProperty(MIN_WIDTH_PROPERTY); 31 | } 32 | 33 | private WidthProperty(String cssName) { 34 | super(cssName); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/WordSpacingProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | /** 19 | * The word-spacing property specifies spacing behavior between words. 20 | */ 21 | public class WordSpacingProperty extends CssProperty { 22 | 23 | private static final String CSS_PROPERTY = "wordSpacing"; 24 | 25 | public static void init() { 26 | CSS.WORD_SPACING = new WordSpacingProperty(); 27 | } 28 | 29 | private WordSpacingProperty() { 30 | super(CSS_PROPERTY); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/css/ZIndexProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.css; 17 | 18 | import com.google.gwt.dom.client.Style; 19 | import com.google.gwt.query.client.css.TakesCssValue.CssSetter; 20 | 21 | /** 22 | * The z-index property specifies the stack order of an element. 23 | * 24 | * An element with greater stack order is always in front of an element with a 25 | * lower stack order. 26 | * 27 | * The z-index property only works on positioned elements (position:absolute, 28 | * position:relative, or position:fixed). 29 | */ 30 | public class ZIndexProperty implements TakesInteger { 31 | 32 | private static final String CSS_PROPERTY = "zIndex"; 33 | 34 | public static void init() { 35 | CSS.ZINDEX = new ZIndexProperty(); 36 | } 37 | 38 | private ZIndexProperty() { 39 | } 40 | 41 | public String getCssName() { 42 | return CSS_PROPERTY; 43 | } 44 | 45 | /** 46 | * return a {@link String} containing the value of the z-index 47 | * property. 48 | */ 49 | public String getCssValue(Style s) { 50 | return getZIndex(s); 51 | } 52 | 53 | /** 54 | * returns a {@link CssSetter} object setting z-index property to the 55 | * specified value. 56 | */ 57 | public CssSetter with(Integer value) { 58 | return new SimpleCssSetter(CSS_PROPERTY, value != null ? value.toString() : null); 59 | } 60 | 61 | /** 62 | * See GWT issue 5548. 63 | * http://code.google.com/p/google-web-toolkit/issues/detail?id=5548 64 | */ 65 | private native String getZIndex(Style s) /*-{ 66 | // force to return a string 67 | return "" + s["zIndex"]; 68 | }-*/; 69 | } 70 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/impl/HasSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.impl; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | import com.google.gwt.dom.client.Node; 20 | import com.google.gwt.dom.client.NodeList; 21 | 22 | /** 23 | * 24 | */ 25 | public interface HasSelector { 26 | 27 | /** 28 | * Parse and execute a given selector expression given a context. 29 | * 30 | * @param selector the CSS selector expression 31 | * @param ctx the DOM node to use as a context 32 | * @return a list of matched nodes 33 | */ 34 | NodeList select(String selector, Node ctx); 35 | } 36 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.impl; 17 | 18 | /** 19 | * Base/Utility class for runtime selector engine implementations. 20 | */ 21 | public abstract class SelectorEngineImpl implements HasSelector { 22 | } 23 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNativeIE8.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.impl; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | import com.google.gwt.dom.client.Node; 20 | import com.google.gwt.dom.client.NodeList; 21 | 22 | /** 23 | * Runtime selector engine implementation for IE with native 24 | * querySelectorAll support (IE8 standards mode). 25 | * 26 | * It will fall back to Sizzle engine when QuerySelector were unavailable 27 | * or in the case of selectors unsupported by the IE8 native QuerySelector. 28 | * 29 | */ 30 | public class SelectorEngineNativeIE8 extends SelectorEngineSizzleIE { 31 | 32 | public static String NATIVE_EXCEPTIONS_REGEXP = 33 | ".*(:contains|!=|:not|:nth-|:only-|:first|:last|:even|:odd).*"; 34 | 35 | public NodeList select(String selector, Node ctx) { 36 | if (!SelectorEngine.hasQuerySelector || selector.matches(NATIVE_EXCEPTIONS_REGEXP)) { 37 | return super.select(selector, ctx); 38 | } else { 39 | try { 40 | return SelectorEngine.querySelectorAllImpl(selector, ctx); 41 | } catch (Exception e) { 42 | return super.select(selector, ctx); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNativeMin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.impl; 17 | 18 | import static com.google.gwt.query.client.GQuery.console; 19 | 20 | import com.google.gwt.dom.client.Element; 21 | import com.google.gwt.dom.client.Node; 22 | import com.google.gwt.dom.client.NodeList; 23 | 24 | /** 25 | * Runtime selector engine implementation for browsers with native 26 | * querySelectorAll support. 27 | * 28 | * In the case of unsupported selectors, it will display an error message 29 | * instead of falling back to a pure js implementation. 30 | */ 31 | public class SelectorEngineNativeMin extends SelectorEngineImpl { 32 | 33 | public NodeList select(String selector, Node ctx) { 34 | try { 35 | return SelectorEngine.querySelectorAllImpl(selector, ctx); 36 | } catch (Exception e) { 37 | console.error("GwtQuery: Selector '" + selector + 38 | "' is unsupported in this SelectorEngineNativeMin engine." 39 | + " Do not use this syntax or configure your module to use a JS fallback. " 40 | + e.getMessage()); 41 | return null; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNativeMinIE8.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.impl; 17 | 18 | import static com.google.gwt.query.client.GQuery.console; 19 | 20 | import com.google.gwt.dom.client.Element; 21 | import com.google.gwt.dom.client.Node; 22 | import com.google.gwt.dom.client.NodeList; 23 | 24 | /** 25 | * Runtime selector engine implementation for IE with native querySelectorAll 26 | * support (IE8 standards mode). 27 | * 28 | * In the case of QuerySelector were unavailable or unsupported selectors, it 29 | * will display an error message instead of falling back to js. 30 | */ 31 | public class SelectorEngineNativeMinIE8 extends SelectorEngineImpl { 32 | 33 | public NodeList select(String selector, Node ctx) { 34 | try { 35 | return SelectorEngine.querySelectorAllImpl(selector, ctx); 36 | } catch (Exception e) { 37 | console.error("GwtQuery: Selector '" + selector 38 | + "' is unsupported in this SelectorEngineNativeMinIE8 engine," 39 | + " check that you are in 'standards mode' or configure your module to use JS fallback. " 40 | + e.getMessage()); 41 | return null; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/impl/research/SelectorEngineJSIE.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.impl.research; 17 | 18 | import com.google.gwt.dom.client.Element; 19 | 20 | /** 21 | * Runtime implementaton of non-XPath/native for IE that fixes some DOM 22 | * operation incompatibilities. 23 | */ 24 | public class SelectorEngineJSIE extends SelectorEngineJS { 25 | 26 | public native String getAttr(Element elm, String attr) /*-{ 27 | switch (attr) { 28 | case "id": 29 | return elm.id; 30 | case "for": 31 | return elm.htmlFor; 32 | case "class": 33 | return elm.className; 34 | } 35 | return elm.getAttribute(attr, 2); 36 | }-*/; 37 | } 38 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsClosure.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.js; 17 | 18 | import com.google.gwt.core.client.JavaScriptObject; 19 | 20 | /** 21 | * Overlay type representing a Javascript closure. 22 | */ 23 | public class JsClosure extends JavaScriptObject { 24 | 25 | protected JsClosure() { 26 | } 27 | 28 | /** 29 | * Invoke the closure with no arguments and expecting no return value. 30 | */ 31 | public final native void invoke() /*-{ 32 | return this(); 33 | }-*/; 34 | } 35 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.js; 17 | 18 | import com.google.gwt.core.client.JavaScriptObject; 19 | 20 | /** 21 | * Lightweight JSO backed implemented of a Map, using Object.hashCode() as key. 22 | * 23 | * @param 24 | * @param 25 | */ 26 | public final class JsMap extends JavaScriptObject { 27 | 28 | protected JsMap() { 29 | } 30 | 31 | private JsCache c() { 32 | return cast(); 33 | } 34 | 35 | @SuppressWarnings("unchecked") 36 | public T get(int hashCode) { 37 | return (T) c().get(hashCode); 38 | } 39 | 40 | public T get(S key) { 41 | return get(key.hashCode()); 42 | } 43 | 44 | public void put(S key, T val) { 45 | c().put(key.hashCode(), val); 46 | } 47 | 48 | public T remove(S key) { 49 | T old = get(key); 50 | c().delete(key.hashCode()); 51 | return old; 52 | } 53 | 54 | public T remove(int key) { 55 | T old = get(key); 56 | c().delete(key); 57 | return old; 58 | } 59 | 60 | public String[] keys() { 61 | return c().keys(); 62 | } 63 | 64 | public static JsMap create() { 65 | return createObject().cast(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsNamedArray.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.js; 17 | 18 | import com.google.gwt.core.client.JavaScriptObject; 19 | 20 | /** 21 | * Lightweight JSO backed implemented of a named array. 22 | * 23 | * @param 24 | */ 25 | public final class JsNamedArray extends JavaScriptObject { 26 | 27 | protected JsNamedArray() { 28 | } 29 | 30 | private JsCache c() { 31 | return cast(); 32 | } 33 | 34 | @SuppressWarnings("unchecked") 35 | public T get(String key) { 36 | return (T) c().get(key); 37 | } 38 | 39 | public void put(String key, T val) { 40 | c().put(key, val); 41 | } 42 | 43 | public String[] keys() { 44 | return c().keys(); 45 | } 46 | 47 | public int length() { 48 | return c().length(); 49 | } 50 | 51 | public Object[] values() { 52 | return c().elements(); 53 | } 54 | 55 | public boolean exists(String key) { 56 | return c().exists(key); 57 | } 58 | 59 | public void delete(String key) { 60 | c().delete(key); 61 | } 62 | 63 | public static JsNamedArray create() { 64 | return createObject().cast(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Plugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.plugins; 17 | 18 | import com.google.gwt.query.client.GQuery; 19 | 20 | /** 21 | * A GQuery plugin. All GQuery plugins must implement this interface. 22 | * 23 | * @param the plugin class 24 | */ 25 | public interface Plugin { 26 | 27 | /** 28 | * Called by the GQuery.as() method in order to pass the current matched set. 29 | * Typically a plugin will want to call a super class copy constructor in 30 | * order to copy the internal matched set of elements. 31 | */ 32 | T init(GQuery gQuery); 33 | } 34 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/PromiseFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.google.gwt.query.client.plugins.deferred; 15 | 16 | import com.google.gwt.query.client.plugins.deferred.Deferred.DeferredPromiseImpl; 17 | 18 | /** 19 | * Utility class used to create customized promises which can manipulate 20 | * the associated deferred object. 21 | *
22 |  *    Promise doSomething = new PromiseFunction() {
23 |  *      @Override
24 |  *      public void f(Deferred dfd) {
25 |  *        dfd.notify("hi");
26 |  *        dfd.resolve("done");
27 |  *      }
28 |  *    };
29 |  * 
30 |  *    doSomething.progress(new Function() {
31 |  *      public void f() {
32 |  *        String hi = arguments(0);
33 |  *      }
34 |  *    }).done(new Function() {
35 |  *      public void f() {
36 |  *        String done = arguments(0);
37 |  *      }
38 |  *    });
39 |  * 
40 | */ 41 | public abstract class PromiseFunction extends DeferredPromiseImpl { 42 | public PromiseFunction() { 43 | f(dfd); 44 | } 45 | 46 | /** 47 | * This function is called once when the promise is created and the 48 | * new deferred is available. 49 | */ 50 | public abstract void f(Deferred dfd); 51 | } 52 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/PromiseRPC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 | * in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License 10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 | * or implied. See the License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | package com.google.gwt.query.client.plugins.deferred; 15 | 16 | import com.google.gwt.query.client.plugins.deferred.Deferred.DeferredPromiseImpl; 17 | import com.google.gwt.user.client.rpc.AsyncCallback; 18 | 19 | /** 20 | * Utility class used to create promises for RPC services. 21 | *
22 |  *        PromiseRPC greeting = new PromiseRPC();
23 |  * 
24 |  *        GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
25 |  *        greetingService.greetServer("hi", greeting);
26 |  * 
27 |  *        greeting.fail(new Function(){
28 |  *          public void f() {
29 |  *            Throwable error = arguments(0);
30 |  *          }
31 |  *        }).done(new Function(){
32 |  *          public void f() {
33 |  *            String response = arguments(0);
34 |  *          }
35 |  *        });
36 |  * 
37 | * 38 | * @param 39 | */ 40 | public class PromiseRPC extends DeferredPromiseImpl implements AsyncCallback { 41 | public void onFailure(Throwable caught) { 42 | dfd.reject(caught); 43 | } 44 | 45 | public void onSuccess(T result) { 46 | dfd.resolve(result); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/ButtonWidgetFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The gwtquery team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package com.google.gwt.query.client.plugins.widgets; 17 | 18 | import com.google.gwt.dom.client.ButtonElement; 19 | import com.google.gwt.dom.client.Element; 20 | import com.google.gwt.user.client.ui.Button; 21 | 22 | /** 23 | * Factory used to create a {@link Button} widget. A {@link Button} is created 24 | * if the element is a button, div>, span or a 25 | * element (should be extends to other element). 26 | */ 27 | public class ButtonWidgetFactory implements WidgetFactory 10 |
Lorem ipsum dolor sit amet, consectetur adipiscing 11 | elit. Maecenas ac ultricies lorem. Integer erat nibh, semper eget 12 | tincidunt non, egestas ac augue. Aliquam dapibus pharetra rhoncus. 13 | Integer adipiscing mauris ullamcorper mauris dictum eu luctus tortor 14 | consequat. Nam quis tortor diam, laoreet aliquam enim. Vivamus turpis 15 | arcu, varius eu consectetur vitae, luctus ut sapien. Donec vel sem 16 | metus, ac mattis est. Nulla facilisi. Etiam pharetra tortor aliquam eros 17 | sagittis sit amet dignissim diam pellentesque. Vivamus lobortis varius 18 | leo, eu pharetra sapien rhoncus vitae. Aliquam fermentum nulla et elit 19 | vestibulum et sagittis leo faucibus. Etiam gravida felis a sapien luctus 20 | tincidunt. Quisque non purus ut massa ultrices scelerisque. Donec vel 21 | risus est, quis tempus est. Integer commodo feugiat ornare. Pellentesque 22 | pretium eleifend dui sit amet accumsan. Mauris vulputate rhoncus turpis 23 | vitae scelerisque. Nulla lobortis, nulla ut porttitor condimentum, lacus 24 | ligula scelerisque tortor, et eleifend arcu risus non massa.
25 | 26 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/JsCollectionVsJavaCollection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GQuery Demo 4 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/html/dojobench.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dojo 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/html/domassistantbench.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | DomAssistant 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/html/gwtbench.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Gwt 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/html/iframebench.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 16 | 22 | 23 | 29 | 30 | 35 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/html/jquerybench.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | JQuery 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/html/prototypebench.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Prototype 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/html/sizzlebench.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sizzle 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/animated-flag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/animated-flag.gif -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/grass-texture-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/grass-texture-small.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/grass-texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/grass-texture.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/horse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/horse.gif -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/horse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/horse.png -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/logo-dojo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/logo-dojo.gif -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/logo-domassistant.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/logo-domassistant.gif -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/logo-gwt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/logo-gwt.gif -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/logo-jquery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/logo-jquery.gif -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/logo-prototype.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/logo-prototype.gif -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/bench/logo-sizzle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/bench/logo-sizzle.gif -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb1.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb2.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb3.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb4.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb5.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb6.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb7.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb8.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb9.jpg -------------------------------------------------------------------------------- /samples/src/main/java/gwtquery/samples/public/images/zoom/thumb_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArcBees/gwtquery/4ff72147c6908f767dd72235c323fd8a5db62639/samples/src/main/java/gwtquery/samples/public/images/zoom/thumb_bg.png -------------------------------------------------------------------------------- /samples/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /samples/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /svnignore.sh: -------------------------------------------------------------------------------- 1 | [ -z "$1" ] && exit 2 | 3 | 4 | p=`pwd` 5 | 6 | while [ -n "$1" ] 7 | do 8 | for i in `find . -name $1` 9 | do 10 | d=`dirname $i` 11 | cd $p 12 | cd $d 13 | svn propget svn:ignore . > /tmp/$$ 14 | echo $1 >> /tmp/$$ 15 | svn propset svn:ignore -F /tmp/$$ . 16 | done 17 | shift 18 | done 19 | 20 | 21 | -------------------------------------------------------------------------------- /update_demos_svn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script to update demos deployed in svn 4 | 5 | 6 | S=`find samples/target/ -type d -name "gwtquery-samples*" | head -1` 7 | [ ! -d "$S" ] && echo "Do not exist folder: $S" && exit 8 | 9 | cp -r $S/* demos/ 10 | rm -rf demos/WEB-INF demos/META-INF 11 | 12 | for i in `find demos -type d | grep -v .svn | sed -e 's#^demos/##g'` 13 | do 14 | [ ! -d $S/$i ] && svn delete demos/$i 15 | done 16 | 17 | for i in `find demos -type f | grep -v .svn | sed -e 's#^demos/##g'` 18 | do 19 | [ ! -f $S/$i ] && svn delete demos/$i 20 | done 21 | 22 | find demos | grep -v .svn | xargs svn add 23 | 24 | find demos -type f -name "*html" -exec svn propset svn:mime-type text/html '{}' ';' 25 | find demos -type f -name "*js" -exec svn propset svn:mime-type text/javascript '{}' ';' 26 | -------------------------------------------------------------------------------- /update_docs_svn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script to update javadoc deployed in svn 4 | 5 | pushd gwtquery-core 6 | mvn javadoc:javadoc 7 | popd 8 | 9 | cp -r gwtquery-core/target/site/apidocs/* gwtquery-core/javadoc/ 10 | 11 | for i in `find gwtquery-core/javadoc/ -type d | grep -v .svn | sed -e 's#gwtquery-core/javadoc/##g' ` 12 | do 13 | [ ! -d gwtquery-core/target/site/apidocs/$i ] && svn delete gwtquery-core/javadoc/$i 14 | done 15 | 16 | for i in `find gwtquery-core/javadoc/ -type f | grep -v .svn | sed -e 's#gwtquery-core/javadoc/##g' ` 17 | do 18 | [ ! -f gwtquery-core/target/site/apidocs/$i ] && svn delete gwtquery-core/javadoc/$i 19 | done 20 | 21 | find gwtquery-core/javadoc/ | grep -v .svn | xargs svn add 22 | 23 | find gwtquery-core/javadoc/ -type f -name "*html" -exec svn propset svn:mime-type text/html '{}' ';' 24 | 25 | 26 | svn commit -m 'updated javadocs' gwtquery-core/javadoc/ 27 | 28 | --------------------------------------------------------------------------------