@openui5/sap.ui.core 1.107.1 → 1.108.0
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/.dtsgenrc +63 -0
- package/THIRDPARTY.txt +1 -1
- package/package.json +1 -1
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/i18n/ResourceBundle.js +10 -0
- package/src/sap/base/security/URLListValidator.js +36 -3
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +2 -2
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/core/.library +50 -50
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/BusyIndicatorUtils.js +22 -8
- package/src/sap/ui/core/Component.js +21 -4
- package/src/sap/ui/core/ComponentContainer.js +5 -1
- package/src/sap/ui/core/ComponentMetadata.js +1 -1
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +2 -15
- package/src/sap/ui/core/Control.js +20 -2
- package/src/sap/ui/core/Core.js +311 -413
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +1 -1
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/FocusHandler.js +12 -14
- package/src/sap/ui/core/Fragment.js +5 -2
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IconPool.js +7 -1
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +1 -1
- package/src/sap/ui/core/LocaleData.js +1 -1
- package/src/sap/ui/core/Manifest.js +16 -83
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Popup.js +14 -4
- package/src/sap/ui/core/RenderManager.js +111 -109
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/ShortcutHintsMixin.js +20 -0
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +4 -2
- package/src/sap/ui/core/UIComponent.js +1 -1
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/_IconRegistry.js +11 -7
- package/src/sap/ui/core/_UrlResolver.js +139 -0
- package/src/sap/ui/core/date/CalendarUtils.js +87 -0
- package/src/sap/ui/core/date/CalendarWeekNumbering.js +73 -0
- package/src/sap/ui/core/date/UniversalDate.js +198 -74
- package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/DateFormat.js +187 -57
- package/src/sap/ui/core/format/NumberFormat.js +64 -23
- package/src/sap/ui/core/format/TimezoneUtil.js +3 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +19 -10
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +5 -3
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle_fr.properties +1 -1
- package/src/sap/ui/core/mvc/HTMLView.js +10 -2
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +1 -1
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +21 -20
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +1 -1
- package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
- package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +3 -3
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/theming/Parameters.js +31 -12
- package/src/sap/ui/core/theming/ThemeHelper.js +56 -1
- package/src/sap/ui/core/theming/ThemeManager.js +817 -0
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +2 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/dom/getFirstEditableInput.js +25 -6
- package/src/sap/ui/dom/includeStylesheet.js +2 -2
- package/src/sap/ui/model/ClientListBinding.js +11 -4
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/ClientTreeBinding.js +60 -5
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/Filter.js +6 -6
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +1 -1
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/Sorter.js +6 -4
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/TreeBinding.js +18 -0
- package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +28 -34
- package/src/sap/ui/model/controlhelper/TreeBindingProxy.js +590 -0
- package/src/sap/ui/model/json/JSONModel.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/BatchMode.js +2 -2
- package/src/sap/ui/model/odata/v2/Context.js +169 -4
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +39 -17
- package/src/sap/ui/model/odata/v2/ODataModel.js +219 -82
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +35 -22
- package/src/sap/ui/model/odata/v4/ODataBinding.js +28 -22
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +6 -6
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +111 -89
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +5 -4
- package/src/sap/ui/model/odata/v4/ODataModel.js +84 -46
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +19 -20
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -3
- package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +12 -5
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +130 -64
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +56 -15
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/TestUtils.js +20 -0
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/thirdparty/mobify-carousel.js +0 -4
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/sap/ui/core/ThemeCheck.js +0 -389
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define(["sap/base/assert"], function (assert) {
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Proxy for tree controls, such as <code>sap.ui.table.TreeTable</code>
|
|
11
|
+
* or <code>sap.m.Tree</code>.
|
|
12
|
+
* Provides proxy methods for binding methods, which can act differently in different
|
|
13
|
+
* binding types.
|
|
14
|
+
* Enables the usage of OData V4 bindings in tree controls.
|
|
15
|
+
*
|
|
16
|
+
* @class
|
|
17
|
+
*
|
|
18
|
+
* @param {sap.ui.core.Control} oControl control instance
|
|
19
|
+
* @param {string} sAggregation aggregation name to be applied to, e.g. in TreeTable "rows"
|
|
20
|
+
*
|
|
21
|
+
* @private
|
|
22
|
+
* @ui5-restricted sap.m.Tree, sap.ui.table.TreeTable
|
|
23
|
+
*/
|
|
24
|
+
var TreeBindingProxy = function (oControl, sAggregation) {
|
|
25
|
+
this._oControl = oControl;
|
|
26
|
+
this._sAggregation = sAggregation;
|
|
27
|
+
var oParams = new URLSearchParams(window.location.search);
|
|
28
|
+
this._bEnableV4 = oParams.get("sap-ui-xx-v4tree") === "true";
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Determines whether the control's binding is a tree binding.
|
|
33
|
+
* @returns {boolean} Whether binding is a tree binding. OData V4 bindings
|
|
34
|
+
* are list bindings even in Tree or TreeTable cases, therefore the method will
|
|
35
|
+
* always return <code>false</code>, if the binding is a OData V4 binding.
|
|
36
|
+
*/
|
|
37
|
+
TreeBindingProxy.prototype.isTreeBinding = function () {
|
|
38
|
+
var oModel = this._oControl.getModel(
|
|
39
|
+
this._oControl.getBindingInfo(this._sAggregation).model);
|
|
40
|
+
if (oModel.isA("sap.ui.model.odata.v4.ODataModel")) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return true;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Determines whether the node with the given index is a leaf.
|
|
49
|
+
* @param {int} iIndex Index of the node
|
|
50
|
+
* @returns {boolean} Leaf state. If the binding is undefined, the method
|
|
51
|
+
* will return <code>true</code>.
|
|
52
|
+
*/
|
|
53
|
+
TreeBindingProxy.prototype.isLeaf = function (iIndex) {
|
|
54
|
+
var oBinding = this._oControl.getBinding();
|
|
55
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
56
|
+
|
|
57
|
+
switch (sTreeBinding) {
|
|
58
|
+
case undefined:
|
|
59
|
+
return true;
|
|
60
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
61
|
+
if (!this._bEnableV4) {
|
|
62
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
63
|
+
}
|
|
64
|
+
var oContext = this.getContextByIndex(iIndex);
|
|
65
|
+
return oContext
|
|
66
|
+
? oContext.getProperty("@$ui5.node.isExpanded") === undefined
|
|
67
|
+
: true;
|
|
68
|
+
default:
|
|
69
|
+
var oNode = this.getNodeByIndex(iIndex);
|
|
70
|
+
return !oBinding.nodeHasChildren(oNode);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves a node object by an index.
|
|
76
|
+
* @param {int} iIndex Index of the node
|
|
77
|
+
* @returns {undefined|sap.ui.model.Context|object} Returns <code>undefined</code>
|
|
78
|
+
* if no binding is given, a binding context if the binding is a OData V4 binding
|
|
79
|
+
* and by default a node object.
|
|
80
|
+
*/
|
|
81
|
+
TreeBindingProxy.prototype.getNodeByIndex = function(iIndex) {
|
|
82
|
+
var oBinding = this._oControl.getBinding();
|
|
83
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
84
|
+
|
|
85
|
+
switch (sTreeBinding) {
|
|
86
|
+
case undefined:
|
|
87
|
+
return undefined;
|
|
88
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
89
|
+
if (!this._bEnableV4) {
|
|
90
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
91
|
+
}
|
|
92
|
+
return this.getContextByIndex(iIndex);
|
|
93
|
+
default:
|
|
94
|
+
return oBinding.getNodeByIndex(iIndex);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves the context of a node by an index.
|
|
100
|
+
* @param {int} iIndex Index of the node
|
|
101
|
+
* @returns {undefined|sap.ui.model.Context} Binding context of the node or undefined
|
|
102
|
+
* if no binding exists
|
|
103
|
+
*/
|
|
104
|
+
TreeBindingProxy.prototype.getContextByIndex = function (iIndex) {
|
|
105
|
+
var oBinding = this._oControl.getBinding();
|
|
106
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
107
|
+
|
|
108
|
+
switch (sTreeBinding) {
|
|
109
|
+
case undefined:
|
|
110
|
+
return undefined;
|
|
111
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
112
|
+
if (!this._bEnableV4) {
|
|
113
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
114
|
+
}
|
|
115
|
+
return oBinding.getContexts(iIndex, 1, 0, true)[0];
|
|
116
|
+
default:
|
|
117
|
+
return oBinding.getContextByIndex(iIndex);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Returns the expansion state of a node.
|
|
123
|
+
* @param {int} iIndex Index of the node
|
|
124
|
+
* @returns {boolean} Always returns <code>false</code> if binding is undefined,
|
|
125
|
+
* otherwise returns the expansion state.
|
|
126
|
+
*/
|
|
127
|
+
TreeBindingProxy.prototype.isExpanded = function (iIndex) {
|
|
128
|
+
var oBinding = this._oControl.getBinding();
|
|
129
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
130
|
+
|
|
131
|
+
switch (sTreeBinding) {
|
|
132
|
+
case undefined:
|
|
133
|
+
return false;
|
|
134
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
135
|
+
if (!this._bEnableV4) {
|
|
136
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
137
|
+
}
|
|
138
|
+
var oContext = this.getContextByIndex(iIndex);
|
|
139
|
+
return oContext ? !!oContext.getProperty("@$ui5.node.isExpanded") : false;
|
|
140
|
+
default:
|
|
141
|
+
return oBinding ? oBinding.isExpanded(iIndex) : false;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Expands the nodes for the given indices.
|
|
147
|
+
* @param {int|int[]} vIndices A single index, or an array of indices
|
|
148
|
+
* of the nodes to be expanded
|
|
149
|
+
*/
|
|
150
|
+
TreeBindingProxy.prototype.expand = function (vIndices) {
|
|
151
|
+
var oBinding = this._oControl.getBinding();
|
|
152
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
153
|
+
var mSettings = {
|
|
154
|
+
proxy: this,
|
|
155
|
+
binding: oBinding,
|
|
156
|
+
indices: vIndices,
|
|
157
|
+
expanded: true
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
if (typeof mSettings.indices === "number") {
|
|
161
|
+
mSettings.indices = [vIndices];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
switch (sTreeBinding) {
|
|
165
|
+
case undefined:
|
|
166
|
+
break;
|
|
167
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
168
|
+
if (!this._bEnableV4) {
|
|
169
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
170
|
+
}
|
|
171
|
+
changeExpandedStateV4(mSettings);
|
|
172
|
+
break;
|
|
173
|
+
default:
|
|
174
|
+
changeExpandedStatePreV4(mSettings);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Collapses the nodes for the given indices.
|
|
180
|
+
* @param {int|int[]} vIndices A single index, or an array of indices of the nodes
|
|
181
|
+
* to be collapsed
|
|
182
|
+
*/
|
|
183
|
+
TreeBindingProxy.prototype.collapse = function (vIndices) {
|
|
184
|
+
var oBinding = this._oControl.getBinding();
|
|
185
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
186
|
+
var mSettings = {
|
|
187
|
+
proxy: this,
|
|
188
|
+
binding: oBinding,
|
|
189
|
+
indices: vIndices,
|
|
190
|
+
expanded: false
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
if (typeof mSettings.indices === "number") {
|
|
194
|
+
mSettings.indices = [vIndices];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
switch (sTreeBinding) {
|
|
198
|
+
case undefined:
|
|
199
|
+
break;
|
|
200
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
201
|
+
if (!this._bEnableV4) {
|
|
202
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
203
|
+
}
|
|
204
|
+
changeExpandedStateV4(mSettings);
|
|
205
|
+
break;
|
|
206
|
+
default:
|
|
207
|
+
changeExpandedStatePreV4(mSettings);
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Changes the expansion state for "older" bindings, such as ODataV2, ODataV1, etc.
|
|
213
|
+
* @param {object} mSettings settings object
|
|
214
|
+
* @param {object} mSettings.proxy proxy object
|
|
215
|
+
* @param {sap.ui.model.Binding} mSettings.binding binding
|
|
216
|
+
* @param {int|int[]} mSettings.indices A single index, or an array of indices
|
|
217
|
+
* of the to be changed nodes
|
|
218
|
+
* @param {boolean} mSettings.expanded If true, state will be changed to
|
|
219
|
+
* expanded otherwise to collapsed.
|
|
220
|
+
*/
|
|
221
|
+
function changeExpandedStatePreV4(mSettings) {
|
|
222
|
+
// Operations need to be performed from the highest index to the lowest.
|
|
223
|
+
// This ensures correct results with ODataV2 bindings. The indices
|
|
224
|
+
// are sorted ascending, so the array is iterated backwards.
|
|
225
|
+
|
|
226
|
+
var aValidSortedIndices = mSettings.indices.filter(function(iIndex) {
|
|
227
|
+
// Only indices of existing, expandable/collapsible nodes must be considered.
|
|
228
|
+
// Otherwise there might be no change event on the final
|
|
229
|
+
// expand/collapse (Client + ODataV2).
|
|
230
|
+
return iIndex >= 0
|
|
231
|
+
&& iIndex < mSettings.binding.getLength()
|
|
232
|
+
&& !mSettings.proxy.isLeaf(iIndex)
|
|
233
|
+
&& mSettings.expanded !== mSettings.proxy.isExpanded(iIndex);
|
|
234
|
+
}).sort(function(a, b) { return a - b; });
|
|
235
|
+
|
|
236
|
+
if (aValidSortedIndices.length === 0) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Expand/Collapse all nodes except the first, and suppress the change event.
|
|
241
|
+
for (var i = aValidSortedIndices.length - 1; i > 0; i--) {
|
|
242
|
+
if (mSettings.expanded) {
|
|
243
|
+
mSettings.binding.expand(aValidSortedIndices[i], true);
|
|
244
|
+
} else {
|
|
245
|
+
mSettings.binding.collapse(aValidSortedIndices[i], true);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Expand/Collapse the first node without suppressing the change event.
|
|
250
|
+
if (mSettings.expanded) {
|
|
251
|
+
mSettings.binding.expand(aValidSortedIndices[0], false);
|
|
252
|
+
} else {
|
|
253
|
+
mSettings.binding.collapse(aValidSortedIndices[0], false);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Changes the expansion state for ODataV4 bindings.
|
|
259
|
+
* @param {object} mSettings settings object
|
|
260
|
+
* @param {object} mSettings.proxy proxy object
|
|
261
|
+
* @param {sap.ui.model.Binding} mSettings.binding binding
|
|
262
|
+
* @param {int|int[]} mSettings.indices A single index, or an array of indices of
|
|
263
|
+
* the to be changed nodes
|
|
264
|
+
* @param {boolean} mSettings.expanded If true, state will be changed to expanded
|
|
265
|
+
* otherwise to collapsed.
|
|
266
|
+
*/
|
|
267
|
+
function changeExpandedStateV4(mSettings) {
|
|
268
|
+
for (var i = 0; i < mSettings.indices.length; i++) {
|
|
269
|
+
var oContext = mSettings.proxy.getContextByIndex(mSettings.indices[i]);
|
|
270
|
+
|
|
271
|
+
if (oContext) {
|
|
272
|
+
if (mSettings.expanded) {
|
|
273
|
+
oContext.expand();
|
|
274
|
+
} else {
|
|
275
|
+
oContext.collapse();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Toggles the expansion state for the given node index.
|
|
283
|
+
* @param {int} iIndex Index of the node
|
|
284
|
+
*/
|
|
285
|
+
TreeBindingProxy.prototype.toggleExpandedState = function (iIndex) {
|
|
286
|
+
if (this.isExpanded(iIndex)) {
|
|
287
|
+
this.collapse(iIndex);
|
|
288
|
+
} else {
|
|
289
|
+
this.expand(iIndex);
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Retrieves the contexts for a given range.
|
|
295
|
+
* @param {int} iStartIndex start index
|
|
296
|
+
* @param {int} iLength length to retrieve
|
|
297
|
+
* @param {int} iThreshold threshold
|
|
298
|
+
* @returns {sap.ui.model.Context[]|object[]} Returns empty array if binding is
|
|
299
|
+
* <code>undefined</code>, list of contexts in OData V4 case or by default an array
|
|
300
|
+
* of node objects.
|
|
301
|
+
*/
|
|
302
|
+
TreeBindingProxy.prototype.getContexts = function(iStartIndex, iLength, iThreshold,
|
|
303
|
+
bKeepCurrent) {
|
|
304
|
+
var oBinding = this._oControl.getBinding();
|
|
305
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
306
|
+
var aContexts = [];
|
|
307
|
+
var iLevelOffset = 0;
|
|
308
|
+
|
|
309
|
+
switch (sTreeBinding) {
|
|
310
|
+
case undefined:
|
|
311
|
+
break;
|
|
312
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
313
|
+
if (!this._bEnableV4) {
|
|
314
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
315
|
+
}
|
|
316
|
+
aContexts = oBinding.getContexts(iStartIndex, iLength, iThreshold, bKeepCurrent);
|
|
317
|
+
break;
|
|
318
|
+
default:
|
|
319
|
+
iLevelOffset = 1;
|
|
320
|
+
var aNodes = oBinding ? oBinding.getNodes(iStartIndex, iLength, iThreshold) : [];
|
|
321
|
+
aNodes.forEach(function (oNode) {
|
|
322
|
+
var oContext = oNode.context;
|
|
323
|
+
if (oNode.context) {
|
|
324
|
+
if (oNode.nodeState) {
|
|
325
|
+
oContext["_mProxyInfo"] = {};
|
|
326
|
+
oContext["_mProxyInfo"].nodeState = oNode.nodeState;
|
|
327
|
+
}
|
|
328
|
+
aContexts.push(oNode.context);
|
|
329
|
+
}
|
|
330
|
+
}, this);
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
for (var i = 0; i < aContexts.length; i++) {
|
|
335
|
+
var iIndex = i + iStartIndex;
|
|
336
|
+
var oContext = aContexts[i];
|
|
337
|
+
|
|
338
|
+
if (!oContext) {
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (!oContext["_mProxyInfo"]) {
|
|
343
|
+
oContext["_mProxyInfo"] = {};
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
oContext["_mProxyInfo"].level = this.getLevel(iIndex) + iLevelOffset;
|
|
347
|
+
oContext["_mProxyInfo"].isLeaf = this.isLeaf(iIndex);
|
|
348
|
+
oContext["_mProxyInfo"].isExpanded = this.isExpanded(iIndex);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
return aContexts;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Collapses all nodes.
|
|
356
|
+
*/
|
|
357
|
+
TreeBindingProxy.prototype.collapseAll = function () {
|
|
358
|
+
var oBinding = this._oControl.getBinding();
|
|
359
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
360
|
+
|
|
361
|
+
switch (sTreeBinding) {
|
|
362
|
+
case undefined:
|
|
363
|
+
break;
|
|
364
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
365
|
+
if (!this._bEnableV4) {
|
|
366
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
367
|
+
}
|
|
368
|
+
throw Error("Collapsing all nodes is not supported with your current binding.");
|
|
369
|
+
default:
|
|
370
|
+
oBinding.collapseToLevel(0);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Expands the tree to the given level.
|
|
376
|
+
* @param {int} iLevel target level
|
|
377
|
+
*/
|
|
378
|
+
TreeBindingProxy.prototype.expandToLevel = function (iLevel) {
|
|
379
|
+
var oBinding = this._oControl.getBinding();
|
|
380
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
381
|
+
|
|
382
|
+
switch (sTreeBinding) {
|
|
383
|
+
case undefined:
|
|
384
|
+
break;
|
|
385
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
386
|
+
if (!this._bEnableV4) {
|
|
387
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
388
|
+
}
|
|
389
|
+
throw Error("Expanding all nodes to a certain level is not supported with"
|
|
390
|
+
+ " your current binding.");
|
|
391
|
+
default:
|
|
392
|
+
if (oBinding.expandToLevel) {
|
|
393
|
+
oBinding.expandToLevel(iLevel);
|
|
394
|
+
} else {
|
|
395
|
+
assert(oBinding.expandToLevel, "Expanding all nodes to a certain level"
|
|
396
|
+
+ " is not supported with your current binding.");
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Sets the root level.
|
|
403
|
+
* @param {int} iRootLevel root level
|
|
404
|
+
*/
|
|
405
|
+
TreeBindingProxy.prototype.setRootLevel = function(iRootLevel) {
|
|
406
|
+
var oBinding = this._oControl.getBinding();
|
|
407
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
408
|
+
|
|
409
|
+
switch (sTreeBinding) {
|
|
410
|
+
case undefined:
|
|
411
|
+
break;
|
|
412
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
413
|
+
if (!this._bEnableV4) {
|
|
414
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
415
|
+
}
|
|
416
|
+
throw Error("Setting the root level is not supported with your current binding.");
|
|
417
|
+
default:
|
|
418
|
+
if (oBinding.setRootLevel) {
|
|
419
|
+
oBinding.setRootLevel(iRootLevel);
|
|
420
|
+
} else {
|
|
421
|
+
assert(oBinding.setRootLevel, "Setting the root level is not supported with"
|
|
422
|
+
+ " your current binding.");
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Sets recursive collapse.
|
|
429
|
+
* @param {boolean} bCollapseRecursive collapseRecursive
|
|
430
|
+
*/
|
|
431
|
+
TreeBindingProxy.prototype.setCollapseRecursive = function(bCollapseRecursive) {
|
|
432
|
+
var oBinding = this._oControl.getBinding();
|
|
433
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
434
|
+
|
|
435
|
+
switch (sTreeBinding) {
|
|
436
|
+
case undefined:
|
|
437
|
+
break;
|
|
438
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
439
|
+
if (!this._bEnableV4) {
|
|
440
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
441
|
+
}
|
|
442
|
+
throw Error("Setting 'collapseRecursive' is not supported with your"
|
|
443
|
+
+ " current binding.");
|
|
444
|
+
default:
|
|
445
|
+
if (oBinding.setCollapseRecursive) {
|
|
446
|
+
oBinding.setCollapseRecursive(bCollapseRecursive);
|
|
447
|
+
} else {
|
|
448
|
+
assert(oBinding.setCollapseRecursive, "Setting 'collapseRecursive' is"
|
|
449
|
+
+ " not supported with your current binding.");
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Retrieves the level for a given index of a node.
|
|
456
|
+
* @param {int} iIndex Index of the node
|
|
457
|
+
* @returns {int} level
|
|
458
|
+
*/
|
|
459
|
+
TreeBindingProxy.prototype.getLevel = function (iIndex) {
|
|
460
|
+
var oBinding = this._oControl.getBinding();
|
|
461
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
462
|
+
|
|
463
|
+
switch (sTreeBinding) {
|
|
464
|
+
case undefined:
|
|
465
|
+
return undefined;
|
|
466
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
467
|
+
if (!this._bEnableV4) {
|
|
468
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
469
|
+
}
|
|
470
|
+
var oContext = this.getContextByIndex(iIndex);
|
|
471
|
+
return oContext ? oContext.getProperty("@$ui5.node.level") : undefined;
|
|
472
|
+
default:
|
|
473
|
+
var oNode = this.getNodeByIndex(iIndex);
|
|
474
|
+
return oNode ? oNode.level : undefined;
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Retrieves the amount of siblings for the given index of the node.
|
|
480
|
+
* @param {int} iIndex Index of the node
|
|
481
|
+
* @returns {int} Sibling count. If binding is undefined returns 0.
|
|
482
|
+
* In ODataV4 case will throw an error.
|
|
483
|
+
*/
|
|
484
|
+
TreeBindingProxy.prototype.getSiblingCount = function(iIndex) {
|
|
485
|
+
var oBinding = this._oControl.getBinding();
|
|
486
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
487
|
+
|
|
488
|
+
switch (sTreeBinding) {
|
|
489
|
+
case undefined:
|
|
490
|
+
return 0;
|
|
491
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
492
|
+
if (!this._bEnableV4) {
|
|
493
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
494
|
+
}
|
|
495
|
+
throw Error("The number of siblings of a node cannot be determined"
|
|
496
|
+
+ " with your current binding.");
|
|
497
|
+
default:
|
|
498
|
+
var oNode = this.getNodeByIndex(iIndex);
|
|
499
|
+
return oNode && oNode.parent ? oNode.parent.children.length : 0;
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Retrieves the position of a node in the parent.
|
|
505
|
+
* @param {int} iIndex Index of the node
|
|
506
|
+
* @returns Position in parent. If binding is undefined returns -1.
|
|
507
|
+
* In ODataV4 case will throw an error.
|
|
508
|
+
*/
|
|
509
|
+
TreeBindingProxy.prototype.getPositionInParent = function(iIndex) {
|
|
510
|
+
var oBinding = this._oControl.getBinding();
|
|
511
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
512
|
+
|
|
513
|
+
switch (sTreeBinding) {
|
|
514
|
+
case undefined:
|
|
515
|
+
return -1;
|
|
516
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
517
|
+
if (!this._bEnableV4) {
|
|
518
|
+
throw new Error("UnsupportedOperationException: OData V4 is not supported");
|
|
519
|
+
}
|
|
520
|
+
throw Error("The position of a node in its parent cannot be determined"
|
|
521
|
+
+ " with your current binding.");
|
|
522
|
+
default:
|
|
523
|
+
var oNode = this.getNodeByIndex(iIndex);
|
|
524
|
+
return oNode ? oNode.positionInParent : -1;
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Checks if the selection is supported.
|
|
530
|
+
* @returns {boolean} Selection support
|
|
531
|
+
*
|
|
532
|
+
* Note: If the binding is either undefined or an ODataV4 binding, selection is not supported.
|
|
533
|
+
*/
|
|
534
|
+
TreeBindingProxy.prototype.isSelectionSupported = function() {
|
|
535
|
+
var oBinding = this._oControl.getBinding();
|
|
536
|
+
var sTreeBinding = this._getBindingName(oBinding);
|
|
537
|
+
|
|
538
|
+
switch (sTreeBinding) {
|
|
539
|
+
case undefined:
|
|
540
|
+
case "sap.ui.model.odata.v4.ODataListBinding":
|
|
541
|
+
return false;
|
|
542
|
+
default:
|
|
543
|
+
return true;
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Applies legacy settings to the binding information. Only applicable for pre-ODataV4
|
|
549
|
+
* bindings.
|
|
550
|
+
* @param {object} oBindingInfo binding infos
|
|
551
|
+
* @param {object} mLegacySettings settings object
|
|
552
|
+
* @param {int} mLegacySettings.rootLevel root level
|
|
553
|
+
* @param {object} mLegacySettings.collapseRecursive collapse recursive
|
|
554
|
+
* @param {object} mLegacySettings.numberOfExpandedLevels number of expanded levels
|
|
555
|
+
*/
|
|
556
|
+
TreeBindingProxy.prototype.applyLegacySettingsToBindingInfo = function(oBindingInfo,
|
|
557
|
+
mLegacySettings) {
|
|
558
|
+
if (!oBindingInfo.parameters) {
|
|
559
|
+
oBindingInfo.parameters = {};
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (!("rootLevel" in oBindingInfo.parameters)
|
|
563
|
+
&& mLegacySettings.rootLevel !== undefined) {
|
|
564
|
+
oBindingInfo.parameters.rootLevel = mLegacySettings.rootLevel;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
if (!("collapseRecursive" in oBindingInfo.parameters)
|
|
568
|
+
&& mLegacySettings.collapseRecursive !== undefined) {
|
|
569
|
+
oBindingInfo.parameters.collapseRecursive = mLegacySettings.collapseRecursive;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
if (!("numberOfExpandedLevels" in oBindingInfo.parameters)
|
|
573
|
+
&& mLegacySettings.numberOfExpandedLevels !== undefined) {
|
|
574
|
+
oBindingInfo.parameters.numberOfExpandedLevels
|
|
575
|
+
= mLegacySettings.numberOfExpandedLevels;
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Retrieves the binding name for a given binding.
|
|
581
|
+
* @param {sap.ui.model.Binding} oBinding binding object
|
|
582
|
+
* @returns {string|undefined} Name of the binding or undefined if the binding does not exist.
|
|
583
|
+
*/
|
|
584
|
+
TreeBindingProxy.prototype._getBindingName = function (oBinding) {
|
|
585
|
+
assert(oBinding, "Control does not have a binding.");
|
|
586
|
+
return oBinding ? oBinding.getMetadata().getName() : undefined;
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
return TreeBindingProxy;
|
|
590
|
+
});
|
|
@@ -29,7 +29,7 @@ sap.ui.define(['sap/ui/model/BindingMode', 'sap/ui/model/ClientModel', 'sap/ui/m
|
|
|
29
29
|
* @extends sap.ui.model.ClientModel
|
|
30
30
|
*
|
|
31
31
|
* @author SAP SE
|
|
32
|
-
* @version 1.
|
|
32
|
+
* @version 1.108.0
|
|
33
33
|
*
|
|
34
34
|
* @param {sap.ui.core.message.MessageManager} oMessageManager The MessageManager instance
|
|
35
35
|
* @public
|
|
@@ -61,7 +61,7 @@ sap.ui.define([
|
|
|
61
61
|
* @extends sap.ui.model.type.Currency
|
|
62
62
|
* @public
|
|
63
63
|
* @since 1.63.0
|
|
64
|
-
* @version 1.
|
|
64
|
+
* @version 1.108.0
|
|
65
65
|
*/
|
|
66
66
|
var Currency = BaseCurrency.extend("sap.ui.model.odata.type.Currency", {
|
|
67
67
|
constructor : function (oFormatOptions, oConstraints) {
|