@qooxdoo/framework 7.9.2 → 8.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +224 -33
- package/Manifest.json +3 -3
- package/bin/tools/utils.js +50 -13
- package/lib/compiler/compile-info.json +297 -227
- package/lib/compiler/index.js +55319 -47085
- package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/default.tmpl.js +6 -7
- package/{source/resource/qx/tool → lib/resource/qx/tool/compiler}/cli/templates/class/singleton.tmpl.js +5 -6
- package/lib/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-node.tmpl.js +1 -0
- package/lib/resource/qx/tool/compiler/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +1 -0
- package/{source/resource/qx/tool → lib/resource/qx/tool/compiler}/cli/templates/template_vars.js +12 -9
- package/{source/resource/qx/tool → lib/resource/qx/tool/compiler}/schema/Manifest-1-0-0.json +2 -2
- package/lib/resource/qx/tool/{schema → compiler/schema}/Manifest-2-0-0.json +2 -2
- package/{source/resource/qx/tool → lib/resource/qx/tool/compiler}/schema/compile-1-0-0.json +21 -5
- package/{source/resource/qx/tool → lib/resource/qx/tool/compiler}/schema/qooxdoo-1-0-0.json +1 -1
- package/lib/resource/qx/tool/website/build/404.html +22 -22
- package/lib/resource/qx/tool/website/build/about.html +23 -23
- package/lib/resource/qx/tool/website/build/assets/common.js +30 -18
- package/lib/resource/qx/tool/website/build/assets/custom.css +290 -0
- package/lib/resource/qx/tool/website/build/assets/qxWeb.js +28 -0
- package/lib/resource/qx/tool/website/build/diagnostics/dependson.html +30 -30
- package/lib/resource/qx/tool/website/build/diagnostics/dependson.js +49 -40
- package/lib/resource/qx/tool/website/build/diagnostics/requiredby.html +20 -23
- package/lib/resource/qx/tool/website/build/diagnostics/requiredby.js +38 -31
- package/lib/resource/qx/tool/website/build/index.html +24 -24
- package/lib/resource/qx/tool/website/build/scripts/serve.js +63 -65
- package/lib/resource/qx/tool/website/partials/footer.html +8 -13
- package/lib/resource/qx/tool/website/partials/head.html +9 -7
- package/lib/resource/qx/tool/website/partials/header.html +3 -3
- package/lib/resource/qx/tool/website/src/assets/common.js +32 -0
- package/lib/resource/qx/tool/website/src/assets/custom.css +290 -0
- package/lib/resource/qx/tool/website/src/assets/qxWeb.js +28 -0
- package/lib/resource/qx/tool/website/src/diagnostics/dependson.js +49 -40
- package/lib/resource/qx/tool/website/src/diagnostics/requiredby.js +38 -31
- package/lib/resource/qx/tool/website/src/index.html +2 -2
- package/lib/resource/qx/tool/website/src/scripts/serve.js +63 -65
- package/package.json +23 -24
- package/source/boot/index.html +2 -2
- package/source/class/qx/Bootstrap.js +931 -705
- package/source/class/qx/Class.js +1476 -1451
- package/source/class/qx/Interface.js +40 -107
- package/source/class/qx/Mixin.js +58 -116
- package/source/class/qx/Promise.js +1 -0
- package/source/class/qx/Theme.js +1 -1
- package/source/class/qx/application/Routing.js +2 -0
- package/source/class/qx/bom/Font.js +3 -0
- package/source/class/qx/bom/client/Locale.js +5 -0
- package/source/class/qx/bom/request/Jsonp.js +5 -13
- package/source/class/qx/bom/request/Script.js +11 -35
- package/source/class/qx/bom/request/SimpleXhr.js +13 -41
- package/source/class/qx/bom/request/Xhr.js +19 -80
- package/source/class/qx/bom/storage/Memory.js +2 -0
- package/source/class/qx/bom/storage/UserData.js +2 -0
- package/source/class/qx/bom/storage/Web.js +2 -0
- package/source/class/qx/bom/webfonts/Validator.js +13 -5
- package/source/class/qx/core/Assert.js +14 -0
- package/source/class/qx/core/BaseInit.js +19 -19
- package/source/class/qx/core/Environment.js +23 -20
- package/source/class/qx/core/MEvent.js +1 -1
- package/source/class/qx/core/MObjectId.js +24 -6
- package/source/class/qx/core/MProperty.js +123 -115
- package/source/class/qx/core/Object.js +88 -102
- package/source/class/qx/core/check/AbstractCheck.js +111 -0
- package/source/class/qx/core/check/Any.js +63 -0
- package/source/class/qx/core/check/CheckFactory.js +151 -0
- package/source/class/qx/core/check/DynamicTypeCheck.js +94 -0
- package/source/class/qx/core/check/ICheck.js +75 -0
- package/source/class/qx/core/check/IsOneOfCheck.js +63 -0
- package/source/class/qx/core/check/JsDocCheck.js +71 -0
- package/source/class/qx/core/check/SimpleCheck.js +42 -0
- package/source/class/qx/core/check/standard/ArrayCheck.js +49 -0
- package/source/class/qx/core/check/standard/BooleanCheck.js +47 -0
- package/source/class/qx/core/check/standard/ClassCheck.js +33 -0
- package/source/class/qx/core/check/standard/ColorCheck.js +33 -0
- package/source/class/qx/core/check/standard/DateCheck.js +49 -0
- package/source/class/qx/core/check/standard/DecoratorCheck.js +33 -0
- package/source/class/qx/core/check/standard/DocumentCheck.js +40 -0
- package/source/class/qx/core/check/standard/ElementCheck.js +40 -0
- package/source/class/qx/core/check/standard/ErrorCheck.js +46 -0
- package/source/class/qx/core/check/standard/EventCheck.js +40 -0
- package/source/class/qx/core/check/standard/FontCheck.js +33 -0
- package/source/class/qx/core/check/standard/FunctionCheck.js +49 -0
- package/source/class/qx/core/check/standard/IntegerCheck.js +54 -0
- package/source/class/qx/core/check/standard/InterfaceCheck.js +33 -0
- package/source/class/qx/core/check/standard/MapCheck.js +33 -0
- package/source/class/qx/core/check/standard/MixinCheck.js +33 -0
- package/source/class/qx/core/check/standard/NodeCheck.js +40 -0
- package/source/class/qx/core/check/standard/NumberCheck.js +48 -0
- package/source/class/qx/core/check/standard/ObjectCheck.js +33 -0
- package/source/class/qx/core/check/standard/PositiveIntegerCheck.js +45 -0
- package/source/class/qx/core/check/standard/PositiveNumberCheck.js +45 -0
- package/source/class/qx/core/check/standard/PromiseCheck.js +33 -0
- package/source/class/qx/core/check/standard/RegExpCheck.js +46 -0
- package/source/class/qx/core/check/standard/StringCheck.js +43 -0
- package/source/class/qx/core/check/standard/ThemeCheck.js +33 -0
- package/source/class/qx/core/check/standard/WindowCheck.js +40 -0
- package/source/class/qx/core/property/ExplicitPropertyStorage.js +87 -0
- package/source/class/qx/core/property/GroupProperty.js +262 -0
- package/source/class/qx/core/property/IProperty.js +46 -0
- package/source/class/qx/core/property/IPropertyStorage.js +83 -0
- package/source/class/qx/core/property/ImmutableArrayStorage.js +38 -0
- package/source/class/qx/core/property/ImmutableDataArrayStorage.js +38 -0
- package/source/class/qx/core/property/ImmutableObjectStorage.js +39 -0
- package/source/class/qx/core/property/Property.js +1482 -0
- package/source/class/qx/core/property/PropertyStorageFactory.js +22 -0
- package/source/class/qx/core/property/SimplePropertyStorage.js +105 -0
- package/source/class/qx/data/Array.js +102 -57
- package/source/class/qx/data/MBinding.js +4 -29
- package/source/class/qx/data/SingleValueBinding.js +595 -1496
- package/source/class/qx/data/binding/AbstractSegment.js +197 -0
- package/source/class/qx/data/binding/ArrayIndexSegment.js +155 -0
- package/source/class/qx/data/binding/IInputReceiver.js +14 -0
- package/source/class/qx/data/binding/PropNameSegment.js +150 -0
- package/source/class/qx/data/controller/CheckedList.js +1 -1
- package/source/class/qx/data/controller/Form.js +78 -8
- package/source/class/qx/data/controller/Tree.js +27 -117
- package/source/class/qx/data/marshal/Json.js +46 -149
- package/source/class/qx/data/store/Json.js +0 -2
- package/source/class/qx/dev/Debug.js +1 -1
- package/source/class/qx/dev/LeakDetector.js +144 -0
- package/source/class/qx/dev/unit/AsyncWrapper.js +1 -0
- package/source/class/qx/dev/unit/MMock.js +7 -2
- package/source/class/qx/dev/unit/Sinon.js +0 -4
- package/source/class/qx/dev/unit/TestCase.js +4 -1
- package/source/class/qx/dev/unit/TestClass.js +2 -2
- package/source/class/qx/dev/unit/TestFunction.js +1 -0
- package/source/class/qx/dev/unit/TestLoaderBasic.js +1 -0
- package/source/class/qx/dev/unit/TestRunner.js +106 -0
- package/source/class/qx/event/IEventDispatcher.js +8 -4
- package/source/class/qx/event/Manager.js +4 -0
- package/source/class/qx/event/Messaging.js +2 -0
- package/source/class/qx/event/Pool.js +7 -0
- package/source/class/qx/event/Registration.js +33 -55
- package/source/class/qx/event/Timer.js +2 -0
- package/source/class/qx/event/Utils.js +25 -8
- package/source/class/qx/event/dispatch/AbstractBubbling.js +98 -194
- package/source/class/qx/event/dispatch/Direct.js +18 -13
- package/source/class/qx/event/handler/Appear.js +20 -24
- package/source/class/qx/event/handler/Application.js +4 -0
- package/source/class/qx/event/handler/DragDrop.js +182 -385
- package/source/class/qx/event/handler/Element.js +3 -0
- package/source/class/qx/event/handler/Focus.js +38 -31
- package/source/class/qx/event/handler/Input.js +5 -0
- package/source/class/qx/event/handler/Keyboard.js +107 -165
- package/source/class/qx/event/handler/Pointer.js +39 -68
- package/source/class/qx/event/handler/PointerCore.js +7 -25
- package/source/class/qx/event/handler/Window.js +5 -0
- package/source/class/qx/event/type/Event.js +12 -0
- package/source/class/qx/event/type/KeySequence.js +3 -0
- package/source/class/qx/event/type/Native.js +3 -0
- package/source/class/qx/html/Element.js +26 -91
- package/source/class/qx/html/Jsx.js +2 -3
- package/source/class/qx/html/Node.js +3 -3
- package/source/class/qx/io/jsonrpc/Client.js +2 -2
- package/source/class/qx/io/jsonrpc/protocol/Error.js +2 -2
- package/source/class/qx/io/jsonrpc/protocol/Parser.js +1 -0
- package/source/class/qx/io/jsonrpc/protocol/Result.js +2 -2
- package/source/class/qx/io/request/Xhr.js +3 -8
- package/source/class/qx/lang/normalize/Array.js +23 -1
- package/source/class/qx/locale/Date.js +520 -113
- package/source/class/qx/locale/LocalizedString.js +3 -0
- package/source/class/qx/locale/Manager.js +14 -3
- package/source/class/qx/locale/Number.js +60 -7
- package/source/class/qx/log/Logger.js +1 -1
- package/source/class/qx/module/Animation.js +2 -0
- package/source/class/qx/module/Attribute.js +2 -0
- package/source/class/qx/module/Css.js +7 -24
- package/source/class/qx/module/Event.js +2 -0
- package/source/class/qx/module/Manipulating.js +2 -0
- package/source/class/qx/module/Traversing.js +2 -0
- package/source/class/qx/promise/NativeWrapper.js +1 -1
- package/source/class/qx/test/Bootstrap.js +68 -53
- package/source/class/qx/test/Class.js +310 -2
- package/source/class/qx/test/Mixin.js +192 -42
- package/source/class/qx/test/Promise.js +129 -331
- package/source/class/qx/test/Theme.js +11 -0
- package/source/class/qx/test/bom/Font.js +2 -5
- package/source/class/qx/test/bom/Template.js +1 -1
- package/source/class/qx/test/compiler/ClassFile.js +14 -0
- package/source/class/qx/test/core/Assert.js +12 -0
- package/source/class/qx/test/core/Environment.js +17 -3
- package/source/class/qx/test/core/InheritanceDummy.js +10 -1
- package/source/class/qx/test/core/Object.js +51 -24
- package/source/class/qx/test/core/ObjectId.js +10 -1
- package/source/class/qx/test/core/Property.js +1363 -118
- package/source/class/qx/test/core/PropertyHelper.js +12 -0
- package/source/class/qx/test/core/Target.js +1 -0
- package/source/class/qx/test/core/Validation.js +2 -0
- package/source/class/qx/test/data/DataArray.js +218 -639
- package/source/class/qx/test/data/DataArrayWithChangeBubble.js +45 -215
- package/source/class/qx/test/data/MultiBinding.js +42 -0
- package/source/class/qx/test/data/async/__init__.js +4 -0
- package/source/class/qx/test/data/controller/Form.js +523 -14
- package/source/class/qx/test/data/controller/List.js +94 -426
- package/source/class/qx/test/data/controller/ListReverse.js +5 -20
- package/source/class/qx/test/data/controller/ListWithObjects.js +49 -225
- package/source/class/qx/test/data/controller/Object.js +54 -222
- package/source/class/qx/test/data/controller/Tree.js +195 -934
- package/source/class/qx/test/data/marshal/Json.js +74 -312
- package/source/class/qx/test/data/singlevalue/Array.js +55 -279
- package/source/class/qx/test/data/singlevalue/Async.js +173 -0
- package/source/class/qx/test/data/singlevalue/Deep.js +148 -327
- package/source/class/qx/test/data/singlevalue/Resolve.js +8 -28
- package/source/class/qx/test/data/singlevalue/Simple.js +130 -359
- package/source/class/qx/test/data/store/Json.js +86 -254
- package/source/class/qx/test/data/store/Jsonp.js +9 -29
- package/source/class/qx/test/data/store/Offline.js +2 -8
- package/source/class/qx/test/data/store/Rest.js +3 -3
- package/source/class/qx/test/dev/unit/Requirements.js +26 -10
- package/source/class/qx/test/event/GlobalError.js +2 -2
- package/source/class/qx/test/html/Iframe.js +1 -1
- package/source/class/qx/test/io/graphql/Client.js +2 -0
- package/source/class/qx/test/io/jsonrpc/Protocol.js +4 -2
- package/source/class/qx/test/io/request/MRequest.js +2 -8
- package/source/class/qx/test/io/request/Xhr.js +27 -117
- package/source/class/qx/test/lang/Function.js +6 -25
- package/source/class/qx/test/lang/Type.js +31 -13
- package/source/class/qx/test/locale/Date.js +173 -2
- package/source/class/qx/test/locale/Locale.js +23 -28
- package/source/class/qx/test/locale/Number.js +71 -0
- package/source/class/qx/test/log/Logger.js +7 -1
- package/source/class/qx/test/log/fixture/ClassA.js +2 -5
- package/source/class/qx/test/mobile/basic/Atom.js +3 -3
- package/source/class/qx/test/mobile/container/Scroll.js +4 -4
- package/source/class/qx/test/mobile/form/CheckBox.js +6 -12
- package/source/class/qx/test/performance/Property.js +5 -4
- package/source/class/qx/test/performance/widget/WidgetWithDecorator.js +2 -0
- package/source/class/qx/test/theme/Simple.js +34 -0
- package/source/class/qx/test/{MAppearance.js → theme/SimpleAppearance.js} +5 -4
- package/source/class/qx/test/{MDecoration.js → theme/SimpleDecoration.js} +6 -4
- package/source/class/qx/test/theme/manager/Meta.js +7 -5
- package/source/class/qx/test/tool/__init__.js +3 -0
- package/source/class/qx/test/tool/cli/AbstractValue.js +274 -0
- package/source/class/qx/test/tool/cli/Argument.js +384 -0
- package/source/class/qx/test/tool/cli/Command.js +387 -0
- package/source/class/qx/test/tool/cli/Flag.js +413 -0
- package/source/class/qx/test/tool/cli/__init__.js +3 -0
- package/source/class/qx/test/ui/LayoutTestCase.js +1 -14
- package/source/class/qx/test/ui/basic/Label.js +106 -0
- package/source/class/qx/test/ui/core/Blocker.js +125 -3
- package/source/class/qx/test/ui/form/Form.js +106 -0
- package/source/class/qx/test/ui/form/FormManager.js +6 -5
- package/source/class/qx/test/ui/form/SplitButton.js +1 -1
- package/source/class/qx/test/ui/toolbar/OverflowHandling.js +13 -14
- package/source/class/qx/test/ui/toolbar/ToolBar.js +16 -16
- package/source/class/qx/test/ui/tree/TreeFolder.js +5 -7
- package/source/class/qx/test/ui/tree/virtual/AbstractTreeTest.js +2 -0
- package/source/class/qx/test/ui/tree/virtual/Tree.js +36 -0
- package/source/class/qx/test/util/DateFormat.js +1 -1
- package/source/class/qx/test/util/PropertyUtil.js +0 -36
- package/source/class/qx/theme/classic/Appearance.js +22 -1
- package/source/class/qx/theme/indigo/ColorDark.js +2 -0
- package/source/class/qx/theme/manager/Font.js +6 -1
- package/source/class/qx/theme/manager/Meta.js +2 -1
- package/source/class/qx/theme/modern/Appearance.js +21 -0
- package/source/class/qx/theme/simple/Appearance.js +52 -95
- package/source/class/qx/theme/simple/Decoration.js +0 -1
- package/source/class/qx/theme/tangible/Appearance.js +3 -1
- package/source/class/qx/tool/cli/AbstractCliApp.js +88 -0
- package/source/class/qx/tool/cli/AbstractValue.js +186 -0
- package/source/class/qx/tool/cli/Argument.js +155 -0
- package/source/class/qx/tool/cli/Command.js +518 -0
- package/source/class/qx/tool/cli/Flag.js +202 -0
- package/source/class/qx/tool/cli/Parser.js +39 -0
- package/source/class/qx/tool/cli/__init__.js +26 -1
- package/source/class/qx/tool/compiler/Analyser.js +41 -13
- package/source/class/qx/tool/compiler/ClassFile.js +37 -13
- package/source/class/qx/tool/compiler/Console.js +2 -0
- package/source/class/qx/tool/compiler/MetaDatabase.js +47 -0
- package/source/class/qx/tool/compiler/MetaExtraction.js +53 -33
- package/source/class/qx/tool/compiler/app/Library.js +1 -1
- package/source/class/qx/tool/compiler/app/WebFont.js +2 -0
- package/source/class/qx/tool/compiler/cli/Application.js +58 -0
- package/source/class/qx/tool/{cli/commands → compiler/cli}/Command.js +99 -45
- package/source/class/qx/tool/{cli → compiler/cli}/ConfigDb.js +7 -7
- package/source/class/qx/tool/compiler/cli/ConfigLoader.js +272 -0
- package/source/class/qx/tool/{cli → compiler/cli}/LibraryApplication.js +3 -3
- package/source/class/qx/tool/compiler/cli/RootCommand.js +63 -0
- package/source/class/qx/tool/{cli → compiler/cli}/Watch.js +49 -24
- package/source/class/qx/tool/compiler/cli/__init__.js +3 -0
- package/source/class/qx/tool/{cli → compiler/cli}/api/AbstractApi.js +2 -11
- package/source/class/qx/tool/{cli → compiler/cli}/api/CompilerApi.js +11 -10
- package/source/class/qx/tool/{cli → compiler/cli}/api/LibraryApi.js +13 -4
- package/source/class/qx/tool/{cli → compiler/cli}/api/Test.js +1 -1
- package/source/class/qx/tool/compiler/cli/commands/Add.js +49 -0
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Clean.js +12 -25
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Compile.js +630 -590
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Config.js +22 -20
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Create.js +78 -55
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Deploy.js +45 -60
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Es6ify.js +57 -41
- package/source/class/qx/tool/{cli → compiler/cli}/commands/ExportGlyphs.js +26 -7
- package/source/class/qx/tool/compiler/cli/commands/Lint.js +420 -0
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Migrate.js +40 -20
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Package.js +20 -32
- package/source/class/qx/tool/compiler/cli/commands/Pkg.js +36 -0
- package/source/class/qx/tool/compiler/cli/commands/Prettier.js +278 -0
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Run.js +43 -39
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Serve.js +63 -61
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Test.js +49 -52
- package/source/class/qx/tool/{cli → compiler/cli}/commands/Typescript.js +70 -62
- package/source/class/qx/tool/{cli → compiler/cli}/commands/add/Class.js +54 -31
- package/source/class/qx/tool/{cli → compiler/cli}/commands/add/Script.js +57 -33
- package/source/class/qx/tool/{cli → compiler/cli}/commands/config/Delete.js +19 -13
- package/source/class/qx/tool/{cli → compiler/cli}/commands/config/Get.js +19 -13
- package/source/class/qx/tool/{cli → compiler/cli}/commands/config/List.js +20 -20
- package/source/class/qx/tool/{cli → compiler/cli}/commands/config/Set.js +28 -20
- package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Install.js +140 -75
- package/source/class/qx/tool/{cli → compiler/cli}/commands/package/List.js +119 -80
- package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Publish.js +196 -179
- package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Remove.js +18 -21
- package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Update.js +92 -71
- package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Upgrade.js +67 -54
- package/source/class/qx/tool/compiler/makers/AbstractAppMaker.js +2 -1
- package/source/class/qx/tool/compiler/resources/Manager.js +2 -0
- package/source/class/qx/tool/compiler/resources/ScssConverter.js +1 -1
- package/source/class/qx/tool/compiler/resources/ScssFile.js +1 -1
- package/source/class/qx/tool/compiler/targets/Target.js +5 -10
- package/source/class/qx/tool/compiler/targets/TypeScriptWriter.js +9 -2
- package/source/class/qx/tool/compiler/targets/meta/ApplicationMeta.js +2 -4
- package/source/class/qx/tool/compiler/targets/meta/BootJs.js +2 -0
- package/source/class/qx/tool/compiler/targets/meta/Browserify.js +142 -80
- package/source/class/qx/tool/compiler/targets/meta/PackageJavascript.js +2 -0
- package/source/class/qx/tool/config/Abstract.js +5 -5
- package/source/class/qx/tool/config/Lockfile.js +1 -1
- package/source/class/qx/tool/migration/BaseMigration.js +9 -7
- package/source/class/qx/tool/migration/M6_0_0.js +3 -3
- package/source/class/qx/tool/migration/M8_0_0.js +958 -0
- package/source/class/qx/tool/utils/Debounce.js +0 -1
- package/source/class/qx/tool/utils/Http.js +109 -21
- package/source/class/qx/tool/utils/LogManager.js +7 -0
- package/source/class/qx/tool/utils/Promisify.js +12 -1
- package/source/class/qx/tool/utils/QooxdooVersions.js +193 -0
- package/source/class/qx/tool/utils/Utils.js +8 -5
- package/source/class/qx/tool/utils/Website.js +9 -222
- package/source/class/qx/tool/utils/Zip.js +47 -0
- package/source/class/qx/tool/utils/files/Utils.js +3 -11
- package/source/class/qx/tool/utils/json/Tokenizer.js +5 -0
- package/source/class/qx/ui/basic/Atom.js +8 -8
- package/source/class/qx/ui/core/Blocker.js +17 -4
- package/source/class/qx/ui/core/DragDropCursor.js +2 -1
- package/source/class/qx/ui/core/EventHandler.js +13 -21
- package/source/class/qx/ui/core/LayoutItem.js +8 -31
- package/source/class/qx/ui/core/MExecutable.js +7 -31
- package/source/class/qx/ui/core/MNativeOverflow.js +4 -2
- package/source/class/qx/ui/core/Widget.js +50 -165
- package/source/class/qx/ui/core/scroll/IScrollBar.js +9 -3
- package/source/class/qx/ui/core/scroll/ScrollBar.js +7 -1
- package/source/class/qx/ui/core/scroll/ScrollPane.js +12 -4
- package/source/class/qx/ui/embed/Html.js +6 -2
- package/source/class/qx/ui/form/AbstractField.js +4 -12
- package/source/class/qx/ui/form/Button.js +6 -4
- package/source/class/qx/ui/form/CheckedSelectBox.js +8 -8
- package/source/class/qx/ui/form/FileSelectorButton.js +1 -1
- package/source/class/qx/ui/form/Form.js +3 -0
- package/source/class/qx/ui/form/IListItem.js +3 -1
- package/source/class/qx/ui/form/IRadioItem.js +3 -1
- package/source/class/qx/ui/form/MForm.js +3 -1
- package/source/class/qx/ui/form/Slider.js +6 -2
- package/source/class/qx/ui/form/SplitButton.js +5 -5
- package/source/class/qx/ui/form/TextField.js +1 -2
- package/source/class/qx/ui/form/validation/Manager.js +6 -2
- package/source/class/qx/ui/menubar/Button.js +1 -1
- package/source/class/qx/ui/mobile/basic/Atom.js +5 -5
- package/source/class/qx/ui/mobile/dialog/Menu.js +9 -31
- package/source/class/qx/ui/mobile/dialog/Popup.js +13 -1
- package/source/class/qx/ui/table/pane/FocusIndicator.js +5 -2
- package/source/class/qx/ui/table/pane/Scroller.js +5 -20
- package/source/class/qx/ui/table/selection/Model.js +1 -0
- package/source/class/qx/ui/toolbar/Button.js +1 -1
- package/source/class/qx/ui/toolbar/CheckBox.js +1 -1
- package/source/class/qx/ui/toolbar/FileSelectorButton.js +1 -2
- package/source/class/qx/ui/toolbar/Part.js +2 -2
- package/source/class/qx/ui/toolbar/PartContainer.js +2 -2
- package/source/class/qx/ui/toolbar/ToolBar.js +24 -49
- package/source/class/qx/ui/tree/VirtualTree.js +6 -4
- package/source/class/qx/ui/tree/core/AbstractItem.js +10 -17
- package/source/class/qx/ui/tree/core/IVirtualTree.js +4 -2
- package/source/class/qx/ui/tree/provider/IVirtualTreeProvider.js +20 -10
- package/source/class/qx/ui/treevirtual/SimpleTreeDataModel.js +4 -1
- package/source/class/qx/ui/virtual/cell/Cell.js +20 -48
- package/source/class/qx/ui/virtual/cell/WidgetCell.js +2 -4
- package/source/class/qx/ui/virtual/core/Axis.js +4 -0
- package/source/class/qx/ui/virtual/core/ILayer.js +14 -10
- package/source/class/qx/ui/virtual/core/Scroller.js +4 -4
- package/source/class/qx/ui/virtual/layer/WidgetCell.js +4 -0
- package/source/class/qx/ui/virtual/selection/Abstract.js +3 -0
- package/source/class/qx/ui/virtual/selection/MModel.js +1 -1
- package/source/class/qx/ui/window/IDesktop.js +6 -2
- package/source/class/qx/ui/window/IWindowManager.js +10 -4
- package/source/class/qx/ui/window/MDesktop.js +2 -1
- package/source/class/qx/ui/window/Manager.js +1 -1
- package/source/class/qx/ui/window/Window.js +6 -4
- package/source/class/qx/util/OOUtil.js +8 -9
- package/source/class/qx/util/PropertyUtil.js +34 -154
- package/source/class/qx/util/ResponseParser.js +2 -0
- package/source/class/qx/util/Serializer.js +69 -114
- package/source/class/qx/util/format/DateFormat.js +3 -2
- package/source/global.d.ts +4 -0
- package/source/resource/qx/tool/bin/download-assets +0 -2
- package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/default.tmpl.js +6 -7
- package/{lib/resource/qx/tool → source/resource/qx/tool/compiler}/cli/templates/class/singleton.tmpl.js +5 -6
- package/source/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-node.tmpl.js +1 -0
- package/{lib/resource/qx/tool → source/resource/qx/tool/compiler}/cli/templates/template_vars.js +12 -9
- package/{lib/resource/qx/tool → source/resource/qx/tool/compiler}/schema/Manifest-1-0-0.json +2 -2
- package/source/resource/qx/tool/{schema → compiler/schema}/Manifest-2-0-0.json +2 -2
- package/{lib/resource/qx/tool → source/resource/qx/tool/compiler}/schema/compile-1-0-0.json +21 -5
- package/{lib/resource/qx/tool → source/resource/qx/tool/compiler}/schema/qooxdoo-1-0-0.json +1 -1
- package/source/resource/qx/tool/website/build/404.html +22 -22
- package/source/resource/qx/tool/website/build/about.html +23 -23
- package/source/resource/qx/tool/website/build/assets/common.js +30 -18
- package/source/resource/qx/tool/website/build/assets/custom.css +290 -0
- package/source/resource/qx/tool/website/build/assets/qxWeb.js +28 -0
- package/source/resource/qx/tool/website/build/diagnostics/dependson.html +30 -30
- package/source/resource/qx/tool/website/build/diagnostics/dependson.js +49 -40
- package/source/resource/qx/tool/website/build/diagnostics/requiredby.html +20 -23
- package/source/resource/qx/tool/website/build/diagnostics/requiredby.js +38 -31
- package/source/resource/qx/tool/website/build/index.html +24 -24
- package/source/resource/qx/tool/website/build/scripts/serve.js +63 -65
- package/source/resource/qx/tool/website/partials/footer.html +8 -13
- package/source/resource/qx/tool/website/partials/head.html +9 -7
- package/source/resource/qx/tool/website/partials/header.html +3 -3
- package/source/resource/qx/tool/website/src/assets/common.js +32 -0
- package/source/resource/qx/tool/website/src/assets/custom.css +290 -0
- package/source/resource/qx/tool/website/src/assets/qxWeb.js +28 -0
- package/source/resource/qx/tool/website/src/diagnostics/dependson.js +49 -40
- package/source/resource/qx/tool/website/src/diagnostics/requiredby.js +38 -31
- package/source/resource/qx/tool/website/src/index.html +2 -2
- package/source/resource/qx/tool/website/src/scripts/serve.js +63 -65
- package/lib/resource/qx/tool/bin/build-devtools +0 -13
- package/lib/resource/qx/tool/bin/build-website +0 -15
- package/lib/resource/qx/tool/bin/download-assets +0 -23
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +0 -1
- package/lib/resource/qx/tool/website/build/assets/bootstrap.css +0 -7
- package/lib/resource/qx/tool/website/build/assets/bootstrap.min.css +0 -7
- package/lib/resource/qx/tool/website/build/assets/bootstrap.min.css.map +0 -1
- package/lib/resource/qx/tool/website/build/assets/jquery.js +0 -5453
- package/lib/resource/qx/tool/website/build/qooxdoo.css +0 -21
- package/lib/resource/qx/tool/website/sass/qooxdoo.css +0 -3
- package/lib/resource/qx/tool/website/sass/qooxdoo.css.map +0 -1
- package/lib/resource/qx/tool/website/src/assets/bootstrap.css +0 -7
- package/lib/resource/qx/tool/website/src/assets/bootstrap.min.css +0 -7
- package/lib/resource/qx/tool/website/src/assets/bootstrap.min.css.map +0 -1
- package/lib/resource/qx/tool/website/src/assets/jquery.js +0 -5453
- package/source/class/qx/core/Property.js +0 -2100
- package/source/class/qx/tool/cli/Application.js +0 -47
- package/source/class/qx/tool/cli/Cli.js +0 -713
- package/source/class/qx/tool/cli/commands/Add.js +0 -46
- package/source/class/qx/tool/cli/commands/Lint.js +0 -255
- package/source/class/qx/tool/cli/commands/Pkg.js +0 -56
- package/source/class/qx/tool/cli/commands/package/Migrate.js +0 -37
- package/source/class/qx/tool/compiler/app/Cldr.js +0 -725
- package/source/resource/qx/tool/bin/build-devtools +0 -13
- package/source/resource/qx/tool/bin/build-website +0 -15
- package/source/resource/qx/tool/website/build/assets/bootstrap.css +0 -7
- package/source/resource/qx/tool/website/build/assets/bootstrap.min.css +0 -7
- package/source/resource/qx/tool/website/build/assets/bootstrap.min.css.map +0 -1
- package/source/resource/qx/tool/website/build/assets/jquery.js +0 -5453
- package/source/resource/qx/tool/website/build/qooxdoo.css +0 -21
- package/source/resource/qx/tool/website/sass/qooxdoo.scss +0 -31
- package/source/resource/qx/tool/website/src/assets/bootstrap.css +0 -7
- package/source/resource/qx/tool/website/src/assets/bootstrap.min.css +0 -7
- package/source/resource/qx/tool/website/src/assets/bootstrap.min.css.map +0 -1
- package/source/resource/qx/tool/website/src/assets/jquery.js +0 -5453
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/TypeScriptWriter-base_declaration.d.ts +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/header.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/interface.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/mixin.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-browser.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-rhino.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/.gitignore.tmpl +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/Manifest.tmpl.json +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/compile.tmpl.json +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/readme.tmpl.md +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/boot/index.tmpl.html +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/boot/nojs.tmpl.html +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/Application.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/__init__.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/test/DemoTest.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Appearance.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Color.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Decoration.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Font.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Theme.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/app.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/favicon.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/js_256x256.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/test.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/translation/readme.txt +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/.gitignore.tmpl +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/Manifest.tmpl.json +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/compile.tmpl.json +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/readme.tmpl.md +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/boot/index.tmpl.html +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/boot/nojs.tmpl.html +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/Application.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/__init__.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/Overview.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/__init__.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/app.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/css/.gitignore.tmpl +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/favicon.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/js_256x256.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/theme/custom/css/custom.css +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/translation/readme.txt +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/.gitignore.tmpl +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/Manifest.tmpl.json +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/compile.tmpl.json +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/readme.tmpl.md +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/Button.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/__init__.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/demo/Application.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/resource/custom/test.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/test/DemoTest.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Appearance.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Color.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Decoration.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Font.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Theme.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/resource/custom/test.png +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/translation/readme.txt +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/.gitignore.tmpl +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/Manifest.tmpl.json +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/compile.tmpl.json +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/readme.tmpl.txt +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/Application.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/__init__.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/test/DemoTest.tmpl.js +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/resource/custom/.gitignore.tmpl +0 -0
- /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/translation/readme.txt +0 -0
- /package/lib/resource/qx/tool/{loadsass.js → compiler/loadsass.js} +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/TypeScriptWriter-base_declaration.d.ts +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/header.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/interface.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/mixin.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-browser.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-rhino.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/.gitignore.tmpl +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/Manifest.tmpl.json +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/compile.tmpl.json +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/readme.tmpl.md +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/boot/index.tmpl.html +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/boot/nojs.tmpl.html +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/Application.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/__init__.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/test/DemoTest.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Appearance.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Color.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Decoration.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Font.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Theme.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/app.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/favicon.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/js_256x256.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/test.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/translation/readme.txt +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/.gitignore.tmpl +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/Manifest.tmpl.json +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/compile.tmpl.json +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/readme.tmpl.md +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/boot/index.tmpl.html +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/boot/nojs.tmpl.html +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/Application.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/__init__.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/Overview.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/__init__.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/app.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/css/.gitignore.tmpl +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/favicon.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/js_256x256.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/theme/custom/scss/_styles.scss +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/theme/custom/scss/custom.scss +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/translation/readme.txt +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/.gitignore.tmpl +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/Manifest.tmpl.json +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/compile.tmpl.json +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/readme.tmpl.md +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/Button.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/__init__.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/demo/Application.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/resource/custom/test.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/test/DemoTest.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Appearance.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Color.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Decoration.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Font.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Theme.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/resource/custom/test.png +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/translation/readme.txt +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/.gitignore.tmpl +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/Manifest.tmpl.json +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/compile.tmpl.json +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/readme.tmpl.txt +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/Application.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/__init__.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/test/DemoTest.tmpl.js +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/resource/custom/.gitignore.tmpl +0 -0
- /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/translation/readme.txt +0 -0
- /package/source/resource/qx/tool/{loadsass.js → compiler/loadsass.js} +0 -0
|
@@ -1,2100 +0,0 @@
|
|
|
1
|
-
/* ************************************************************************
|
|
2
|
-
|
|
3
|
-
qooxdoo - the new era of web development
|
|
4
|
-
|
|
5
|
-
http://qooxdoo.org
|
|
6
|
-
|
|
7
|
-
Copyright:
|
|
8
|
-
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
|
|
9
|
-
|
|
10
|
-
License:
|
|
11
|
-
MIT: https://opensource.org/licenses/MIT
|
|
12
|
-
See the LICENSE file in the project's top-level directory for details.
|
|
13
|
-
|
|
14
|
-
Authors:
|
|
15
|
-
* Sebastian Werner (wpbasti)
|
|
16
|
-
* Andreas Ecker (ecker)
|
|
17
|
-
* Martin Wittemann (martinwittemann)
|
|
18
|
-
|
|
19
|
-
************************************************************************ */
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Internal class for handling of dynamic properties. Should only be used
|
|
23
|
-
* through the methods provided by {@link qx.Class}.
|
|
24
|
-
*
|
|
25
|
-
* For a complete documentation of properties take a look at
|
|
26
|
-
* http://qooxdoo.org/docs/#core/property_features.md.
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* *Normal properties*
|
|
30
|
-
*
|
|
31
|
-
* The <code>properties</code> key in the class definition map of {@link qx.Class#define}
|
|
32
|
-
* is used to generate the properties.
|
|
33
|
-
*
|
|
34
|
-
* Valid keys of a property definition are:
|
|
35
|
-
*
|
|
36
|
-
* <table>
|
|
37
|
-
* <tr><th>Name</th><th>Type</th><th>Description</th></tr>
|
|
38
|
-
* <tr><th>check</th><td>Array, String, Function</td><td>
|
|
39
|
-
* The check is used to check the type the incoming value of a property. This will only
|
|
40
|
-
* be executed in the source version. The build version will not contain the checks.
|
|
41
|
-
* The check can be:
|
|
42
|
-
* <ul>
|
|
43
|
-
* <li>a custom check function. The function takes the incoming value as a parameter and must
|
|
44
|
-
* return a boolean value to indicate whether the values is valid.
|
|
45
|
-
* </li>
|
|
46
|
-
* <li>inline check code as a string e.g. <code>"value > 0 && value < 100"</code></li>
|
|
47
|
-
* <li>a class name e.g. <code>qx.ui.form.Button</code></li>
|
|
48
|
-
* <li>a name of an interface the value must implement</li>
|
|
49
|
-
* <li>an array of all valid values</li>
|
|
50
|
-
* <li>one of the predefined checks: Boolean, String, Number, Integer, Float, Double,
|
|
51
|
-
* Object, Array, Map, Class, Mixin, Interface, Theme, Error, RegExp, Function,
|
|
52
|
-
* Date, Node, Element, Document, Window, Event
|
|
53
|
-
* </li>
|
|
54
|
-
* <ul>
|
|
55
|
-
* </td></tr>
|
|
56
|
-
* <tr><th>init</th><td>var</td><td>
|
|
57
|
-
* Sets the default/initial value of the property. If no property value is set or the property
|
|
58
|
-
* gets reset, the getter will return the <code>init</code> value.
|
|
59
|
-
* </td></tr>
|
|
60
|
-
* <tr><th>apply</th><td>String</td><td>
|
|
61
|
-
* On change of the property value the method of the specified name will be called. The signature of
|
|
62
|
-
* the method is <code>function(newValue, oldValue, propertyName)</code>. It is conventional to name
|
|
63
|
-
* the callback <code>_apply</code> + <i>PropertyName</i>, with the property name camel-cased (e.g.
|
|
64
|
-
* "<i>_applyFooBar</i>" for a property <i>fooBar</i>).
|
|
65
|
-
* </td></tr>
|
|
66
|
-
* <tr><th>event</th><td>String</td><td>
|
|
67
|
-
* On change of the property value an event with the given name will be dispatched. The event type is
|
|
68
|
-
* {@link qx.event.type.Data}.
|
|
69
|
-
* </td></tr>
|
|
70
|
-
* <tr><th>themeable</th><td>Boolean</td><td>
|
|
71
|
-
* Whether this property can be set using themes.
|
|
72
|
-
* </td></tr>
|
|
73
|
-
* <tr><th>inheritable</th><td>Boolean</td><td>
|
|
74
|
-
* Whether the property value should be inheritable. If the property does not have an user defined or an
|
|
75
|
-
* init value, the property will try to get the value from the parent of the current object.
|
|
76
|
-
* </td></tr>
|
|
77
|
-
* <tr><th>nullable</th><td>Boolean</td><td>
|
|
78
|
-
* Whether <code>null</code> is an allowed value of the property. This is complementary to the check
|
|
79
|
-
* defined using the <code>check</code> key.
|
|
80
|
-
* </td></tr>
|
|
81
|
-
* <tr><th>refine</th><td>Boolean</td><td>
|
|
82
|
-
* Whether the property definition is a refinement of a property in one of the super classes of the class.
|
|
83
|
-
* Only the <code>init</code> value can be changed using refine.
|
|
84
|
-
* </td></tr>
|
|
85
|
-
* <tr><th>transform</th><td>String</td><td>
|
|
86
|
-
* On setting of the property value the method of the specified name will
|
|
87
|
-
* be called. The signature of the method is <code>function(value, oldValue)</code>.
|
|
88
|
-
* The parameter <code>value</code> is the value passed to the setter, the
|
|
89
|
-
* parameter <code>oldValue</code> is the current value, or undefined if no value
|
|
90
|
-
* has been set previously.
|
|
91
|
-
* The function must return the modified or unmodified value.
|
|
92
|
-
* Transformation occurs before the check function, so both may be
|
|
93
|
-
* specified if desired. Alternatively, the transform function may throw
|
|
94
|
-
* an error if the value passed to it is invalid.
|
|
95
|
-
* </td></tr>
|
|
96
|
-
* <tr><th>validate</th><td>Function, String</td><td>
|
|
97
|
-
* On setting of the property value the method of the specified name will
|
|
98
|
-
* be called. The signature of the method is <code>function(value)</code>.
|
|
99
|
-
* The parameter <code>value</code> is the value passed to the setter.
|
|
100
|
-
* If the validation fails, an <code>qx.core.ValidationError</code> should
|
|
101
|
-
* be thrown by the validation function. Otherwise, just do nothing in the
|
|
102
|
-
* function.<br>
|
|
103
|
-
* If a string is given, the string should hold a reference to a member
|
|
104
|
-
* method.<br>
|
|
105
|
-
* <code>"<i>methodname</i>"</code> for example
|
|
106
|
-
* <code>"__validateProperty"</code><br>
|
|
107
|
-
* There are some default validators in the {@link qx.util.Validate} class.
|
|
108
|
-
* See this documentation for usage examples.
|
|
109
|
-
* </td></tr>
|
|
110
|
-
* <tr><th>dereference</th><td>Boolean</td><td>
|
|
111
|
-
* By default, the references to the values (current, init, ...) of the
|
|
112
|
-
* property will be stored as references on the object. When disposing
|
|
113
|
-
* this object, the references will not be deleted. Setting the
|
|
114
|
-
* dereference key to true tells the property system to delete all
|
|
115
|
-
* connections made by this property on dispose. This can be necessary for
|
|
116
|
-
* disconnecting DOM objects to allow the garbage collector to work
|
|
117
|
-
* properly.
|
|
118
|
-
* </td></tr>
|
|
119
|
-
* <tr><th>deferredInit</th><td>Boolean</td><td>
|
|
120
|
-
* Allow for a deferred initialization for reference types. Defaults to false.
|
|
121
|
-
* </td></tr>
|
|
122
|
-
* <tr><th>isEqual</th><td>Function, String</td><td>
|
|
123
|
-
* On setting of the property value the method of the specified name will
|
|
124
|
-
* be called to test if two values are equal. These checks for equality are
|
|
125
|
-
* performed by the Property-System to decide whether further actions (like
|
|
126
|
-
* e.g. calling applier methods or firing of events) are needed.
|
|
127
|
-
* The signature of the method is <code>function(valueA, valueB)</code>.
|
|
128
|
-
* <br/>
|
|
129
|
-
* The <i>isEqual</i>-value can be:
|
|
130
|
-
* <ul>
|
|
131
|
-
* <li>a custom check function.
|
|
132
|
-
* The function takes two values as parameter and must return a
|
|
133
|
-
* boolean value to indicate whether the values are considered
|
|
134
|
-
* equal e.g. <code>function (a, b) { return Object.is(a, b); }</code>.</li>
|
|
135
|
-
* <li>inline check code as a string
|
|
136
|
-
* which will be invoked with two parameters <code>a</code> and
|
|
137
|
-
* <code>b</code> and results in a boolean value to indicate whether
|
|
138
|
-
* the values are equal e.g. <code>"a.length() == b.length()"</code>.</li>
|
|
139
|
-
* <li>reference to a member method as string
|
|
140
|
-
* <code>"<i>methodname</i>"</code> which will be invoked with two
|
|
141
|
-
* parameters and returns a boolean value indicating whether the two
|
|
142
|
-
* values are considered equal for example <code>"__areTheSame"</code>.</li>
|
|
143
|
-
* </ul>
|
|
144
|
-
* The default implementation (if this key is undefined) will check the
|
|
145
|
-
* equality by using the <i>identity</i> operator (===) as if defined like
|
|
146
|
-
* <code>"a===b"</code>.
|
|
147
|
-
* </td></tr>
|
|
148
|
-
* </table>
|
|
149
|
-
*
|
|
150
|
-
* *Property groups*
|
|
151
|
-
*
|
|
152
|
-
* Property groups are defined in a similar way but support a different set of keys:
|
|
153
|
-
*
|
|
154
|
-
* <table>
|
|
155
|
-
* <tr><th>Name</th><th>Type</th><th>Description</th></tr>
|
|
156
|
-
* <tr><th>group</th><td>String[]</td><td>
|
|
157
|
-
* A list of property names which should be set using the property group.
|
|
158
|
-
* </td></tr>
|
|
159
|
-
* <tr><th>mode</th><td>String</td><td>
|
|
160
|
-
* If mode is set to <code>"shorthand"</code>, the properties can be set using a CSS like shorthand mode.
|
|
161
|
-
* </td></tr>
|
|
162
|
-
* <tr><th>themeable</th><td>Boolean</td><td>
|
|
163
|
-
* Whether this property can be set using themes.
|
|
164
|
-
* </td></tr>
|
|
165
|
-
* </table>
|
|
166
|
-
*
|
|
167
|
-
* @internal
|
|
168
|
-
* @ignore(qx.Interface)
|
|
169
|
-
*/
|
|
170
|
-
qx.Bootstrap.define("qx.core.Property", {
|
|
171
|
-
statics: {
|
|
172
|
-
/**
|
|
173
|
-
* This is a method which does nothing than gathering dependencies for the
|
|
174
|
-
* module system. Calling this method is useless because it does nothing.
|
|
175
|
-
*/
|
|
176
|
-
__gatherDependency() {
|
|
177
|
-
if (qx.core.Environment.get("module.events")) {
|
|
178
|
-
qx.event.type.Data;
|
|
179
|
-
qx.event.dispatch.Direct;
|
|
180
|
-
}
|
|
181
|
-
if (qx.core.Environment.get("qx.promise")) {
|
|
182
|
-
qx.Promise;
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Built-in checks
|
|
188
|
-
* The keys could be used in the check of the properties
|
|
189
|
-
*/
|
|
190
|
-
__checks: {
|
|
191
|
-
Boolean: "qx.core.Assert.assertBoolean(value, msg) || true",
|
|
192
|
-
String: "qx.core.Assert.assertString(value, msg) || true",
|
|
193
|
-
|
|
194
|
-
Number: "qx.core.Assert.assertNumber(value, msg) || true",
|
|
195
|
-
Integer: "qx.core.Assert.assertInteger(value, msg) || true",
|
|
196
|
-
PositiveNumber: "qx.core.Assert.assertPositiveNumber(value, msg) || true",
|
|
197
|
-
PositiveInteger:
|
|
198
|
-
"qx.core.Assert.assertPositiveInteger(value, msg) || true",
|
|
199
|
-
|
|
200
|
-
Error: "qx.core.Assert.assertInstance(value, Error, msg) || true",
|
|
201
|
-
RegExp: "qx.core.Assert.assertInstance(value, RegExp, msg) || true",
|
|
202
|
-
|
|
203
|
-
Object: "qx.core.Assert.assertObject(value, msg) || true",
|
|
204
|
-
Array: "qx.core.Assert.assertArray(value, msg) || true",
|
|
205
|
-
Map: "qx.core.Assert.assertMap(value, msg) || true",
|
|
206
|
-
|
|
207
|
-
Function: "qx.core.Assert.assertFunction(value, msg) || true",
|
|
208
|
-
Date: "qx.core.Assert.assertInstance(value, Date, msg) || true",
|
|
209
|
-
Node: "value !== null && value.nodeType !== undefined",
|
|
210
|
-
Element: "value !== null && value.nodeType === 1 && value.attributes",
|
|
211
|
-
Document:
|
|
212
|
-
"value !== null && value.nodeType === 9 && value.documentElement",
|
|
213
|
-
Window: "value !== null && value.document",
|
|
214
|
-
Event: "value !== null && value.type !== undefined",
|
|
215
|
-
|
|
216
|
-
Class: 'value !== null && value.$$type === "Class"',
|
|
217
|
-
Mixin: 'value !== null && value.$$type === "Mixin"',
|
|
218
|
-
Interface: 'value !== null && value.$$type === "Interface"',
|
|
219
|
-
Theme: 'value !== null && value.$$type === "Theme"',
|
|
220
|
-
|
|
221
|
-
Color:
|
|
222
|
-
"qx.lang.Type.isString(value) && qx.util.ColorUtil.isValidPropertyValue(value)",
|
|
223
|
-
Decorator:
|
|
224
|
-
"value !== null && qx.theme.manager.Decoration.getInstance().isValidPropertyValue(value)",
|
|
225
|
-
Font: "value !== null && qx.theme.manager.Font.getInstance().isDynamic(value)"
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Contains types from {@link #__checks} list which need to be dereferenced
|
|
230
|
-
*/
|
|
231
|
-
__dereference: {
|
|
232
|
-
Node: true,
|
|
233
|
-
Element: true,
|
|
234
|
-
Document: true,
|
|
235
|
-
Window: true,
|
|
236
|
-
Event: true
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Inherit value, used to override defaults etc. to force inheritance
|
|
241
|
-
* even if property value is not undefined (through multi-values)
|
|
242
|
-
*
|
|
243
|
-
* @internal
|
|
244
|
-
*/
|
|
245
|
-
$$inherit: "inherit",
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Caching field names for each property created
|
|
249
|
-
*
|
|
250
|
-
* @internal
|
|
251
|
-
*/
|
|
252
|
-
$$store: {
|
|
253
|
-
runtime: {},
|
|
254
|
-
user: {},
|
|
255
|
-
theme: {},
|
|
256
|
-
inherit: {},
|
|
257
|
-
init: {},
|
|
258
|
-
useinit: {}
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Caching function names for each property created
|
|
263
|
-
*
|
|
264
|
-
* @internal
|
|
265
|
-
*/
|
|
266
|
-
$$method: {
|
|
267
|
-
get: {},
|
|
268
|
-
getAsync: {},
|
|
269
|
-
set: {},
|
|
270
|
-
setImpl: {},
|
|
271
|
-
setAsync: {},
|
|
272
|
-
reset: {},
|
|
273
|
-
init: {},
|
|
274
|
-
refresh: {},
|
|
275
|
-
setRuntime: {},
|
|
276
|
-
resetRuntime: {},
|
|
277
|
-
setThemed: {},
|
|
278
|
-
resetThemed: {}
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Supported keys for property definitions
|
|
283
|
-
*
|
|
284
|
-
* @internal
|
|
285
|
-
*/
|
|
286
|
-
$$allowedKeys: {
|
|
287
|
-
"@": "object", // Anything
|
|
288
|
-
name: "string", // String
|
|
289
|
-
dereference: "boolean", // Boolean
|
|
290
|
-
inheritable: "boolean", // Boolean
|
|
291
|
-
nullable: "boolean", // Boolean
|
|
292
|
-
themeable: "boolean", // Boolean
|
|
293
|
-
refine: "boolean", // Boolean
|
|
294
|
-
init: null, // var
|
|
295
|
-
apply: "string", // String
|
|
296
|
-
event: "string", // String
|
|
297
|
-
check: null, // Array, String, Function
|
|
298
|
-
transform: "string", // String
|
|
299
|
-
async: "boolean", // Boolean
|
|
300
|
-
deferredInit: "boolean", // Boolean
|
|
301
|
-
validate: null, // String, Function
|
|
302
|
-
isEqual: null // String, Function
|
|
303
|
-
},
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Supported keys for property group definitions
|
|
307
|
-
*
|
|
308
|
-
* @internal
|
|
309
|
-
*/
|
|
310
|
-
$$allowedGroupKeys: {
|
|
311
|
-
"@": "object", // Anything
|
|
312
|
-
name: "string", // String
|
|
313
|
-
group: "object", // Array
|
|
314
|
-
mode: "string", // String
|
|
315
|
-
themeable: "boolean" // Boolean
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
/** Contains names of inheritable properties, filled by {@link qx.Class.define} */
|
|
319
|
-
$$inheritable: {},
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Generate optimized refresh method and attach it to the class' prototype
|
|
323
|
-
*
|
|
324
|
-
* @param clazz {Class} clazz to which the refresher should be added
|
|
325
|
-
*/
|
|
326
|
-
__executeOptimizedRefresh(clazz) {
|
|
327
|
-
var inheritables = this.__getInheritablesOfClass(clazz);
|
|
328
|
-
|
|
329
|
-
if (!inheritables.length) {
|
|
330
|
-
var refresher = function () {};
|
|
331
|
-
} else {
|
|
332
|
-
refresher = this.__createRefresher(inheritables);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
clazz.prototype.$$refreshInheritables = refresher;
|
|
336
|
-
},
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Get the names of all inheritable properties of the given class
|
|
340
|
-
*
|
|
341
|
-
* @param clazz {Class} class to get the inheritable properties of
|
|
342
|
-
* @return {String[]} List of property names
|
|
343
|
-
*/
|
|
344
|
-
__getInheritablesOfClass(clazz) {
|
|
345
|
-
var inheritable = [];
|
|
346
|
-
|
|
347
|
-
while (clazz) {
|
|
348
|
-
var properties = clazz.$$properties;
|
|
349
|
-
|
|
350
|
-
if (properties) {
|
|
351
|
-
for (var name in this.$$inheritable) {
|
|
352
|
-
// Whether the property is available in this class
|
|
353
|
-
// and whether it is inheritable in this class as well
|
|
354
|
-
if (properties[name] && properties[name].inheritable) {
|
|
355
|
-
inheritable.push(name);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
clazz = clazz.superclass;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
return inheritable;
|
|
364
|
-
},
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* Assemble the refresher code and return the generated function
|
|
368
|
-
*
|
|
369
|
-
* @param inheritables {String[]} list of inheritable properties
|
|
370
|
-
* @return {Function} refresher function
|
|
371
|
-
*/
|
|
372
|
-
__createRefresher(inheritables) {
|
|
373
|
-
var inherit = this.$$store.inherit;
|
|
374
|
-
var init = this.$$store.init;
|
|
375
|
-
var refresh = this.$$method.refresh;
|
|
376
|
-
|
|
377
|
-
var code = [
|
|
378
|
-
"var parent = this.getLayoutParent();",
|
|
379
|
-
"if (!parent) return;"
|
|
380
|
-
];
|
|
381
|
-
|
|
382
|
-
for (var i = 0, l = inheritables.length; i < l; i++) {
|
|
383
|
-
var name = inheritables[i];
|
|
384
|
-
code.push(
|
|
385
|
-
"var value = parent.",
|
|
386
|
-
inherit[name],
|
|
387
|
-
";",
|
|
388
|
-
"if (value===undefined) value = parent.",
|
|
389
|
-
init[name],
|
|
390
|
-
";",
|
|
391
|
-
"this.",
|
|
392
|
-
refresh[name],
|
|
393
|
-
"(value);"
|
|
394
|
-
);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
return new Function(code.join(""));
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* Attach $$refreshInheritables method stub to the given class
|
|
402
|
-
*
|
|
403
|
-
* @param clazz {Class} clazz to which the refresher should be added
|
|
404
|
-
*/
|
|
405
|
-
attachRefreshInheritables(clazz) {
|
|
406
|
-
clazz.prototype.$$refreshInheritables = function () {
|
|
407
|
-
qx.core.Property.__executeOptimizedRefresh(clazz);
|
|
408
|
-
return this.$$refreshInheritables();
|
|
409
|
-
};
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Attach one property to class
|
|
414
|
-
*
|
|
415
|
-
* @param clazz {Class} Class to attach properties to
|
|
416
|
-
* @param name {String} Name of property
|
|
417
|
-
* @param config {Map} Configuration map of property
|
|
418
|
-
*/
|
|
419
|
-
attachMethods(clazz, name, config) {
|
|
420
|
-
// Divide groups from "normal" properties
|
|
421
|
-
config.group
|
|
422
|
-
? this.__attachGroupMethods(clazz, config, name)
|
|
423
|
-
: this.__attachPropertyMethods(clazz, config, name);
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Attach group methods
|
|
428
|
-
*
|
|
429
|
-
* @param clazz {Class} Class to attach properties to
|
|
430
|
-
* @param config {Map} Property configuration
|
|
431
|
-
* @param name {String} Name of the property
|
|
432
|
-
*/
|
|
433
|
-
__attachGroupMethods(clazz, config, name) {
|
|
434
|
-
var upname = qx.Bootstrap.firstUp(name);
|
|
435
|
-
var members = clazz.prototype;
|
|
436
|
-
var themeable = config.themeable === true;
|
|
437
|
-
|
|
438
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
439
|
-
if (qx.core.Environment.get("qx.debug.property.level") > 1) {
|
|
440
|
-
qx.Bootstrap.debug("Generating property group: " + name);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
var setter = [];
|
|
445
|
-
var resetter = [];
|
|
446
|
-
|
|
447
|
-
if (themeable) {
|
|
448
|
-
var styler = [];
|
|
449
|
-
var unstyler = [];
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
var argHandler =
|
|
453
|
-
"var a=arguments[0] instanceof Array?arguments[0]:arguments;";
|
|
454
|
-
|
|
455
|
-
setter.push(argHandler);
|
|
456
|
-
|
|
457
|
-
if (themeable) {
|
|
458
|
-
styler.push(argHandler);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
if (config.mode == "shorthand") {
|
|
462
|
-
var shorthand =
|
|
463
|
-
"a=qx.lang.Array.fromShortHand(qx.lang.Array.fromArguments(a));";
|
|
464
|
-
setter.push(shorthand);
|
|
465
|
-
|
|
466
|
-
if (themeable) {
|
|
467
|
-
styler.push(shorthand);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
for (var i = 0, a = config.group, l = a.length; i < l; i++) {
|
|
472
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
473
|
-
if (!this.$$method.set[a[i]] || !this.$$method.reset[a[i]]) {
|
|
474
|
-
throw new Error(
|
|
475
|
-
"Cannot create property group '" +
|
|
476
|
-
name +
|
|
477
|
-
"' including non-existing property '" +
|
|
478
|
-
a[i] +
|
|
479
|
-
"'!"
|
|
480
|
-
);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
setter.push("this.", this.$$method.set[a[i]], "(a[", i, "]);");
|
|
485
|
-
resetter.push("this.", this.$$method.reset[a[i]], "();");
|
|
486
|
-
|
|
487
|
-
if (themeable) {
|
|
488
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
489
|
-
if (!this.$$method.setThemed[a[i]]) {
|
|
490
|
-
throw new Error(
|
|
491
|
-
"Cannot add the non themable property '" +
|
|
492
|
-
a[i] +
|
|
493
|
-
"' to the themable property group '" +
|
|
494
|
-
name +
|
|
495
|
-
"'"
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
styler.push("this.", this.$$method.setThemed[a[i]], "(a[", i, "]);");
|
|
501
|
-
unstyler.push("this.", this.$$method.resetThemed[a[i]], "();");
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
// Attach setter
|
|
506
|
-
this.$$method.set[name] = "set" + upname;
|
|
507
|
-
members[this.$$method.set[name]] = new Function(setter.join(""));
|
|
508
|
-
|
|
509
|
-
// Attach resetter
|
|
510
|
-
this.$$method.reset[name] = "reset" + upname;
|
|
511
|
-
members[this.$$method.reset[name]] = new Function(resetter.join(""));
|
|
512
|
-
|
|
513
|
-
if (themeable) {
|
|
514
|
-
// Attach styler
|
|
515
|
-
this.$$method.setThemed[name] = "setThemed" + upname;
|
|
516
|
-
members[this.$$method.setThemed[name]] = new Function(styler.join(""));
|
|
517
|
-
|
|
518
|
-
// Attach unstyler
|
|
519
|
-
this.$$method.resetThemed[name] = "resetThemed" + upname;
|
|
520
|
-
members[this.$$method.resetThemed[name]] = new Function(
|
|
521
|
-
unstyler.join("")
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* Attach property methods
|
|
528
|
-
*
|
|
529
|
-
* @param clazz {Class} Class to attach properties to
|
|
530
|
-
* @param config {Map} Property configuration
|
|
531
|
-
* @param name {String} Name of the property
|
|
532
|
-
*/
|
|
533
|
-
__attachPropertyMethods(clazz, config, name) {
|
|
534
|
-
var upname = qx.Bootstrap.firstUp(name);
|
|
535
|
-
var members = clazz.prototype;
|
|
536
|
-
|
|
537
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
538
|
-
if (qx.core.Environment.get("qx.debug.property.level") > 1) {
|
|
539
|
-
qx.Bootstrap.debug("Generating property wrappers: " + name);
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
// Fill dispose value
|
|
544
|
-
if (
|
|
545
|
-
config.dereference === undefined &&
|
|
546
|
-
typeof config.check === "string"
|
|
547
|
-
) {
|
|
548
|
-
config.dereference = this.__shouldBeDereferenced(config.check);
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
if (!qx.core.Environment.get("qx.promise")) {
|
|
552
|
-
if (config.async) {
|
|
553
|
-
this.warn(
|
|
554
|
-
"Asynchronous property " +
|
|
555
|
-
clazz.classname +
|
|
556
|
-
"." +
|
|
557
|
-
name +
|
|
558
|
-
" is switched to synchronous because qx.promise==false"
|
|
559
|
-
);
|
|
560
|
-
|
|
561
|
-
config.async = false;
|
|
562
|
-
}
|
|
563
|
-
if (config.check == "qx.Promise") {
|
|
564
|
-
this.error(
|
|
565
|
-
"Cannot implement check for property " +
|
|
566
|
-
clazz.classname +
|
|
567
|
-
"." +
|
|
568
|
-
name +
|
|
569
|
-
" because qx.promise==false"
|
|
570
|
-
);
|
|
571
|
-
|
|
572
|
-
delete config.check;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
// Check for method name conflicts
|
|
577
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
578
|
-
// Exclude qx.data.model.* because that's from marshalling and will cause conflicts to be reported
|
|
579
|
-
if (clazz.classname && !clazz.classname.match(/^qx.data.model/)) {
|
|
580
|
-
var allNames = [
|
|
581
|
-
"get" + upname,
|
|
582
|
-
"set" + upname,
|
|
583
|
-
"reset" + upname,
|
|
584
|
-
"setRuntime" + upname,
|
|
585
|
-
"resetRuntime" + upname
|
|
586
|
-
];
|
|
587
|
-
|
|
588
|
-
if (config.async) {
|
|
589
|
-
allNames.push("get" + upname + "Async");
|
|
590
|
-
allNames.push("set" + upname + "Async");
|
|
591
|
-
}
|
|
592
|
-
if (
|
|
593
|
-
config.inheritable ||
|
|
594
|
-
config.apply ||
|
|
595
|
-
config.event ||
|
|
596
|
-
config.deferredInit
|
|
597
|
-
) {
|
|
598
|
-
allNames.push("init" + upname);
|
|
599
|
-
}
|
|
600
|
-
if (config.inheritable) {
|
|
601
|
-
allNames.push("refresh" + upname);
|
|
602
|
-
}
|
|
603
|
-
if (config.themeable) {
|
|
604
|
-
allNames.push("getThemed" + upname);
|
|
605
|
-
allNames.push("setThemed" + upname);
|
|
606
|
-
allNames.push("resetThemed" + upname);
|
|
607
|
-
}
|
|
608
|
-
if (config.check === "Boolean") {
|
|
609
|
-
allNames.push("is" + upname);
|
|
610
|
-
allNames.push("toggle" + upname);
|
|
611
|
-
}
|
|
612
|
-
allNames.forEach(function (name) {
|
|
613
|
-
if (clazz.superclass.prototype[name] !== undefined) {
|
|
614
|
-
var conflictingClass = null;
|
|
615
|
-
for (
|
|
616
|
-
var tmp = clazz.superclass;
|
|
617
|
-
tmp && tmp != qx.core.Object;
|
|
618
|
-
tmp = tmp.superclass
|
|
619
|
-
) {
|
|
620
|
-
if (tmp.superclass.prototype[name] === undefined) {
|
|
621
|
-
conflictingClass = tmp;
|
|
622
|
-
break;
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
if (conflictingClass) {
|
|
626
|
-
qx.log.Logger.warn(
|
|
627
|
-
"Conflicting property method " +
|
|
628
|
-
clazz.classname +
|
|
629
|
-
"." +
|
|
630
|
-
name +
|
|
631
|
-
" with " +
|
|
632
|
-
conflictingClass.classname
|
|
633
|
-
);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
var method = this.$$method;
|
|
641
|
-
var store = this.$$store;
|
|
642
|
-
|
|
643
|
-
store.runtime[name] = "$$runtime_" + name;
|
|
644
|
-
store.user[name] = "$$user_" + name;
|
|
645
|
-
store.theme[name] = "$$theme_" + name;
|
|
646
|
-
store.init[name] = "$$init_" + name;
|
|
647
|
-
store.inherit[name] = "$$inherit_" + name;
|
|
648
|
-
store.useinit[name] = "$$useinit_" + name;
|
|
649
|
-
|
|
650
|
-
var getName = (method.get[name] = "get" + upname);
|
|
651
|
-
members[method.get[name]] = new Function(
|
|
652
|
-
"this." +
|
|
653
|
-
getName +
|
|
654
|
-
".$$install && this." +
|
|
655
|
-
getName +
|
|
656
|
-
".$$install();" +
|
|
657
|
-
"return this." +
|
|
658
|
-
getName +
|
|
659
|
-
".apply(this, arguments);"
|
|
660
|
-
);
|
|
661
|
-
|
|
662
|
-
if (config.async) {
|
|
663
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
664
|
-
if (members.hasOwnProperty(getName + "Async")) {
|
|
665
|
-
this.error(
|
|
666
|
-
"Asynchronous property " +
|
|
667
|
-
clazz.classname +
|
|
668
|
-
"." +
|
|
669
|
-
name +
|
|
670
|
-
" is replacing " +
|
|
671
|
-
getName +
|
|
672
|
-
"Async() method in same class"
|
|
673
|
-
);
|
|
674
|
-
} else if (members[getName + "Async"] !== undefined) {
|
|
675
|
-
this.warn(
|
|
676
|
-
"Asynchronous property " +
|
|
677
|
-
clazz.classname +
|
|
678
|
-
"." +
|
|
679
|
-
name +
|
|
680
|
-
" is overriding " +
|
|
681
|
-
getName +
|
|
682
|
-
"Async() method"
|
|
683
|
-
);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
method.getAsync[name] = getName + "Async";
|
|
687
|
-
members[method.getAsync[name]] = new Function(
|
|
688
|
-
"this." +
|
|
689
|
-
getName +
|
|
690
|
-
".$$install && this." +
|
|
691
|
-
getName +
|
|
692
|
-
".$$install.call(this);" +
|
|
693
|
-
"return this." +
|
|
694
|
-
getName +
|
|
695
|
-
"Async.apply(this, arguments);"
|
|
696
|
-
);
|
|
697
|
-
}
|
|
698
|
-
members[method.get[name]].$$install = function () {
|
|
699
|
-
qx.core.Property.__installOptimizedGetter(
|
|
700
|
-
clazz,
|
|
701
|
-
name,
|
|
702
|
-
"get",
|
|
703
|
-
arguments
|
|
704
|
-
);
|
|
705
|
-
|
|
706
|
-
if (config.async) {
|
|
707
|
-
qx.core.Property.__installOptimizedGetter(
|
|
708
|
-
clazz,
|
|
709
|
-
name,
|
|
710
|
-
"getAsync",
|
|
711
|
-
arguments
|
|
712
|
-
);
|
|
713
|
-
}
|
|
714
|
-
};
|
|
715
|
-
|
|
716
|
-
var setName = (method.set[name] = "set" + upname);
|
|
717
|
-
members[setName] = new Function(
|
|
718
|
-
"this." +
|
|
719
|
-
setName +
|
|
720
|
-
".$$install && this." +
|
|
721
|
-
setName +
|
|
722
|
-
".$$install.call(this);" +
|
|
723
|
-
"return this." +
|
|
724
|
-
setName +
|
|
725
|
-
".apply(this, arguments);"
|
|
726
|
-
);
|
|
727
|
-
|
|
728
|
-
method.setAsync[name] = "set" + upname + "Async";
|
|
729
|
-
if (config.async) {
|
|
730
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
731
|
-
if (members.hasOwnProperty(setName + "Async")) {
|
|
732
|
-
this.error(
|
|
733
|
-
"Asynchronous property " +
|
|
734
|
-
clazz.classname +
|
|
735
|
-
"." +
|
|
736
|
-
name +
|
|
737
|
-
" is replacing " +
|
|
738
|
-
setName +
|
|
739
|
-
"Async() method in same class"
|
|
740
|
-
);
|
|
741
|
-
} else if (members[setName + "Async"] !== undefined) {
|
|
742
|
-
this.warn(
|
|
743
|
-
"Asynchronous property " +
|
|
744
|
-
clazz.classname +
|
|
745
|
-
"." +
|
|
746
|
-
name +
|
|
747
|
-
" is overriding " +
|
|
748
|
-
setName +
|
|
749
|
-
"Async() method"
|
|
750
|
-
);
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
members[setName + "Async"] = new Function(
|
|
754
|
-
"this." +
|
|
755
|
-
setName +
|
|
756
|
-
".$$install && this." +
|
|
757
|
-
setName +
|
|
758
|
-
".$$install.call(this);" +
|
|
759
|
-
"return this." +
|
|
760
|
-
setName +
|
|
761
|
-
"Async.apply(this, arguments);"
|
|
762
|
-
);
|
|
763
|
-
}
|
|
764
|
-
method.setImpl[name] = "$$set" + upname + "Impl";
|
|
765
|
-
members[setName].$$install = function () {
|
|
766
|
-
qx.core.Property.__installOptimizedSetter(clazz, name, "set");
|
|
767
|
-
qx.core.Property.__installOptimizedSetter(clazz, name, "setImpl");
|
|
768
|
-
if (config.async) {
|
|
769
|
-
qx.core.Property.__installOptimizedSetter(clazz, name, "setAsync");
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
method.reset[name] = "reset" + upname;
|
|
774
|
-
members[method.reset[name]] = function () {
|
|
775
|
-
return qx.core.Property.executeOptimizedSetter(
|
|
776
|
-
this,
|
|
777
|
-
clazz,
|
|
778
|
-
name,
|
|
779
|
-
"reset"
|
|
780
|
-
);
|
|
781
|
-
};
|
|
782
|
-
members[method.reset[name]].$$install = function () {
|
|
783
|
-
qx.core.Property.__installOptimizedSetter(clazz, name, "reset");
|
|
784
|
-
};
|
|
785
|
-
|
|
786
|
-
if (
|
|
787
|
-
config.inheritable ||
|
|
788
|
-
config.apply ||
|
|
789
|
-
config.event ||
|
|
790
|
-
config.deferredInit
|
|
791
|
-
) {
|
|
792
|
-
method.init[name] = "init" + upname;
|
|
793
|
-
members[method.init[name]] = function (value) {
|
|
794
|
-
return qx.core.Property.executeOptimizedSetter(
|
|
795
|
-
this,
|
|
796
|
-
clazz,
|
|
797
|
-
name,
|
|
798
|
-
"init",
|
|
799
|
-
arguments
|
|
800
|
-
);
|
|
801
|
-
};
|
|
802
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
803
|
-
members[method.init[name]].$$propertyMethod = true;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
if (config.inheritable) {
|
|
808
|
-
method.refresh[name] = "refresh" + upname;
|
|
809
|
-
members[method.refresh[name]] = function (value) {
|
|
810
|
-
return qx.core.Property.executeOptimizedSetter(
|
|
811
|
-
this,
|
|
812
|
-
clazz,
|
|
813
|
-
name,
|
|
814
|
-
"refresh",
|
|
815
|
-
arguments
|
|
816
|
-
);
|
|
817
|
-
};
|
|
818
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
819
|
-
members[method.refresh[name]].$$propertyMethod = true;
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
method.setRuntime[name] = "setRuntime" + upname;
|
|
824
|
-
members[method.setRuntime[name]] = function (value) {
|
|
825
|
-
return qx.core.Property.executeOptimizedSetter(
|
|
826
|
-
this,
|
|
827
|
-
clazz,
|
|
828
|
-
name,
|
|
829
|
-
"setRuntime",
|
|
830
|
-
arguments
|
|
831
|
-
);
|
|
832
|
-
};
|
|
833
|
-
|
|
834
|
-
method.resetRuntime[name] = "resetRuntime" + upname;
|
|
835
|
-
members[method.resetRuntime[name]] = function () {
|
|
836
|
-
return qx.core.Property.executeOptimizedSetter(
|
|
837
|
-
this,
|
|
838
|
-
clazz,
|
|
839
|
-
name,
|
|
840
|
-
"resetRuntime"
|
|
841
|
-
);
|
|
842
|
-
};
|
|
843
|
-
|
|
844
|
-
if (config.themeable) {
|
|
845
|
-
method.setThemed[name] = "setThemed" + upname;
|
|
846
|
-
members[method.setThemed[name]] = function (value) {
|
|
847
|
-
return qx.core.Property.executeOptimizedSetter(
|
|
848
|
-
this,
|
|
849
|
-
clazz,
|
|
850
|
-
name,
|
|
851
|
-
"setThemed",
|
|
852
|
-
arguments
|
|
853
|
-
);
|
|
854
|
-
};
|
|
855
|
-
|
|
856
|
-
method.resetThemed[name] = "resetThemed" + upname;
|
|
857
|
-
members[method.resetThemed[name]] = function () {
|
|
858
|
-
return qx.core.Property.executeOptimizedSetter(
|
|
859
|
-
this,
|
|
860
|
-
clazz,
|
|
861
|
-
name,
|
|
862
|
-
"resetThemed"
|
|
863
|
-
);
|
|
864
|
-
};
|
|
865
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
866
|
-
members[method.setThemed[name]].$$propertyMethod = true;
|
|
867
|
-
members[method.resetThemed[name]].$$propertyMethod = true;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
if (config.check === "Boolean") {
|
|
872
|
-
members["toggle" + upname] = new Function(
|
|
873
|
-
"return this." +
|
|
874
|
-
method.set[name] +
|
|
875
|
-
"(!this." +
|
|
876
|
-
method.get[name] +
|
|
877
|
-
"())"
|
|
878
|
-
);
|
|
879
|
-
|
|
880
|
-
members["is" + upname] = new Function(
|
|
881
|
-
"return this." + method.get[name] + "()"
|
|
882
|
-
);
|
|
883
|
-
|
|
884
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
885
|
-
members["toggle" + upname].$$propertyMethod = true;
|
|
886
|
-
members["is" + upname].$$propertyMethod = true;
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
// attach a flag to make generated property methods
|
|
891
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
892
|
-
members[method.get[name]].$$propertyMethod = true;
|
|
893
|
-
members[method.set[name]].$$propertyMethod = true;
|
|
894
|
-
members[method.reset[name]].$$propertyMethod = true;
|
|
895
|
-
members[method.setRuntime[name]].$$propertyMethod = true;
|
|
896
|
-
members[method.resetRuntime[name]].$$propertyMethod = true;
|
|
897
|
-
}
|
|
898
|
-
},
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
* Returns if the reference for the given property check should be removed
|
|
902
|
-
* on dispose.
|
|
903
|
-
*
|
|
904
|
-
* @param check {var} The check of the property definition.
|
|
905
|
-
* @return {Boolean} If the dereference key should be set.
|
|
906
|
-
*/
|
|
907
|
-
__shouldBeDereferenced(check) {
|
|
908
|
-
return !!this.__dereference[check];
|
|
909
|
-
},
|
|
910
|
-
|
|
911
|
-
/** @type {Map} Internal data field for error messages used by {@link #error} */
|
|
912
|
-
__errors: {
|
|
913
|
-
0: "Could not change or apply init value after constructing phase!",
|
|
914
|
-
1: "Requires exactly one argument!",
|
|
915
|
-
2: "Undefined value is not allowed!",
|
|
916
|
-
3: "Does not allow any arguments!",
|
|
917
|
-
4: "Null value is not allowed!",
|
|
918
|
-
5: "Is invalid!"
|
|
919
|
-
},
|
|
920
|
-
|
|
921
|
-
/**
|
|
922
|
-
* Error method used by the property system to report errors.
|
|
923
|
-
*
|
|
924
|
-
* @param obj {qx.core.Object} Any qooxdoo object
|
|
925
|
-
* @param id {Integer} Numeric error identifier
|
|
926
|
-
* @param property {String} Name of the property
|
|
927
|
-
* @param variant {String} Name of the method variant e.g. "set", "reset", ...
|
|
928
|
-
* @param value {var} Incoming value
|
|
929
|
-
*/
|
|
930
|
-
error(obj, id, property, variant, value) {
|
|
931
|
-
var classname = obj.constructor.classname;
|
|
932
|
-
var msg =
|
|
933
|
-
"Error in property " +
|
|
934
|
-
property +
|
|
935
|
-
" of class " +
|
|
936
|
-
classname +
|
|
937
|
-
" in method " +
|
|
938
|
-
this.$$method[variant][property] +
|
|
939
|
-
" with incoming value '" +
|
|
940
|
-
value +
|
|
941
|
-
"': ";
|
|
942
|
-
|
|
943
|
-
throw new Error(msg + (this.__errors[id] || "Unknown reason: " + id));
|
|
944
|
-
},
|
|
945
|
-
|
|
946
|
-
/**
|
|
947
|
-
* Compiles a string builder object to a function, executes the function and
|
|
948
|
-
* returns the return value.
|
|
949
|
-
*
|
|
950
|
-
* @param instance {Object} Instance which have called the original method
|
|
951
|
-
* @param members {Object} Prototype members map where the new function should be stored
|
|
952
|
-
* @param name {String} Name of the property
|
|
953
|
-
* @param variant {String} Function variant e.g. get, set, reset, ...
|
|
954
|
-
* @param code {Array} Array which contains the code
|
|
955
|
-
* @param args {arguments} Incoming arguments of wrapper method
|
|
956
|
-
* @return {var} Return value of the generated function
|
|
957
|
-
*/
|
|
958
|
-
__unwrapFunctionFromCode(instance, members, name, variant, code, args) {
|
|
959
|
-
var fn = this.__installFunctionFromCode(
|
|
960
|
-
instance.constructor,
|
|
961
|
-
name,
|
|
962
|
-
variant,
|
|
963
|
-
code,
|
|
964
|
-
args
|
|
965
|
-
);
|
|
966
|
-
|
|
967
|
-
// Executing new function
|
|
968
|
-
if (args === undefined) {
|
|
969
|
-
return fn.call(instance);
|
|
970
|
-
} else if (qx.core.Environment.get("qx.debug")) {
|
|
971
|
-
return fn.apply(instance, args);
|
|
972
|
-
} else {
|
|
973
|
-
return fn.call(instance, args[0]);
|
|
974
|
-
}
|
|
975
|
-
},
|
|
976
|
-
|
|
977
|
-
/**
|
|
978
|
-
* Takes a string builder object, converts it into a function, and installs it as
|
|
979
|
-
* a property accessor
|
|
980
|
-
*
|
|
981
|
-
* @param clazz {Class} Class to install the method into
|
|
982
|
-
* @param name {String} Name of the property
|
|
983
|
-
* @param variant {String} Function variant e.g. get, set, reset, ...
|
|
984
|
-
* @param code {Array} Array which contains the code
|
|
985
|
-
* @param args {arguments} Incoming arguments of wrapper method
|
|
986
|
-
* @return {var} Return value of the generated function
|
|
987
|
-
*/
|
|
988
|
-
__installFunctionFromCode(clazz, name, variant, code, args) {
|
|
989
|
-
var store = this.$$method[variant][name];
|
|
990
|
-
|
|
991
|
-
// Output generate code
|
|
992
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
993
|
-
if (qx.core.Environment.get("qx.debug.property.level") > 1) {
|
|
994
|
-
qx.Bootstrap.debug(
|
|
995
|
-
"Code[" + this.$$method[variant][name] + "]: " + code.join("")
|
|
996
|
-
);
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// Overriding temporary wrapper
|
|
1000
|
-
try {
|
|
1001
|
-
clazz.prototype[store] = new Function("value", code.join(""));
|
|
1002
|
-
} catch (ex) {
|
|
1003
|
-
throw new Error(
|
|
1004
|
-
"Malformed generated code to unwrap method: " +
|
|
1005
|
-
this.$$method[variant][name] +
|
|
1006
|
-
"\n" +
|
|
1007
|
-
code.join("")
|
|
1008
|
-
);
|
|
1009
|
-
}
|
|
1010
|
-
} else {
|
|
1011
|
-
clazz.prototype[store] = new Function("value", code.join(""));
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
// Enable profiling code
|
|
1015
|
-
if (qx.core.Environment.get("qx.aspects")) {
|
|
1016
|
-
clazz.prototype[store] = qx.core.Aspect.wrap(
|
|
1017
|
-
clazz.classname + "." + store,
|
|
1018
|
-
clazz.prototype[store],
|
|
1019
|
-
"property"
|
|
1020
|
-
);
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
qx.Bootstrap.setDisplayName(
|
|
1024
|
-
clazz.prototype[store],
|
|
1025
|
-
clazz.classname + ".prototype",
|
|
1026
|
-
store
|
|
1027
|
-
);
|
|
1028
|
-
|
|
1029
|
-
return clazz.prototype[store];
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
-
/**
|
|
1033
|
-
* Generates the optimized getter, installs it into the class prototype, and executes it
|
|
1034
|
-
* Supported variants: get
|
|
1035
|
-
*
|
|
1036
|
-
* @param instance {Object} the instance which calls the method
|
|
1037
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1038
|
-
* @param name {String} name of the property
|
|
1039
|
-
* @param variant {String} Method variant.
|
|
1040
|
-
* @return {var} Execute return value of apply generated function, generally the incoming value
|
|
1041
|
-
*/
|
|
1042
|
-
executeOptimizedGetter(instance, clazz, name, variant) {
|
|
1043
|
-
var code = this.__compileGetter(clazz, name, variant);
|
|
1044
|
-
var members = clazz.prototype;
|
|
1045
|
-
return this.__unwrapFunctionFromCode(
|
|
1046
|
-
instance,
|
|
1047
|
-
members,
|
|
1048
|
-
name,
|
|
1049
|
-
variant,
|
|
1050
|
-
code
|
|
1051
|
-
);
|
|
1052
|
-
},
|
|
1053
|
-
|
|
1054
|
-
/**
|
|
1055
|
-
* Installs a getter into the class prototype, without executing it
|
|
1056
|
-
* Supported variants: get
|
|
1057
|
-
*
|
|
1058
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1059
|
-
* @param name {String} name of the property
|
|
1060
|
-
* @param variant {String} Method variant.
|
|
1061
|
-
*/
|
|
1062
|
-
__installOptimizedGetter(clazz, name, variant) {
|
|
1063
|
-
var code = this.__compileGetter(clazz, name, variant);
|
|
1064
|
-
this.__installFunctionFromCode(clazz, name, variant, code);
|
|
1065
|
-
},
|
|
1066
|
-
|
|
1067
|
-
/**
|
|
1068
|
-
* Compiles a getter into a string builder array
|
|
1069
|
-
* Supported variants: get
|
|
1070
|
-
*
|
|
1071
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1072
|
-
* @param name {String} name of the property
|
|
1073
|
-
* @param variant {String} Method variant.
|
|
1074
|
-
* @return {String[]} the string builder array
|
|
1075
|
-
*/
|
|
1076
|
-
__compileGetter(clazz, name, variant) {
|
|
1077
|
-
var config = clazz.$$properties[name];
|
|
1078
|
-
var code = [];
|
|
1079
|
-
var store = this.$$store;
|
|
1080
|
-
|
|
1081
|
-
if (variant == "getAsync") {
|
|
1082
|
-
code.push(
|
|
1083
|
-
"return qx.Promise.resolve(this." + this.$$method.get[name] + "());"
|
|
1084
|
-
);
|
|
1085
|
-
|
|
1086
|
-
return code;
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
code.push("if(this.", store.runtime[name], "!==undefined)");
|
|
1090
|
-
code.push("return this.", store.runtime[name], ";");
|
|
1091
|
-
|
|
1092
|
-
if (config.inheritable) {
|
|
1093
|
-
code.push("else if(this.", store.inherit[name], "!==undefined)");
|
|
1094
|
-
code.push("return this.", store.inherit[name], ";");
|
|
1095
|
-
code.push("else ");
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
code.push("if(this.", store.user[name], "!==undefined)");
|
|
1099
|
-
code.push("return this.", store.user[name], ";");
|
|
1100
|
-
|
|
1101
|
-
if (config.themeable) {
|
|
1102
|
-
code.push("else if(this.", store.theme[name], "!==undefined)");
|
|
1103
|
-
code.push("return this.", store.theme[name], ";");
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
if (config.deferredInit && config.init === undefined) {
|
|
1107
|
-
code.push("else if(this.", store.init[name], "!==undefined)");
|
|
1108
|
-
code.push("return this.", store.init[name], ";");
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
code.push("else ");
|
|
1112
|
-
|
|
1113
|
-
if (config.init !== undefined) {
|
|
1114
|
-
if (config.inheritable) {
|
|
1115
|
-
code.push("var init=this.", store.init[name], ";");
|
|
1116
|
-
|
|
1117
|
-
if (config.nullable) {
|
|
1118
|
-
code.push("if(init==qx.core.Property.$$inherit)init=null;");
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
code.push("return init;");
|
|
1122
|
-
} else {
|
|
1123
|
-
code.push("return this.", store.init[name], ";");
|
|
1124
|
-
}
|
|
1125
|
-
} else if (config.inheritable || config.nullable) {
|
|
1126
|
-
code.push("return null;");
|
|
1127
|
-
} else {
|
|
1128
|
-
code.push(
|
|
1129
|
-
'throw new Error("Property ',
|
|
1130
|
-
name,
|
|
1131
|
-
" of an instance of ",
|
|
1132
|
-
clazz.classname,
|
|
1133
|
-
' is not (yet) ready!");'
|
|
1134
|
-
);
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
return code;
|
|
1138
|
-
},
|
|
1139
|
-
|
|
1140
|
-
/**
|
|
1141
|
-
* Generates the optimized setter
|
|
1142
|
-
* Supported variants: set, reset, init, refresh, style, unstyle
|
|
1143
|
-
*
|
|
1144
|
-
* @param instance {Object} the instance which calls the method
|
|
1145
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1146
|
-
* @param name {String} name of the property
|
|
1147
|
-
* @param variant {String} Method variant.
|
|
1148
|
-
* @param args {arguments} Incoming arguments of wrapper method
|
|
1149
|
-
* @return {var} Execute return value of apply generated function, generally the incoming value
|
|
1150
|
-
*/
|
|
1151
|
-
executeOptimizedSetter(instance, clazz, name, variant, args) {
|
|
1152
|
-
var code = this.__compileSetter(clazz, name, variant);
|
|
1153
|
-
var members = clazz.prototype;
|
|
1154
|
-
return this.__unwrapFunctionFromCode(
|
|
1155
|
-
instance,
|
|
1156
|
-
members,
|
|
1157
|
-
name,
|
|
1158
|
-
variant,
|
|
1159
|
-
code,
|
|
1160
|
-
args
|
|
1161
|
-
);
|
|
1162
|
-
},
|
|
1163
|
-
|
|
1164
|
-
/**
|
|
1165
|
-
* Installs a setter into the class prototype, without executing it
|
|
1166
|
-
* Supported variants: set
|
|
1167
|
-
*
|
|
1168
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1169
|
-
* @param name {String} name of the property
|
|
1170
|
-
* @param variant {String} Method variant.
|
|
1171
|
-
* @return {var} Return value of the generated function
|
|
1172
|
-
*/
|
|
1173
|
-
__installOptimizedSetter(clazz, name, variant) {
|
|
1174
|
-
var code = this.__compileSetter(clazz, name, variant);
|
|
1175
|
-
return this.__installFunctionFromCode(clazz, name, variant, code);
|
|
1176
|
-
},
|
|
1177
|
-
|
|
1178
|
-
/**
|
|
1179
|
-
* Compiles a setter into a string builder array
|
|
1180
|
-
* Supported variants: set, setThemed, setRuntime, init
|
|
1181
|
-
*
|
|
1182
|
-
* @param instance {Object} the instance which calls the method
|
|
1183
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1184
|
-
* @param name {String} name of the property
|
|
1185
|
-
* @param variant {String} Method variant.
|
|
1186
|
-
* @return {String[]} the string builder array
|
|
1187
|
-
*/
|
|
1188
|
-
__compileSetter(clazz, name, variant) {
|
|
1189
|
-
var config = clazz.$$properties[name];
|
|
1190
|
-
var members = clazz.prototype;
|
|
1191
|
-
var code = [];
|
|
1192
|
-
|
|
1193
|
-
var upname = qx.lang.String.firstUp(name);
|
|
1194
|
-
if (variant == "setAsync") {
|
|
1195
|
-
code.push(
|
|
1196
|
-
"return qx.Promise.resolve(this.$$set" +
|
|
1197
|
-
upname +
|
|
1198
|
-
"Impl.apply(this, arguments));"
|
|
1199
|
-
);
|
|
1200
|
-
|
|
1201
|
-
return code;
|
|
1202
|
-
} else if (variant == "set") {
|
|
1203
|
-
code.push(
|
|
1204
|
-
"this.$$set" + upname + "Impl.apply(this, arguments);",
|
|
1205
|
-
"return value;"
|
|
1206
|
-
);
|
|
1207
|
-
|
|
1208
|
-
return code;
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
var incomingValue =
|
|
1212
|
-
variant === "setImpl" ||
|
|
1213
|
-
variant === "setThemed" ||
|
|
1214
|
-
variant === "setRuntime" ||
|
|
1215
|
-
(variant === "init" && config.init === undefined);
|
|
1216
|
-
var hasCallback = config.apply || config.event || config.inheritable;
|
|
1217
|
-
|
|
1218
|
-
var store = this.__getStore(variant, name);
|
|
1219
|
-
|
|
1220
|
-
this.__emitIsEqualFunction(code, clazz, config, name);
|
|
1221
|
-
|
|
1222
|
-
this.__emitSetterPreConditions(
|
|
1223
|
-
code,
|
|
1224
|
-
config,
|
|
1225
|
-
name,
|
|
1226
|
-
variant,
|
|
1227
|
-
incomingValue
|
|
1228
|
-
);
|
|
1229
|
-
|
|
1230
|
-
if (incomingValue || hasCallback) {
|
|
1231
|
-
this.__emitOldValue(code, config, name);
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
if (incomingValue) {
|
|
1235
|
-
this.__emitIncomingValueTransformation(code, clazz, config, name);
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
if (hasCallback) {
|
|
1239
|
-
this.__emitOldNewComparison(code, incomingValue, store, variant);
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
if (config.inheritable) {
|
|
1243
|
-
code.push("var inherit=prop.$$inherit;");
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
1247
|
-
if (incomingValue) {
|
|
1248
|
-
this.__emitIncomingValueValidation(
|
|
1249
|
-
code,
|
|
1250
|
-
config,
|
|
1251
|
-
clazz,
|
|
1252
|
-
name,
|
|
1253
|
-
variant
|
|
1254
|
-
);
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
if (!hasCallback) {
|
|
1259
|
-
this.__emitStoreValue(code, name, variant, incomingValue);
|
|
1260
|
-
} else {
|
|
1261
|
-
this.__emitStoreComputedValue(
|
|
1262
|
-
code,
|
|
1263
|
-
config,
|
|
1264
|
-
name,
|
|
1265
|
-
variant,
|
|
1266
|
-
incomingValue
|
|
1267
|
-
);
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
if (config.inheritable) {
|
|
1271
|
-
this.__emitStoreInheritedPropertyValue(code, config, name, variant);
|
|
1272
|
-
} else if (hasCallback) {
|
|
1273
|
-
this.__emitNormalizeUndefinedValues(code, config, name, variant);
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
if (hasCallback) {
|
|
1277
|
-
// Emit callback and event firing; Refreshing children (5th parameter) requires the parent/children interface
|
|
1278
|
-
this.__emitCallCallback(
|
|
1279
|
-
code,
|
|
1280
|
-
config,
|
|
1281
|
-
name,
|
|
1282
|
-
variant,
|
|
1283
|
-
!!(config.inheritable && members._getChildren)
|
|
1284
|
-
);
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
// Return value
|
|
1288
|
-
if (incomingValue) {
|
|
1289
|
-
code.unshift("function set(value){");
|
|
1290
|
-
code.push("}");
|
|
1291
|
-
if (
|
|
1292
|
-
qx.core.Environment.get("qx.promise") &&
|
|
1293
|
-
(!config.check || config.check != "qx.Promise")
|
|
1294
|
-
) {
|
|
1295
|
-
code.push(
|
|
1296
|
-
"var promise;",
|
|
1297
|
-
"if (qx.Promise.isPromise(value)) ",
|
|
1298
|
-
"promise = value.then(set.bind(this));",
|
|
1299
|
-
"else ",
|
|
1300
|
-
"promise = set.apply(this, arguments);"
|
|
1301
|
-
);
|
|
1302
|
-
|
|
1303
|
-
if (variant == "setImpl") {
|
|
1304
|
-
code.push("return promise;");
|
|
1305
|
-
} else {
|
|
1306
|
-
code.push("return value;");
|
|
1307
|
-
}
|
|
1308
|
-
} else {
|
|
1309
|
-
code.push("set.apply(this, arguments);", "return value;");
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
return code;
|
|
1314
|
-
},
|
|
1315
|
-
|
|
1316
|
-
/**
|
|
1317
|
-
* Get the object to store the value for the given variant
|
|
1318
|
-
*
|
|
1319
|
-
* @param variant {String} Method variant.
|
|
1320
|
-
* @param name {String} name of the property
|
|
1321
|
-
*
|
|
1322
|
-
* @return {Object} the value store
|
|
1323
|
-
*/
|
|
1324
|
-
__getStore(variant, name) {
|
|
1325
|
-
if (variant === "setRuntime" || variant === "resetRuntime") {
|
|
1326
|
-
var store = this.$$store.runtime[name];
|
|
1327
|
-
} else if (variant === "setThemed" || variant === "resetThemed") {
|
|
1328
|
-
store = this.$$store.theme[name];
|
|
1329
|
-
} else if (variant === "init") {
|
|
1330
|
-
store = this.$$store.init[name];
|
|
1331
|
-
} else {
|
|
1332
|
-
store = this.$$store.user[name];
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
return store;
|
|
1336
|
-
},
|
|
1337
|
-
|
|
1338
|
-
/**
|
|
1339
|
-
* Emit code for the equality check evaluation
|
|
1340
|
-
*
|
|
1341
|
-
* @param code {String[]} String array to append the code to
|
|
1342
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1343
|
-
* @param config {Object} The property configuration map
|
|
1344
|
-
* @param name {String} name of the property
|
|
1345
|
-
*/
|
|
1346
|
-
__emitIsEqualFunction(code, clazz, config, name) {
|
|
1347
|
-
code.push("var equ=");
|
|
1348
|
-
|
|
1349
|
-
if (typeof config.isEqual === "function") {
|
|
1350
|
-
code.push(
|
|
1351
|
-
"function(a,b){return !!",
|
|
1352
|
-
clazz.classname,
|
|
1353
|
-
".$$properties.",
|
|
1354
|
-
name,
|
|
1355
|
-
".isEqual.call(this,a,b);};"
|
|
1356
|
-
);
|
|
1357
|
-
} else if (typeof config.isEqual === "string") {
|
|
1358
|
-
var members = clazz.prototype;
|
|
1359
|
-
// Name of member?
|
|
1360
|
-
if (members[config.isEqual] !== undefined) {
|
|
1361
|
-
code.push("this.", config.isEqual, ";");
|
|
1362
|
-
}
|
|
1363
|
-
// 'inline' code
|
|
1364
|
-
else {
|
|
1365
|
-
code.push("function(a,b){return !!(", config.isEqual, ");};");
|
|
1366
|
-
}
|
|
1367
|
-
} else if (typeof config.isEqual === "undefined") {
|
|
1368
|
-
code.push("function(a,b){return a===b;};");
|
|
1369
|
-
} else {
|
|
1370
|
-
throw new Error(
|
|
1371
|
-
"Invalid type for 'isEqual' attribute " +
|
|
1372
|
-
"of property '" +
|
|
1373
|
-
name +
|
|
1374
|
-
"' in class '" +
|
|
1375
|
-
clazz.classname +
|
|
1376
|
-
"'"
|
|
1377
|
-
);
|
|
1378
|
-
}
|
|
1379
|
-
},
|
|
1380
|
-
|
|
1381
|
-
/**
|
|
1382
|
-
* Emit code to check the arguments preconditions
|
|
1383
|
-
*
|
|
1384
|
-
* @param code {String[]} String array to append the code to
|
|
1385
|
-
* @param config {Object} The property configuration map
|
|
1386
|
-
* @param name {String} name of the property
|
|
1387
|
-
* @param variant {String} Method variant.
|
|
1388
|
-
* @param incomingValue {Boolean} Whether the setter has an incoming value
|
|
1389
|
-
*/
|
|
1390
|
-
__emitSetterPreConditions(code, config, name, variant, incomingValue) {
|
|
1391
|
-
if (qx.core.Environment.get("qx.debug")) {
|
|
1392
|
-
code.push("var prop=qx.core.Property;");
|
|
1393
|
-
|
|
1394
|
-
if (variant === "init") {
|
|
1395
|
-
code.push(
|
|
1396
|
-
'if(this.$$initialized)prop.error(this,0,"',
|
|
1397
|
-
name,
|
|
1398
|
-
'","',
|
|
1399
|
-
variant,
|
|
1400
|
-
'",value);'
|
|
1401
|
-
);
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
if (variant === "refresh") {
|
|
1405
|
-
// do nothing
|
|
1406
|
-
// refresh() is internal => no arguments test
|
|
1407
|
-
// also note that refresh() supports "undefined" values
|
|
1408
|
-
} else if (incomingValue) {
|
|
1409
|
-
// Check argument length
|
|
1410
|
-
code.push(
|
|
1411
|
-
'if(arguments.length!==1)prop.error(this,1,"',
|
|
1412
|
-
name,
|
|
1413
|
-
'","',
|
|
1414
|
-
variant,
|
|
1415
|
-
'",value);'
|
|
1416
|
-
);
|
|
1417
|
-
|
|
1418
|
-
// Undefined check
|
|
1419
|
-
code.push(
|
|
1420
|
-
'if(value===undefined)prop.error(this,2,"',
|
|
1421
|
-
name,
|
|
1422
|
-
'","',
|
|
1423
|
-
variant,
|
|
1424
|
-
'",value);'
|
|
1425
|
-
);
|
|
1426
|
-
} else {
|
|
1427
|
-
// Check argument length
|
|
1428
|
-
code.push(
|
|
1429
|
-
'if(arguments.length!==0)prop.error(this,3,"',
|
|
1430
|
-
name,
|
|
1431
|
-
'","',
|
|
1432
|
-
variant,
|
|
1433
|
-
'",value);'
|
|
1434
|
-
);
|
|
1435
|
-
}
|
|
1436
|
-
} else {
|
|
1437
|
-
if (!config.nullable || config.check || config.inheritable) {
|
|
1438
|
-
code.push("var prop=qx.core.Property;");
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
// Undefined check
|
|
1442
|
-
if (variant === "setImpl") {
|
|
1443
|
-
code.push(
|
|
1444
|
-
'if(value===undefined)prop.error(this,2,"',
|
|
1445
|
-
name,
|
|
1446
|
-
'","',
|
|
1447
|
-
variant,
|
|
1448
|
-
'",value);'
|
|
1449
|
-
);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
},
|
|
1453
|
-
|
|
1454
|
-
/**
|
|
1455
|
-
* Emit code to apply the "validate" and "transform" config keys.
|
|
1456
|
-
*
|
|
1457
|
-
* @param code {String[]} String array to append the code to
|
|
1458
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1459
|
-
* @param config {Object} The property configuration map
|
|
1460
|
-
* @param name {String} name of the property
|
|
1461
|
-
*/
|
|
1462
|
-
__emitIncomingValueTransformation(code, clazz, config, name) {
|
|
1463
|
-
// Call user-provided transform method, if one is provided. Transform
|
|
1464
|
-
// method should either throw an error or return the new value.
|
|
1465
|
-
if (config.transform) {
|
|
1466
|
-
code.push("value=this.", config.transform, "(value, old);");
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
// Call user-provided validate method, if one is provided. Validate
|
|
1470
|
-
// method should either throw an error or do nothing.
|
|
1471
|
-
if (config.validate) {
|
|
1472
|
-
// if it is a string
|
|
1473
|
-
if (typeof config.validate === "string") {
|
|
1474
|
-
code.push("this.", config.validate, "(value);");
|
|
1475
|
-
// if its a function otherwise
|
|
1476
|
-
} else if (config.validate instanceof Function) {
|
|
1477
|
-
code.push(clazz.classname, ".$$properties.", name);
|
|
1478
|
-
code.push(".validate.call(this, value);");
|
|
1479
|
-
}
|
|
1480
|
-
}
|
|
1481
|
-
},
|
|
1482
|
-
|
|
1483
|
-
/**
|
|
1484
|
-
* Emit code, which returns if the incoming value equals the current value.
|
|
1485
|
-
*
|
|
1486
|
-
* @param code {String[]} String array to append the code to
|
|
1487
|
-
* @param incomingValue {Boolean} Whether the setter has an incoming value
|
|
1488
|
-
* @param store {Object} The data store to use for the incoming value
|
|
1489
|
-
* @param variant {String} Method variant.
|
|
1490
|
-
*/
|
|
1491
|
-
__emitOldNewComparison(code, incomingValue, store, variant) {
|
|
1492
|
-
var resetValue =
|
|
1493
|
-
variant === "reset" ||
|
|
1494
|
-
variant === "resetThemed" ||
|
|
1495
|
-
variant === "resetRuntime";
|
|
1496
|
-
|
|
1497
|
-
if (incomingValue) {
|
|
1498
|
-
code.push("if(equ.call(this,this.", store, ",value))return value;");
|
|
1499
|
-
} else if (resetValue) {
|
|
1500
|
-
code.push("if(this.", store, "===undefined)return;");
|
|
1501
|
-
}
|
|
1502
|
-
},
|
|
1503
|
-
|
|
1504
|
-
/**
|
|
1505
|
-
* Emit code, which performs validation of the incoming value according to
|
|
1506
|
-
* the "nullable", "check" and "inheritable" config keys.
|
|
1507
|
-
*
|
|
1508
|
-
* @signature function(code, config, clazz, name, variant)
|
|
1509
|
-
* @param code {String[]} String array to append the code to
|
|
1510
|
-
* @param config {Object} The property configuration map
|
|
1511
|
-
* @param clazz {Class} the class which originally defined the property
|
|
1512
|
-
* @param name {String} name of the property
|
|
1513
|
-
* @param variant {String} Method variant.
|
|
1514
|
-
*/
|
|
1515
|
-
__emitIncomingValueValidation: qx.core.Environment.select("qx.debug", {
|
|
1516
|
-
true(code, config, clazz, name, variant) {
|
|
1517
|
-
// Null check
|
|
1518
|
-
if (!config.nullable) {
|
|
1519
|
-
code.push(
|
|
1520
|
-
'if(value===null)prop.error(this,4,"',
|
|
1521
|
-
name,
|
|
1522
|
-
'","',
|
|
1523
|
-
variant,
|
|
1524
|
-
'",value);'
|
|
1525
|
-
);
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
|
-
// Processing check definition
|
|
1529
|
-
if (config.check !== undefined) {
|
|
1530
|
-
code.push(
|
|
1531
|
-
"var msg = \"Invalid incoming value for property '" +
|
|
1532
|
-
name +
|
|
1533
|
-
"' of class '" +
|
|
1534
|
-
clazz.classname +
|
|
1535
|
-
"'\";"
|
|
1536
|
-
);
|
|
1537
|
-
|
|
1538
|
-
// Accept "null"
|
|
1539
|
-
if (config.nullable) {
|
|
1540
|
-
code.push("if(value!==null)");
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
// Inheritable properties always accept "inherit" as value
|
|
1544
|
-
if (config.inheritable) {
|
|
1545
|
-
code.push("if(value!==inherit)");
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
code.push("if(");
|
|
1549
|
-
|
|
1550
|
-
if (this.__checks[config.check] !== undefined) {
|
|
1551
|
-
code.push("!(", this.__checks[config.check], ")");
|
|
1552
|
-
} else if (qx.Class.isDefined(config.check)) {
|
|
1553
|
-
code.push(
|
|
1554
|
-
'qx.core.Assert.assertInstance(value, qx.Class.getByName("',
|
|
1555
|
-
config.check,
|
|
1556
|
-
'"), msg)'
|
|
1557
|
-
);
|
|
1558
|
-
} else if (qx.Interface && qx.Interface.isDefined(config.check)) {
|
|
1559
|
-
code.push(
|
|
1560
|
-
'qx.core.Assert.assertInterface(value, qx.Interface.getByName("',
|
|
1561
|
-
config.check,
|
|
1562
|
-
'"), msg)'
|
|
1563
|
-
);
|
|
1564
|
-
} else if (typeof config.check === "function") {
|
|
1565
|
-
code.push("!", clazz.classname, ".$$properties.", name);
|
|
1566
|
-
code.push(".check.call(this, value)");
|
|
1567
|
-
} else if (typeof config.check === "string") {
|
|
1568
|
-
code.push("!(", config.check, ")");
|
|
1569
|
-
} else if (config.check instanceof Array) {
|
|
1570
|
-
code.push(
|
|
1571
|
-
"qx.core.Assert.assertInArray(value, ",
|
|
1572
|
-
clazz.classname,
|
|
1573
|
-
".$$properties.",
|
|
1574
|
-
name,
|
|
1575
|
-
".check, msg)"
|
|
1576
|
-
);
|
|
1577
|
-
} else {
|
|
1578
|
-
throw new Error(
|
|
1579
|
-
"Could not add check to property " +
|
|
1580
|
-
name +
|
|
1581
|
-
" of class " +
|
|
1582
|
-
clazz.classname
|
|
1583
|
-
);
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
code.push(')prop.error(this,5,"', name, '","', variant, '",value);');
|
|
1587
|
-
}
|
|
1588
|
-
},
|
|
1589
|
-
|
|
1590
|
-
false: undefined
|
|
1591
|
-
}),
|
|
1592
|
-
|
|
1593
|
-
/**
|
|
1594
|
-
* Emit code to store the incoming value
|
|
1595
|
-
*
|
|
1596
|
-
* @param code {String[]} String array to append the code to
|
|
1597
|
-
* @param name {String} name of the property
|
|
1598
|
-
* @param variant {String} Method variant.
|
|
1599
|
-
* @param incomingValue {Boolean} Whether the setter has an incoming value
|
|
1600
|
-
*/
|
|
1601
|
-
__emitStoreValue(code, name, variant, incomingValue) {
|
|
1602
|
-
if (variant === "setRuntime") {
|
|
1603
|
-
code.push("this.", this.$$store.runtime[name], "=value;");
|
|
1604
|
-
} else if (variant === "resetRuntime") {
|
|
1605
|
-
code.push("if(this.", this.$$store.runtime[name], "!==undefined)");
|
|
1606
|
-
code.push("delete this.", this.$$store.runtime[name], ";");
|
|
1607
|
-
} else if (variant === "setImpl") {
|
|
1608
|
-
code.push("this.", this.$$store.user[name], "=value;");
|
|
1609
|
-
} else if (variant === "reset") {
|
|
1610
|
-
code.push("if(this.", this.$$store.user[name], "!==undefined)");
|
|
1611
|
-
code.push("delete this.", this.$$store.user[name], ";");
|
|
1612
|
-
} else if (variant === "setThemed") {
|
|
1613
|
-
code.push("this.", this.$$store.theme[name], "=value;");
|
|
1614
|
-
} else if (variant === "resetThemed") {
|
|
1615
|
-
code.push("if(this.", this.$$store.theme[name], "!==undefined)");
|
|
1616
|
-
code.push("delete this.", this.$$store.theme[name], ";");
|
|
1617
|
-
} else if (variant === "init" && incomingValue) {
|
|
1618
|
-
code.push("this.", this.$$store.init[name], "=value;");
|
|
1619
|
-
}
|
|
1620
|
-
},
|
|
1621
|
-
|
|
1622
|
-
/**
|
|
1623
|
-
* Emit code to store the incoming value and compute the "old" and "computed"
|
|
1624
|
-
* values.
|
|
1625
|
-
*
|
|
1626
|
-
* @param code {String[]} String array to append the code to
|
|
1627
|
-
* @param config {Object} The property configuration map
|
|
1628
|
-
* @param name {String} name of the property
|
|
1629
|
-
* @param variant {String} Method variant.
|
|
1630
|
-
* @param incomingValue {Boolean} Whether the setter has an incoming value
|
|
1631
|
-
*/
|
|
1632
|
-
__emitStoreComputedValue(code, config, name, variant, incomingValue) {
|
|
1633
|
-
code.push("var computed;");
|
|
1634
|
-
|
|
1635
|
-
// OLD = RUNTIME VALUE
|
|
1636
|
-
code.push("if(this.", this.$$store.runtime[name], "!==undefined){");
|
|
1637
|
-
|
|
1638
|
-
if (variant === "setRuntime") {
|
|
1639
|
-
// Replace it with new value
|
|
1640
|
-
code.push("computed=this.", this.$$store.runtime[name], "=value;");
|
|
1641
|
-
} else if (variant === "resetRuntime") {
|
|
1642
|
-
// Delete field
|
|
1643
|
-
code.push("delete this.", this.$$store.runtime[name], ";");
|
|
1644
|
-
|
|
1645
|
-
// Complex computation of new value
|
|
1646
|
-
code.push("if(this.", this.$$store.user[name], "!==undefined)");
|
|
1647
|
-
code.push("computed=this.", this.$$store.user[name], ";");
|
|
1648
|
-
code.push("else if(this.", this.$$store.theme[name], "!==undefined)");
|
|
1649
|
-
code.push("computed=this.", this.$$store.theme[name], ";");
|
|
1650
|
-
code.push("else if(this.", this.$$store.init[name], "!==undefined){");
|
|
1651
|
-
code.push("computed=this.", this.$$store.init[name], ";");
|
|
1652
|
-
code.push("this.", this.$$store.useinit[name], "=true;");
|
|
1653
|
-
code.push("}");
|
|
1654
|
-
} else {
|
|
1655
|
-
// Use runtime value as it has higher priority
|
|
1656
|
-
code.push("computed=this.", this.$$store.runtime[name], ";");
|
|
1657
|
-
|
|
1658
|
-
// Store incoming value
|
|
1659
|
-
if (variant === "setImpl") {
|
|
1660
|
-
code.push("this.", this.$$store.user[name], "=value;");
|
|
1661
|
-
} else if (variant === "reset") {
|
|
1662
|
-
code.push("delete this.", this.$$store.user[name], ";");
|
|
1663
|
-
} else if (variant === "setThemed") {
|
|
1664
|
-
code.push("this.", this.$$store.theme[name], "=value;");
|
|
1665
|
-
} else if (variant === "resetThemed") {
|
|
1666
|
-
code.push("delete this.", this.$$store.theme[name], ";");
|
|
1667
|
-
} else if (variant === "init" && incomingValue) {
|
|
1668
|
-
code.push("this.", this.$$store.init[name], "=value;");
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
code.push("}");
|
|
1673
|
-
|
|
1674
|
-
// OLD = USER VALUE
|
|
1675
|
-
code.push("else if(this.", this.$$store.user[name], "!==undefined){");
|
|
1676
|
-
|
|
1677
|
-
if (variant === "setImpl") {
|
|
1678
|
-
// Replace it with new value
|
|
1679
|
-
code.push("computed=this.", this.$$store.user[name], "=value;");
|
|
1680
|
-
} else if (variant === "reset") {
|
|
1681
|
-
// Delete field
|
|
1682
|
-
code.push("delete this.", this.$$store.user[name], ";");
|
|
1683
|
-
|
|
1684
|
-
// Complex computation of new value
|
|
1685
|
-
code.push("if(this.", this.$$store.runtime[name], "!==undefined)");
|
|
1686
|
-
code.push("computed=this.", this.$$store.runtime[name], ";");
|
|
1687
|
-
code.push("if(this.", this.$$store.theme[name], "!==undefined)");
|
|
1688
|
-
code.push("computed=this.", this.$$store.theme[name], ";");
|
|
1689
|
-
code.push("else if(this.", this.$$store.init[name], "!==undefined){");
|
|
1690
|
-
code.push("computed=this.", this.$$store.init[name], ";");
|
|
1691
|
-
code.push("this.", this.$$store.useinit[name], "=true;");
|
|
1692
|
-
code.push("}");
|
|
1693
|
-
} else {
|
|
1694
|
-
if (variant === "setRuntime") {
|
|
1695
|
-
// Use runtime value where it has higher priority
|
|
1696
|
-
code.push("computed=this.", this.$$store.runtime[name], "=value;");
|
|
1697
|
-
} else if (config.inheritable) {
|
|
1698
|
-
// Use user value where it has higher priority
|
|
1699
|
-
code.push("computed=this.", this.$$store.user[name], ";");
|
|
1700
|
-
} else {
|
|
1701
|
-
// Use user value where it has higher priority
|
|
1702
|
-
code.push("computed=this.", this.$$store.user[name], ";");
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
// Store incoming value
|
|
1706
|
-
if (variant === "setThemed") {
|
|
1707
|
-
code.push("this.", this.$$store.theme[name], "=value;");
|
|
1708
|
-
} else if (variant === "resetThemed") {
|
|
1709
|
-
code.push("delete this.", this.$$store.theme[name], ";");
|
|
1710
|
-
} else if (variant === "init" && incomingValue) {
|
|
1711
|
-
code.push("this.", this.$$store.init[name], "=value;");
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
code.push("}");
|
|
1716
|
-
|
|
1717
|
-
// OLD = THEMED VALUE
|
|
1718
|
-
if (config.themeable) {
|
|
1719
|
-
code.push("else if(this.", this.$$store.theme[name], "!==undefined){");
|
|
1720
|
-
|
|
1721
|
-
if (variant === "setRuntime") {
|
|
1722
|
-
code.push("computed=this.", this.$$store.runtime[name], "=value;");
|
|
1723
|
-
} else if (variant === "setImpl") {
|
|
1724
|
-
code.push("computed=this.", this.$$store.user[name], "=value;");
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
// reset() is impossible, because the user has higher priority than
|
|
1728
|
-
// the themed value, so the themed value has no chance to ever get used,
|
|
1729
|
-
// when there is an user value, too.
|
|
1730
|
-
else if (variant === "setThemed") {
|
|
1731
|
-
code.push("computed=this.", this.$$store.theme[name], "=value;");
|
|
1732
|
-
} else if (variant === "resetThemed") {
|
|
1733
|
-
// Delete entry
|
|
1734
|
-
code.push("delete this.", this.$$store.theme[name], ";");
|
|
1735
|
-
|
|
1736
|
-
// Fallback to init value
|
|
1737
|
-
code.push("if(this.", this.$$store.init[name], "!==undefined){");
|
|
1738
|
-
code.push("computed=this.", this.$$store.init[name], ";");
|
|
1739
|
-
code.push("this.", this.$$store.useinit[name], "=true;");
|
|
1740
|
-
code.push("}");
|
|
1741
|
-
} else if (variant === "init") {
|
|
1742
|
-
if (incomingValue) {
|
|
1743
|
-
code.push("this.", this.$$store.init[name], "=value;");
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
code.push("computed=this.", this.$$store.theme[name], ";");
|
|
1747
|
-
} else if (variant === "refresh") {
|
|
1748
|
-
code.push("computed=this.", this.$$store.theme[name], ";");
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
code.push("}");
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
// OLD = INIT VALUE
|
|
1755
|
-
code.push("else if(this.", this.$$store.useinit[name], "){");
|
|
1756
|
-
|
|
1757
|
-
if (variant === "init") {
|
|
1758
|
-
if (incomingValue) {
|
|
1759
|
-
code.push("computed=this.", this.$$store.init[name], "=value;");
|
|
1760
|
-
} else {
|
|
1761
|
-
code.push("computed=this.", this.$$store.init[name], ";");
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
// useinit flag is already initialized
|
|
1765
|
-
}
|
|
1766
|
-
|
|
1767
|
-
// reset(), resetRuntime() and resetStyle() are impossible, because the user and themed values have a
|
|
1768
|
-
// higher priority than the init value, so the init value has no chance to ever get used,
|
|
1769
|
-
// when there is an user or themed value, too.
|
|
1770
|
-
else if (
|
|
1771
|
-
variant === "setImpl" ||
|
|
1772
|
-
variant === "setRuntime" ||
|
|
1773
|
-
variant === "setThemed" ||
|
|
1774
|
-
variant === "refresh"
|
|
1775
|
-
) {
|
|
1776
|
-
code.push("delete this.", this.$$store.useinit[name], ";");
|
|
1777
|
-
|
|
1778
|
-
if (variant === "setRuntime") {
|
|
1779
|
-
code.push("computed=this.", this.$$store.runtime[name], "=value;");
|
|
1780
|
-
} else if (variant === "setImpl") {
|
|
1781
|
-
code.push("computed=this.", this.$$store.user[name], "=value;");
|
|
1782
|
-
} else if (variant === "setThemed") {
|
|
1783
|
-
code.push("computed=this.", this.$$store.theme[name], "=value;");
|
|
1784
|
-
} else if (variant === "refresh") {
|
|
1785
|
-
code.push("computed=this.", this.$$store.init[name], ";");
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
code.push("}");
|
|
1790
|
-
|
|
1791
|
-
// OLD = NONE
|
|
1792
|
-
|
|
1793
|
-
// reset(), resetRuntime() and resetStyle() are impossible because otherwise there
|
|
1794
|
-
// is already an old value
|
|
1795
|
-
if (
|
|
1796
|
-
variant === "setImpl" ||
|
|
1797
|
-
variant === "setRuntime" ||
|
|
1798
|
-
variant === "setThemed" ||
|
|
1799
|
-
variant === "init"
|
|
1800
|
-
) {
|
|
1801
|
-
code.push("else{");
|
|
1802
|
-
|
|
1803
|
-
if (variant === "setRuntime") {
|
|
1804
|
-
code.push("computed=this.", this.$$store.runtime[name], "=value;");
|
|
1805
|
-
} else if (variant === "setImpl") {
|
|
1806
|
-
code.push("computed=this.", this.$$store.user[name], "=value;");
|
|
1807
|
-
} else if (variant === "setThemed") {
|
|
1808
|
-
code.push("computed=this.", this.$$store.theme[name], "=value;");
|
|
1809
|
-
} else if (variant === "init") {
|
|
1810
|
-
if (incomingValue) {
|
|
1811
|
-
code.push("computed=this.", this.$$store.init[name], "=value;");
|
|
1812
|
-
} else {
|
|
1813
|
-
code.push("computed=this.", this.$$store.init[name], ";");
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
code.push("this.", this.$$store.useinit[name], "=true;");
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
// refresh() will work with the undefined value, later
|
|
1820
|
-
code.push("}");
|
|
1821
|
-
}
|
|
1822
|
-
},
|
|
1823
|
-
|
|
1824
|
-
/**
|
|
1825
|
-
* Emit code to compute the "old" value.
|
|
1826
|
-
*
|
|
1827
|
-
* @param code {String[]} String array to append the code to
|
|
1828
|
-
* @param config {Object} The property configuration map
|
|
1829
|
-
* @param name {String} name of the property
|
|
1830
|
-
*/
|
|
1831
|
-
__emitOldValue(code, config, name) {
|
|
1832
|
-
if (config.inheritable) {
|
|
1833
|
-
code.push("var old=this.", this.$$store.inherit[name], ";");
|
|
1834
|
-
} else {
|
|
1835
|
-
code.push("var old;");
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
// OLD = RUNTIME VALUE
|
|
1839
|
-
code.push("if(this.", this.$$store.runtime[name], "!==undefined){");
|
|
1840
|
-
code.push("old=this.", this.$$store.runtime[name], ";");
|
|
1841
|
-
code.push("}");
|
|
1842
|
-
|
|
1843
|
-
// OLD = USER VALUE
|
|
1844
|
-
if (!config.inheritable) {
|
|
1845
|
-
code.push("else if(this.", this.$$store.user[name], "!==undefined){");
|
|
1846
|
-
code.push("old=this.", this.$$store.user[name], ";");
|
|
1847
|
-
code.push("}");
|
|
1848
|
-
|
|
1849
|
-
// OLD = THEMED VALUE
|
|
1850
|
-
if (config.themeable) {
|
|
1851
|
-
code.push(
|
|
1852
|
-
"else if(this.",
|
|
1853
|
-
this.$$store.theme[name],
|
|
1854
|
-
"!==undefined){"
|
|
1855
|
-
);
|
|
1856
|
-
|
|
1857
|
-
code.push("old=this.", this.$$store.theme[name], ";");
|
|
1858
|
-
code.push("}");
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
// OLD = INIT VALUE
|
|
1862
|
-
code.push("else if(this.", this.$$store.useinit[name], "){");
|
|
1863
|
-
code.push("old=this.", this.$$store.init[name], ";");
|
|
1864
|
-
code.push("}");
|
|
1865
|
-
}
|
|
1866
|
-
},
|
|
1867
|
-
|
|
1868
|
-
/**
|
|
1869
|
-
* Emit code to store the value of an inheritable property
|
|
1870
|
-
*
|
|
1871
|
-
* @param code {String[]} String array to append the code to
|
|
1872
|
-
* @param config {Object} The property configuration map
|
|
1873
|
-
* @param name {String} name of the property
|
|
1874
|
-
* @param variant {String} Method variant.
|
|
1875
|
-
*/
|
|
1876
|
-
__emitStoreInheritedPropertyValue(code, config, name, variant) {
|
|
1877
|
-
code.push("if(computed===undefined||computed===inherit){");
|
|
1878
|
-
|
|
1879
|
-
if (variant === "refresh") {
|
|
1880
|
-
code.push("computed=value;");
|
|
1881
|
-
} else {
|
|
1882
|
-
code.push(
|
|
1883
|
-
"var pa=this.getLayoutParent();if(pa)computed=pa.",
|
|
1884
|
-
this.$$store.inherit[name],
|
|
1885
|
-
";"
|
|
1886
|
-
);
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
// Fallback to init value if inheritance was unsuccessful
|
|
1890
|
-
code.push("if((computed===undefined||computed===inherit)&&");
|
|
1891
|
-
code.push("this.", this.$$store.init[name], "!==undefined&&");
|
|
1892
|
-
code.push("this.", this.$$store.init[name], "!==inherit){");
|
|
1893
|
-
code.push("computed=this.", this.$$store.init[name], ";");
|
|
1894
|
-
code.push("this.", this.$$store.useinit[name], "=true;");
|
|
1895
|
-
code.push("}else{");
|
|
1896
|
-
code.push("delete this.", this.$$store.useinit[name], ";}");
|
|
1897
|
-
|
|
1898
|
-
code.push("}");
|
|
1899
|
-
|
|
1900
|
-
// Compare old/new computed value
|
|
1901
|
-
code.push("if(equ.call(this,old,computed))return value;");
|
|
1902
|
-
|
|
1903
|
-
// Note: At this point computed can be "inherit" or "undefined".
|
|
1904
|
-
|
|
1905
|
-
// Normalize "inherit" to undefined and delete inherited value
|
|
1906
|
-
code.push("if(computed===inherit){");
|
|
1907
|
-
code.push(
|
|
1908
|
-
"computed=undefined;delete this.",
|
|
1909
|
-
this.$$store.inherit[name],
|
|
1910
|
-
";"
|
|
1911
|
-
);
|
|
1912
|
-
|
|
1913
|
-
code.push("}");
|
|
1914
|
-
|
|
1915
|
-
// Only delete inherited value
|
|
1916
|
-
code.push("else if(computed===undefined)");
|
|
1917
|
-
code.push("delete this.", this.$$store.inherit[name], ";");
|
|
1918
|
-
|
|
1919
|
-
// Store inherited value
|
|
1920
|
-
code.push("else this.", this.$$store.inherit[name], "=computed;");
|
|
1921
|
-
|
|
1922
|
-
// Protect against normalization
|
|
1923
|
-
code.push("var backup=computed;");
|
|
1924
|
-
|
|
1925
|
-
// After storage finally normalize computed and old value
|
|
1926
|
-
if (config.init !== undefined && variant !== "init") {
|
|
1927
|
-
code.push("if(old===undefined)old=this.", this.$$store.init[name], ";");
|
|
1928
|
-
} else {
|
|
1929
|
-
code.push("if(old===undefined)old=null;");
|
|
1930
|
-
}
|
|
1931
|
-
code.push("if(computed===undefined||computed==inherit)computed=null;");
|
|
1932
|
-
},
|
|
1933
|
-
|
|
1934
|
-
/**
|
|
1935
|
-
* Emit code to normalize the old and incoming values from undefined to
|
|
1936
|
-
* <code>null</code>.
|
|
1937
|
-
*
|
|
1938
|
-
* @param code {String[]} String array to append the code to
|
|
1939
|
-
* @param config {Object} The property configuration map
|
|
1940
|
-
* @param name {String} name of the property
|
|
1941
|
-
* @param variant {String} Method variant.
|
|
1942
|
-
*/
|
|
1943
|
-
__emitNormalizeUndefinedValues(code, config, name, variant) {
|
|
1944
|
-
// Properties which are not inheritable have no possibility to get
|
|
1945
|
-
// undefined at this position. (Hint: set(), setRuntime() and setThemed() only allow non undefined values)
|
|
1946
|
-
if (
|
|
1947
|
-
variant !== "setImpl" &&
|
|
1948
|
-
variant !== "setRuntime" &&
|
|
1949
|
-
variant !== "setThemed"
|
|
1950
|
-
) {
|
|
1951
|
-
code.push("if(computed===undefined)computed=null;");
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
// Compare old/new computed value
|
|
1955
|
-
code.push("if(equ.call(this,old,computed))return value;");
|
|
1956
|
-
|
|
1957
|
-
// Normalize old value
|
|
1958
|
-
if (config.init !== undefined && variant !== "init") {
|
|
1959
|
-
code.push("if(old===undefined)old=this.", this.$$store.init[name], ";");
|
|
1960
|
-
} else {
|
|
1961
|
-
code.push("if(old===undefined)old=null;");
|
|
1962
|
-
}
|
|
1963
|
-
},
|
|
1964
|
-
|
|
1965
|
-
/**
|
|
1966
|
-
* Emit code to call the apply method and fire the change event
|
|
1967
|
-
*
|
|
1968
|
-
* @param code {String[]} String array to append the code to
|
|
1969
|
-
* @param config {Object} The property configuration map
|
|
1970
|
-
* @param name {String} name of the property
|
|
1971
|
-
* @param variant {String} variant of the method e.g. setThemed
|
|
1972
|
-
* @param refresh {Boolean} if true, emit code to update the inherited values of child objects
|
|
1973
|
-
*/
|
|
1974
|
-
__emitCallCallback(code, config, name, variant, refresh) {
|
|
1975
|
-
// Execute user configured setter
|
|
1976
|
-
code.push("var self=this;", "var promise;");
|
|
1977
|
-
if (config.apply) {
|
|
1978
|
-
code.push(
|
|
1979
|
-
"promise = this.",
|
|
1980
|
-
config.apply,
|
|
1981
|
-
'(computed, old, "',
|
|
1982
|
-
name,
|
|
1983
|
-
'", "',
|
|
1984
|
-
variant,
|
|
1985
|
-
'");'
|
|
1986
|
-
);
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
if (config.async) {
|
|
1990
|
-
code.push(
|
|
1991
|
-
"function fire() {",
|
|
1992
|
-
"var promiseData = qx.Promise.resolve(computed);",
|
|
1993
|
-
"var promise = promiseData;"
|
|
1994
|
-
);
|
|
1995
|
-
|
|
1996
|
-
// Fire event
|
|
1997
|
-
if (config.event) {
|
|
1998
|
-
code.push(
|
|
1999
|
-
"var reg=qx.event.Registration;",
|
|
2000
|
-
"if(reg.hasListener(self, '",
|
|
2001
|
-
config.event,
|
|
2002
|
-
"')) {",
|
|
2003
|
-
"promise = reg.fireEventAsync(self, '",
|
|
2004
|
-
config.event,
|
|
2005
|
-
"', qx.event.type.Data, [computed, old]",
|
|
2006
|
-
");",
|
|
2007
|
-
"promise = promise.then(function() { return computed; });",
|
|
2008
|
-
"}",
|
|
2009
|
-
"if(reg.hasListener(self, '",
|
|
2010
|
-
config.event,
|
|
2011
|
-
"Async'))",
|
|
2012
|
-
"promise = promise.then(function() {",
|
|
2013
|
-
"return reg.fireEventAsync(self, '",
|
|
2014
|
-
config.event,
|
|
2015
|
-
"Async', qx.event.type.Data, [promiseData, old]",
|
|
2016
|
-
");",
|
|
2017
|
-
"});"
|
|
2018
|
-
);
|
|
2019
|
-
}
|
|
2020
|
-
|
|
2021
|
-
// Emit code to update the inherited values of child objects
|
|
2022
|
-
if (refresh) {
|
|
2023
|
-
code.push(
|
|
2024
|
-
"var a=self._getChildren();",
|
|
2025
|
-
"if(a)",
|
|
2026
|
-
"for(var i=0,l=a.length;i<l;i++){",
|
|
2027
|
-
"if(a[i].",
|
|
2028
|
-
this.$$method.refresh[name],
|
|
2029
|
-
")",
|
|
2030
|
-
"a[i].",
|
|
2031
|
-
this.$$method.refresh[name],
|
|
2032
|
-
"(backup);",
|
|
2033
|
-
"}"
|
|
2034
|
-
);
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
code.push("return promise;", "}");
|
|
2038
|
-
} else {
|
|
2039
|
-
code.push("function fire() {", " var tracker={};");
|
|
2040
|
-
|
|
2041
|
-
// Fire event
|
|
2042
|
-
if (config.event) {
|
|
2043
|
-
code.push(
|
|
2044
|
-
"var reg=qx.event.Registration;",
|
|
2045
|
-
|
|
2046
|
-
"if(reg.hasListener(self, '",
|
|
2047
|
-
config.event,
|
|
2048
|
-
"'))",
|
|
2049
|
-
"qx.event.Utils.track(tracker, reg.fireEvent(self, '",
|
|
2050
|
-
config.event,
|
|
2051
|
-
"', qx.event.type.Data, [computed, old]",
|
|
2052
|
-
"));"
|
|
2053
|
-
);
|
|
2054
|
-
|
|
2055
|
-
if (qx.core.Environment.get("qx.promise")) {
|
|
2056
|
-
code.push(
|
|
2057
|
-
"if(reg.hasListener(self, '",
|
|
2058
|
-
config.event,
|
|
2059
|
-
"Async'))",
|
|
2060
|
-
"qx.event.Utils.then(tracker, function() {\n" +
|
|
2061
|
-
" return reg.fireEventAsync(self, '",
|
|
2062
|
-
config.event,
|
|
2063
|
-
"Async', qx.event.type.Data, [qx.Promise.resolve(computed), old]",
|
|
2064
|
-
");\n" + "});"
|
|
2065
|
-
);
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
// Emit code to update the inherited values of child objects
|
|
2069
|
-
if (refresh) {
|
|
2070
|
-
code.push(
|
|
2071
|
-
"var a=self._getChildren();",
|
|
2072
|
-
"if(a)",
|
|
2073
|
-
"for(var i=0,l=a.length;i<l;i++){",
|
|
2074
|
-
"if(a[i].",
|
|
2075
|
-
this.$$method.refresh[name],
|
|
2076
|
-
")",
|
|
2077
|
-
"a[i].",
|
|
2078
|
-
this.$$method.refresh[name],
|
|
2079
|
-
"(backup);",
|
|
2080
|
-
"}"
|
|
2081
|
-
);
|
|
2082
|
-
}
|
|
2083
|
-
|
|
2084
|
-
code.push(
|
|
2085
|
-
"if (tracker.promise)\n",
|
|
2086
|
-
" return tracker.promise.then(function() { return computed; });",
|
|
2087
|
-
"return computed;",
|
|
2088
|
-
"}"
|
|
2089
|
-
);
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
if (qx.core.Environment.get("qx.promise")) {
|
|
2093
|
-
code.push(
|
|
2094
|
-
"if(qx.Promise.isPromise(promise)) " + "return promise.then(fire); "
|
|
2095
|
-
);
|
|
2096
|
-
}
|
|
2097
|
-
code.push("return fire();");
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
});
|