@magic-xpa/engine 4.1100.0-dev4110.23 → 4.1100.0-dev4110.236
Sign up to get free protection for your applications and to get access to all the features.
- package/{esm2020 → esm2022}/index.mjs +188 -188
- package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
- package/esm2022/src/AccessHelper.mjs +15 -0
- package/esm2022/src/ClientManager.mjs +416 -0
- package/esm2022/src/CommandsProcessorBase.mjs +56 -0
- package/esm2022/src/CommandsProcessorManager.mjs +26 -0
- package/esm2022/src/CommandsTable.mjs +162 -0
- package/esm2022/src/ConstInterface.mjs +517 -0
- package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
- package/esm2022/src/FlowMonitorInterface.mjs +16 -0
- package/esm2022/src/GUIManager.mjs +62 -0
- package/esm2022/src/GlobalCommandsManager.mjs +34 -0
- package/esm2022/src/GuiEventsProcessor.mjs +156 -0
- package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
- package/esm2022/src/ServerConfig.mjs +122 -0
- package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
- package/esm2022/src/bridge/MagicBridge.mjs +41 -0
- package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/BrowserEscEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
- package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ColumnSortEventCommand.mjs +26 -26
- package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +260 -0
- package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ComputeEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +20 -20
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +19 -19
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
- package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
- package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +37 -0
- package/esm2022/src/commands/ClientToServer/EventCommand.mjs +40 -0
- package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +67 -0
- package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +22 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
- package/{esm2020 → esm2022}/src/commands/ClientToServer/IndexChangeEventCommand.mjs +21 -21
- package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +23 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
- package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +40 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SelectProgramCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SubformOpenEventCommand.mjs +21 -21
- package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +30 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +14 -14
- package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
- package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
- package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
- package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +1 -1
- package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
- package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
- package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
- package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
- package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
- package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
- package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
- package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
- package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
- package/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
- package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
- package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
- package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
- package/esm2022/src/data/DataView.mjs +1613 -0
- package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
- package/esm2022/src/data/DataviewManager.mjs +28 -0
- package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
- package/esm2022/src/data/DvCache.mjs +67 -0
- package/esm2022/src/data/Field.mjs +646 -0
- package/esm2022/src/data/FieldBase.mjs +15 -0
- package/esm2022/src/data/FieldsTable.mjs +103 -0
- package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
- package/esm2022/src/data/Key.mjs +88 -0
- package/esm2022/src/data/Record.mjs +866 -0
- package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
- package/esm2022/src/data/RecordsTable.mjs +267 -0
- package/esm2022/src/data/TaskTransactionManager.mjs +103 -0
- package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
- package/{esm2020 → esm2022}/src/enums.mjs +23 -23
- package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
- package/esm2022/src/env/Environment.mjs +487 -0
- package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
- package/esm2022/src/env/LanguageData.mjs +227 -0
- package/esm2022/src/env/MirrorString.mjs +65 -0
- package/esm2022/src/event/ActionManager.mjs +91 -0
- package/esm2022/src/event/Event.mjs +1333 -0
- package/esm2022/src/event/EventHandler.mjs +766 -0
- package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
- package/esm2022/src/event/EventsManager.mjs +2988 -0
- package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
- package/esm2022/src/event/RunTimeEvent.mjs +399 -0
- package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
- package/esm2022/src/event/UserEventsTable.mjs +47 -0
- package/esm2022/src/exp/ExpTable.mjs +57 -0
- package/esm2022/src/exp/Expression.mjs +200 -0
- package/esm2022/src/exp/ExpressionDict.mjs +727 -0
- package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
- package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
- package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
- package/esm2022/src/exp/YesNoExp.mjs +36 -0
- package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
- package/esm2022/src/gui/FormsTable.mjs +66 -0
- package/esm2022/src/gui/MgControl.mjs +363 -0
- package/esm2022/src/gui/MgForm.mjs +1224 -0
- package/esm2022/src/http/HttpManager.mjs +97 -0
- package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
- package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
- package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
- package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
- package/esm2022/src/http/client/HttpUtility.mjs +84 -0
- package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
- package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/RemoteCommandsProcessor.mjs +880 -0
- package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
- package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
- package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
- package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
- package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
- package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
- package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
- package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
- package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
- package/esm2022/src/remote/ServerError.mjs +40 -0
- package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
- package/esm2022/src/rt/Argument.mjs +265 -0
- package/esm2022/src/rt/ArgumentsList.mjs +103 -0
- package/esm2022/src/rt/Boundary.mjs +152 -0
- package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
- package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
- package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
- package/esm2022/src/rt/ExecutionStack.mjs +94 -0
- package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
- package/esm2022/src/rt/HandlersTable.mjs +96 -0
- package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
- package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
- package/esm2022/src/rt/Operation.mjs +735 -0
- package/esm2022/src/rt/OperationTable.mjs +67 -0
- package/esm2022/src/rt/Recompute.mjs +355 -0
- package/esm2022/src/rt/RecomputeTable.mjs +63 -0
- package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
- package/esm2022/src/rt/ResultValue.mjs +10 -0
- package/esm2022/src/rt/TableCache.mjs +177 -0
- package/esm2022/src/rt/TableCacheManager.mjs +67 -0
- package/esm2022/src/rt/Transaction.mjs +53 -0
- package/esm2022/src/security/UserDetails.mjs +71 -0
- package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
- package/esm2022/src/tasks/MGData.mjs +552 -0
- package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
- package/esm2022/src/tasks/RCTimer.mjs +63 -0
- package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
- package/esm2022/src/tasks/Task.mjs +2499 -0
- package/esm2022/src/tasks/TaskBase.mjs +83 -0
- package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
- package/esm2022/src/tasks/TasksTable.mjs +80 -0
- package/esm2022/src/tasks/sort/Sort.mjs +5 -0
- package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
- package/esm2022/src/util/ConstUtils.mjs +14 -0
- package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
- package/esm2022/src/util/HeapSort.mjs +70 -0
- package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
- package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
- package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
- package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
- package/esm2022/src/util/PrmMap.mjs +152 -0
- package/esm2022/src/util/ReturnResult.mjs +46 -0
- package/esm2022/src/util/ReturnResultBase.mjs +18 -0
- package/esm2022/src/util/Scrambler.mjs +89 -0
- package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
- package/esm2022/src/util/cookie.service.mjs +92 -0
- package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29797 -29693
- package/fesm2022/magic-xpa-engine.mjs.map +1 -0
- package/index.d.ts +187 -187
- package/package.json +8 -14
- package/src/AccessHelper.d.ts +20 -20
- package/src/ClientManager.d.ts +35 -32
- package/src/CommandsProcessorBase.d.ts +23 -23
- package/src/CommandsProcessorManager.d.ts +6 -6
- package/src/CommandsTable.d.ts +22 -22
- package/src/ConstInterface.d.ts +516 -515
- package/src/CurrentClientVersion.d.ts +1 -1
- package/src/FlowMonitorInterface.d.ts +15 -15
- package/src/GUIManager.d.ts +17 -17
- package/src/GlobalCommandsManager.d.ts +17 -17
- package/src/GuiEventsProcessor.d.ts +24 -24
- package/src/ICommandsTable.d.ts +9 -9
- package/src/ServerConfig.d.ts +35 -34
- package/src/bridge/IGuiEvent.d.ts +19 -19
- package/src/bridge/MagicBridge.d.ts +16 -16
- package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
- package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
- package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
- package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +10 -10
- package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
- package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
- package/src/commands/ClientToServer/ComputeEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +7 -7
- package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +7 -7
- package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
- package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
- package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
- package/src/commands/ClientToServer/EvaluateCommand.d.ts +15 -15
- package/src/commands/ClientToServer/EventCommand.d.ts +15 -15
- package/src/commands/ClientToServer/ExecOperCommand.d.ts +23 -23
- package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
- package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
- package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +10 -10
- package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
- package/src/commands/ClientToServer/RecomputeCommand.d.ts +11 -11
- package/src/commands/ClientToServer/RefreshEventCommand.d.ts +12 -12
- package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +10 -10
- package/src/commands/ClientToServer/RollbackEventCommand.d.ts +14 -14
- package/src/commands/ClientToServer/SelectProgramCommand.d.ts +6 -6
- package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
- package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +9 -9
- package/src/commands/ClientToServer/TransactionCommand.d.ts +12 -12
- package/src/commands/ClientToServer/UnloadCommand.d.ts +7 -7
- package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
- package/src/commands/DataViewCommandBase.d.ts +6 -6
- package/src/commands/IClientCommand.d.ts +2 -2
- package/src/commands/IClientTargetedCommand.d.ts +12 -12
- package/src/commands/IClientToServerCommandInfo.d.ts +3 -3
- package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
- package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
- package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
- package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
- package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
- package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
- package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
- package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
- package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
- package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
- package/src/communications/IConnectionStateManager.d.ts +4 -4
- package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
- package/src/data/DataSourceIdKey.d.ts +2 -2
- package/src/data/DataView.d.ts +162 -162
- package/src/data/DataViewBase.d.ts +12 -12
- package/src/data/DataviewManager.d.ts +14 -14
- package/src/data/DataviewManagerBase.d.ts +11 -11
- package/src/data/DvCache.d.ts +15 -15
- package/src/data/Field.d.ts +103 -103
- package/src/data/FieldBase.d.ts +23 -23
- package/src/data/FieldsTable.d.ts +27 -27
- package/src/data/IRecordsTable.d.ts +7 -7
- package/src/data/Key.d.ts +15 -15
- package/src/data/Record.d.ts +156 -156
- package/src/data/RecordOutOfDataViewException.d.ts +10 -10
- package/src/data/RecordsTable.d.ts +38 -38
- package/src/data/TaskTransactionManager.d.ts +17 -17
- package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
- package/src/enums.d.ts +21 -21
- package/src/env/EnvVariablesTable.d.ts +17 -17
- package/src/env/Environment.d.ts +118 -118
- package/src/env/ILanguageData.d.ts +3 -3
- package/src/env/LanguageData.d.ts +20 -20
- package/src/env/MirrorString.d.ts +15 -15
- package/src/event/ActionManager.d.ts +14 -14
- package/src/event/Event.d.ts +79 -79
- package/src/event/EventHandler.d.ts +66 -66
- package/src/event/EventHandlerPosition.d.ts +25 -25
- package/src/event/EventsManager.d.ts +205 -204
- package/src/event/IEventsManager.d.ts +77 -77
- package/src/event/RunTimeEvent.d.ts +126 -123
- package/src/event/RunTimeEventBase.d.ts +5 -5
- package/src/event/UserEventsTable.d.ts +11 -11
- package/src/exp/ExpTable.d.ts +11 -11
- package/src/exp/Expression.d.ts +37 -37
- package/src/exp/ExpressionDict.d.ts +12 -12
- package/src/exp/ExpressionEvaluator.d.ts +198 -198
- package/src/exp/ExpressionLocalJpn.d.ts +18 -18
- package/src/exp/GlobalParamsTable.d.ts +19 -19
- package/src/exp/YesNoExp.d.ts +9 -9
- package/src/gui/CreatedFormVector.d.ts +10 -10
- package/src/gui/FormsTable.d.ts +15 -15
- package/src/gui/MgControl.d.ts +60 -60
- package/src/gui/MgForm.d.ts +96 -93
- package/src/http/HttpManager.d.ts +25 -25
- package/src/http/client/HttpClientAsync.d.ts +16 -16
- package/src/http/client/HttpClientBase.d.ts +30 -30
- package/src/http/client/HttpClientEvents.d.ts +18 -18
- package/src/http/client/HttpClientSync.d.ts +17 -17
- package/src/http/client/HttpUtility.d.ts +10 -10
- package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
- package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
- package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
- package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
- package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
- package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
- package/src/remote/RemoteDataviewManager.d.ts +9 -9
- package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
- package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ServerError.d.ts +16 -16
- package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
- package/src/rt/Argument.d.ts +36 -36
- package/src/rt/ArgumentsList.d.ts +24 -24
- package/src/rt/Boundary.d.ts +27 -27
- package/src/rt/CompMainPrgTable.d.ts +10 -10
- package/src/rt/DataviewHeaderBase.d.ts +34 -34
- package/src/rt/DataviewHeaderFactory.d.ts +5 -5
- package/src/rt/DataviewHeaders.d.ts +12 -12
- package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
- package/src/rt/ExecutionStack.d.ts +22 -22
- package/src/rt/ExecutionStackEntry.d.ts +7 -7
- package/src/rt/HandlersTable.d.ts +19 -19
- package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
- package/src/rt/IDataviewHeader.d.ts +10 -10
- package/src/rt/IResultValue.d.ts +4 -4
- package/src/rt/LastFocusedManager.d.ts +23 -23
- package/src/rt/Operation.d.ts +97 -97
- package/src/rt/OperationTable.d.ts +15 -15
- package/src/rt/Recompute.d.ts +41 -41
- package/src/rt/RecomputeTable.d.ts +9 -9
- package/src/rt/RemoteDataviewHeader.d.ts +14 -14
- package/src/rt/ResultValue.d.ts +7 -7
- package/src/rt/TableCache.d.ts +29 -29
- package/src/rt/TableCacheManager.d.ts +10 -10
- package/src/rt/Transaction.d.ts +23 -23
- package/src/security/UserDetails.d.ts +16 -16
- package/src/tasks/IMGDataCollection.d.ts +26 -26
- package/src/tasks/MGData.d.ts +63 -63
- package/src/tasks/MGDataCollection.d.ts +42 -42
- package/src/tasks/RCTimer.d.ts +13 -13
- package/src/tasks/RemoteTaskService.d.ts +16 -16
- package/src/tasks/Task.d.ts +312 -312
- package/src/tasks/TaskBase.d.ts +123 -123
- package/src/tasks/TaskServiceBase.d.ts +16 -16
- package/src/tasks/TasksTable.d.ts +21 -21
- package/src/tasks/sort/Sort.d.ts +4 -4
- package/src/tasks/sort/SortCollection.d.ts +11 -11
- package/src/util/ConstUtils.d.ts +3 -3
- package/src/util/FlowMonitorQueue.d.ts +70 -70
- package/src/util/HeapSort.d.ts +6 -6
- package/src/util/IMirrorXML.d.ts +6 -6
- package/src/util/IServerConfig.d.ts +11 -11
- package/src/util/MgBlockingQueue.d.ts +5 -5
- package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
- package/src/util/MgPriorityQueue.d.ts +13 -13
- package/src/util/ParamParseResult.d.ts +6 -6
- package/src/util/PrmMap.d.ts +28 -28
- package/src/util/ReturnResult.d.ts +18 -18
- package/src/util/ReturnResultBase.d.ts +11 -11
- package/src/util/Scrambler.d.ts +10 -10
- package/src/util/UniqueIDUtils.d.ts +4 -4
- package/src/util/cookie.service.d.ts +8 -8
- package/esm2020/src/AccessHelper.mjs +0 -9
- package/esm2020/src/ClientManager.mjs +0 -399
- package/esm2020/src/CommandsProcessorBase.mjs +0 -58
- package/esm2020/src/CommandsProcessorManager.mjs +0 -26
- package/esm2020/src/CommandsTable.mjs +0 -162
- package/esm2020/src/ConstInterface.mjs +0 -516
- package/esm2020/src/FlowMonitorInterface.mjs +0 -16
- package/esm2020/src/GUIManager.mjs +0 -62
- package/esm2020/src/GlobalCommandsManager.mjs +0 -34
- package/esm2020/src/GuiEventsProcessor.mjs +0 -154
- package/esm2020/src/ServerConfig.mjs +0 -117
- package/esm2020/src/bridge/MagicBridge.mjs +0 -41
- package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
- package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
- package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
- package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
- package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
- package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
- package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
- package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
- package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
- package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
- package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
- package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
- package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
- package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
- package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
- package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
- package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
- package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
- package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
- package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
- package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
- package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
- package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
- package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
- package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
- package/esm2020/src/data/DataView.mjs +0 -1610
- package/esm2020/src/data/DataviewManager.mjs +0 -28
- package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
- package/esm2020/src/data/DvCache.mjs +0 -67
- package/esm2020/src/data/Field.mjs +0 -646
- package/esm2020/src/data/FieldBase.mjs +0 -18
- package/esm2020/src/data/FieldsTable.mjs +0 -103
- package/esm2020/src/data/Key.mjs +0 -88
- package/esm2020/src/data/Record.mjs +0 -846
- package/esm2020/src/data/RecordsTable.mjs +0 -267
- package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
- package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
- package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
- package/esm2020/src/env/Environment.mjs +0 -489
- package/esm2020/src/env/LanguageData.mjs +0 -226
- package/esm2020/src/env/MirrorString.mjs +0 -65
- package/esm2020/src/event/ActionManager.mjs +0 -91
- package/esm2020/src/event/Event.mjs +0 -1333
- package/esm2020/src/event/EventHandler.mjs +0 -766
- package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
- package/esm2020/src/event/EventsManager.mjs +0 -2975
- package/esm2020/src/event/RunTimeEvent.mjs +0 -392
- package/esm2020/src/event/UserEventsTable.mjs +0 -47
- package/esm2020/src/exp/ExpTable.mjs +0 -59
- package/esm2020/src/exp/Expression.mjs +0 -200
- package/esm2020/src/exp/ExpressionDict.mjs +0 -727
- package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
- package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
- package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
- package/esm2020/src/exp/YesNoExp.mjs +0 -36
- package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
- package/esm2020/src/gui/FormsTable.mjs +0 -66
- package/esm2020/src/gui/MgControl.mjs +0 -353
- package/esm2020/src/gui/MgForm.mjs +0 -1181
- package/esm2020/src/http/HttpManager.mjs +0 -97
- package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
- package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
- package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
- package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
- package/esm2020/src/http/client/HttpUtility.mjs +0 -84
- package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
- package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
- package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
- package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
- package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
- package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
- package/esm2020/src/remote/ServerError.mjs +0 -40
- package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
- package/esm2020/src/rt/Argument.mjs +0 -265
- package/esm2020/src/rt/ArgumentsList.mjs +0 -103
- package/esm2020/src/rt/Boundary.mjs +0 -152
- package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
- package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
- package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
- package/esm2020/src/rt/ExecutionStack.mjs +0 -94
- package/esm2020/src/rt/HandlersTable.mjs +0 -96
- package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
- package/esm2020/src/rt/Operation.mjs +0 -735
- package/esm2020/src/rt/OperationTable.mjs +0 -67
- package/esm2020/src/rt/Recompute.mjs +0 -355
- package/esm2020/src/rt/RecomputeTable.mjs +0 -63
- package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
- package/esm2020/src/rt/ResultValue.mjs +0 -12
- package/esm2020/src/rt/TableCache.mjs +0 -177
- package/esm2020/src/rt/TableCacheManager.mjs +0 -67
- package/esm2020/src/rt/Transaction.mjs +0 -53
- package/esm2020/src/security/UserDetails.mjs +0 -71
- package/esm2020/src/tasks/MGData.mjs +0 -552
- package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
- package/esm2020/src/tasks/RCTimer.mjs +0 -63
- package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
- package/esm2020/src/tasks/Task.mjs +0 -2495
- package/esm2020/src/tasks/TaskBase.mjs +0 -87
- package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
- package/esm2020/src/tasks/TasksTable.mjs +0 -80
- package/esm2020/src/tasks/sort/Sort.mjs +0 -7
- package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
- package/esm2020/src/util/ConstUtils.mjs +0 -14
- package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
- package/esm2020/src/util/HeapSort.mjs +0 -70
- package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
- package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
- package/esm2020/src/util/PrmMap.mjs +0 -151
- package/esm2020/src/util/ReturnResult.mjs +0 -46
- package/esm2020/src/util/ReturnResultBase.mjs +0 -18
- package/esm2020/src/util/Scrambler.mjs +0 -89
- package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
- package/esm2020/src/util/cookie.service.mjs +0 -92
- package/fesm2015/magic-xpa-engine.mjs +0 -30835
- package/fesm2015/magic-xpa-engine.mjs.map +0 -1
- package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -1,1181 +0,0 @@
|
|
1
|
-
import { Commands, CommandType, DataModificationTypes, GuiEnvironment, Manager, MgFormBase, PropInterface } from '@magic-xpa/gui';
|
2
|
-
import { Constants, InternalInterface, Logger, MgControlType, Misc, Priority, XMLConstants } from '@magic-xpa/utils';
|
3
|
-
import { ApplicationException, Debug, Exception, Int32, NString, RefParam, StringBuilder } from '@magic-xpa/mscorelib';
|
4
|
-
import { MgControl } from './MgControl';
|
5
|
-
import { RecordOutOfDataViewException } from '../data/RecordOutOfDataViewException';
|
6
|
-
import { SET_DISPLAYLINE_BY_DV } from '../data/DataView';
|
7
|
-
import { TaskBase } from '../tasks/TaskBase';
|
8
|
-
import { ServerError } from '../remote/ServerError';
|
9
|
-
import { ConstInterface } from '../ConstInterface';
|
10
|
-
import { LastFocusedManager } from '../rt/LastFocusedManager';
|
11
|
-
import { CreatedFormVector } from './CreatedFormVector';
|
12
|
-
import { AccessHelper } from '../AccessHelper';
|
13
|
-
export class MgForm extends MgFormBase {
|
14
|
-
constructor() {
|
15
|
-
super();
|
16
|
-
this.IsMovingInView = false;
|
17
|
-
this.PrevDisplayLine = 0;
|
18
|
-
this.RefreshAllRows = false;
|
19
|
-
this.IgnoreFirstRecordCycle = false;
|
20
|
-
this.MovedToFirstControl = false;
|
21
|
-
this._suffixDone = false;
|
22
|
-
this.hiddenControlsIsnsList = null;
|
23
|
-
this._transferringDataToGUI = false;
|
24
|
-
this.isFetchingRecordsAhead = false;
|
25
|
-
}
|
26
|
-
static get CreatedForms() {
|
27
|
-
return MgForm._createdForms;
|
28
|
-
}
|
29
|
-
get InRestore() {
|
30
|
-
return this._inRestore;
|
31
|
-
}
|
32
|
-
get TransferringDataToGUI() {
|
33
|
-
return this._transferringDataToGUI;
|
34
|
-
}
|
35
|
-
get shouldFetchRecordsAheadFromServer() {
|
36
|
-
if (this.isTableWithPagination()) {
|
37
|
-
let prop = this._tableMgControl.GetComputedProperty(PropInterface.PROP_TYPE_SERVER_READ_AHEAD);
|
38
|
-
return (prop != null ? prop.GetComputedValueBoolean() : false);
|
39
|
-
}
|
40
|
-
else
|
41
|
-
return false;
|
42
|
-
}
|
43
|
-
async FetchRecordsAheadFromServer() {
|
44
|
-
this.isFetchingRecordsAhead = true;
|
45
|
-
await this.GetDataview().FetchRecordsAheadFromServer();
|
46
|
-
this.isFetchingRecordsAhead = false;
|
47
|
-
}
|
48
|
-
GetDataview() {
|
49
|
-
let dv = null;
|
50
|
-
if (this._task != null)
|
51
|
-
dv = this._task.DataView;
|
52
|
-
return (dv);
|
53
|
-
}
|
54
|
-
async moveInView(unit, direction) {
|
55
|
-
let oldRecId = Int32.MinValue;
|
56
|
-
let currRec = this.GetDataview().getCurrRec();
|
57
|
-
let oldTaskMode = ' ';
|
58
|
-
let returnToVisibleLine = false;
|
59
|
-
let recordOutOfView = false;
|
60
|
-
let visibleLine = 0;
|
61
|
-
try {
|
62
|
-
this.IsMovingInView = true;
|
63
|
-
let oldDisplayLine = this.DisplayLine;
|
64
|
-
if (unit === Constants.MOVE_UNIT_TABLE) {
|
65
|
-
try {
|
66
|
-
if (direction === Constants.MOVE_DIRECTION_BEGIN) {
|
67
|
-
await this.GetDataview().setCurrRecByIdx(Constants.MG_DATAVIEW_FIRST_RECORD, true, false, true, SET_DISPLAYLINE_BY_DV);
|
68
|
-
if (this.isLineMode()) {
|
69
|
-
this.GetDataview().setTopRecIdx(0);
|
70
|
-
await this.setCurrRowByDisplayLine(0, false, false);
|
71
|
-
}
|
72
|
-
}
|
73
|
-
else {
|
74
|
-
await this.GetDataview().setCurrRecByIdx(Constants.MG_DATAVIEW_LAST_RECORD, true, false, true, SET_DISPLAYLINE_BY_DV);
|
75
|
-
if (this.isLineMode()) {
|
76
|
-
this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx() - this._rowsInPage + 1);
|
77
|
-
if (this.GetDataview().getTopRecIdx() >= 0)
|
78
|
-
await this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx(), false, false);
|
79
|
-
else {
|
80
|
-
this.GetDataview().setTopRecIdx(0);
|
81
|
-
await this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx(), false, false);
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
this.updateDisplayLineByDV();
|
86
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
87
|
-
}
|
88
|
-
catch (ex) {
|
89
|
-
if (ex instanceof RecordOutOfDataViewException)
|
90
|
-
Logger.Instance.WriteDevToLog(ex.Message);
|
91
|
-
}
|
92
|
-
}
|
93
|
-
else {
|
94
|
-
this.getTopIndexFromGUI();
|
95
|
-
let size;
|
96
|
-
if (unit === Constants.MOVE_UNIT_PAGE && this.isLineMode()) {
|
97
|
-
switch (direction) {
|
98
|
-
case Constants.MOVE_DIRECTION_BEGIN:
|
99
|
-
size = this.GetDataview().getCurrRecIdx() - this.GetDataview().getTopRecIdx();
|
100
|
-
break;
|
101
|
-
case Constants.MOVE_DIRECTION_END:
|
102
|
-
let last = this.GetDataview().getTopRecIdx() + this._rowsInPage - 1;
|
103
|
-
last = Math.min(last, this.GetDataview().getSize() - 1);
|
104
|
-
size = last - this.GetDataview().getCurrRecIdx();
|
105
|
-
break;
|
106
|
-
default:
|
107
|
-
returnToVisibleLine = true;
|
108
|
-
size = this._rowsInPage;
|
109
|
-
break;
|
110
|
-
}
|
111
|
-
}
|
112
|
-
else
|
113
|
-
size = 1;
|
114
|
-
size = (direction === Constants.MOVE_DIRECTION_PREV ||
|
115
|
-
direction === Constants.MOVE_DIRECTION_BEGIN
|
116
|
-
? -size
|
117
|
-
: size);
|
118
|
-
if (this.isLineMode()) {
|
119
|
-
visibleLine = this.getVisibleLine();
|
120
|
-
if (visibleLine < 0) {
|
121
|
-
visibleLine = 0;
|
122
|
-
recordOutOfView = true;
|
123
|
-
}
|
124
|
-
if (visibleLine > this._rowsInPage + 1) {
|
125
|
-
visibleLine = this._rowsInPage;
|
126
|
-
recordOutOfView = true;
|
127
|
-
}
|
128
|
-
if (unit === Constants.MOVE_UNIT_PAGE &&
|
129
|
-
(direction === Constants.MOVE_DIRECTION_NEXT ||
|
130
|
-
direction === Constants.MOVE_DIRECTION_PREV) ||
|
131
|
-
unit === Constants.MOVE_UNIT_ROW &&
|
132
|
-
(direction === Constants.MOVE_DIRECTION_NEXT && visibleLine === this._rowsInPage - 1 ||
|
133
|
-
direction === Constants.MOVE_DIRECTION_PREV && visibleLine === 0)) {
|
134
|
-
if (direction === Constants.MOVE_DIRECTION_PREV &&
|
135
|
-
(unit === Constants.MOVE_UNIT_ROW || unit === Constants.MOVE_UNIT_PAGE) &&
|
136
|
-
visibleLine === 0 && this.GetDataview().getCurrRecIdx() === 0 && this.GetDataview().IncludesFirst())
|
137
|
-
return;
|
138
|
-
if (direction === Constants.MOVE_DIRECTION_NEXT && unit === Constants.MOVE_UNIT_PAGE &&
|
139
|
-
visibleLine === this.getLastValidRow() && this.GetDataview().getCurrRecIdx() === this.GetDataview().getSize() - 1 && this.GetDataview().IncludesLast())
|
140
|
-
return;
|
141
|
-
oldRecId = (this.GetDataview().getCurrRec()).getId();
|
142
|
-
this.GetDataview().setTopRecIdx(this.GetDataview().getTopRecIdx() + size);
|
143
|
-
this.GetDataview().setTopRecIdxModified(true);
|
144
|
-
try {
|
145
|
-
this._suffixDone = false;
|
146
|
-
await this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx() + size, true, false);
|
147
|
-
this.GetDataview().setTopRecIdxModified(false);
|
148
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
149
|
-
}
|
150
|
-
catch (ex) {
|
151
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
152
|
-
this.GetDataview().setTopRecIdxModified(false);
|
153
|
-
if (AccessHelper.eventsManager.GetStopExecutionFlag()) {
|
154
|
-
this.GetDataview().restoreTopRecIdx();
|
155
|
-
await this.restoreOldDisplayLine(oldDisplayLine);
|
156
|
-
return;
|
157
|
-
}
|
158
|
-
if (this.GetDataview().getTopRecIdx() < 0) {
|
159
|
-
this.GetDataview().setTopRecIdx(0);
|
160
|
-
try {
|
161
|
-
await this.setCurrRowByDisplayLine(0, true, false);
|
162
|
-
}
|
163
|
-
catch (exception) {
|
164
|
-
if (exception instanceof Exception) {
|
165
|
-
if (AccessHelper.eventsManager.GetStopExecutionFlag()) {
|
166
|
-
this.GetDataview().restoreTopRecIdx();
|
167
|
-
await this.restoreOldDisplayLine(oldDisplayLine);
|
168
|
-
return;
|
169
|
-
}
|
170
|
-
}
|
171
|
-
}
|
172
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
173
|
-
}
|
174
|
-
else if (unit !== Constants.MOVE_UNIT_ROW && this.GetDataview().recExists(this.GetDataview().getTopRecIdx())) {
|
175
|
-
let newRecId = (this.GetDataview().getCurrRec()).getId();
|
176
|
-
if (newRecId === oldRecId && !this._suffixDone) {
|
177
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_REC_SUFFIX);
|
178
|
-
if (AccessHelper.eventsManager.GetStopExecutionFlag()) {
|
179
|
-
this.GetDataview().restoreTopRecIdx();
|
180
|
-
await this.restoreOldDisplayLine(oldDisplayLine);
|
181
|
-
return;
|
182
|
-
}
|
183
|
-
try {
|
184
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
185
|
-
await this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + this.getLastValidRow(), false, true);
|
186
|
-
visibleLine = this.getLastValidRow();
|
187
|
-
}
|
188
|
-
catch (Exception) {
|
189
|
-
}
|
190
|
-
}
|
191
|
-
}
|
192
|
-
else {
|
193
|
-
this.GetDataview().restoreTopRecIdx();
|
194
|
-
await this.restoreOldDisplayLine(oldDisplayLine);
|
195
|
-
if (unit === Constants.MOVE_UNIT_ROW && direction === Constants.MOVE_DIRECTION_NEXT) {
|
196
|
-
if (!this._task.IsInteractive && this._task.getMode() !== Constants.TASK_MODE_CREATE)
|
197
|
-
this._task.setExecEndTask();
|
198
|
-
else
|
199
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
|
200
|
-
}
|
201
|
-
return;
|
202
|
-
}
|
203
|
-
Logger.Instance.WriteDevToLog(ex.Message);
|
204
|
-
}
|
205
|
-
}
|
206
|
-
}
|
207
|
-
else {
|
208
|
-
try {
|
209
|
-
oldTaskMode = this._task.getMode();
|
210
|
-
oldRecId = (this.GetDataview().getCurrRec()).getId();
|
211
|
-
await this.setCurrRowByDisplayLine(oldDisplayLine + size, true, false);
|
212
|
-
if (!this.GetDataview().recExistsById(oldRecId)) {
|
213
|
-
if (size > 0 || oldTaskMode !== Constants.TASK_MODE_CREATE)
|
214
|
-
if (size !== -1 || this.GetDataview().recExists(oldDisplayLine))
|
215
|
-
await this.setCurrRowByDisplayLine(oldDisplayLine, false, false);
|
216
|
-
else
|
217
|
-
Logger.Instance.WriteDevToLog(NString.Format("skipped setcurrRow for row {0}", oldDisplayLine));
|
218
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
219
|
-
}
|
220
|
-
else if (AccessHelper.eventsManager.GetStopExecutionFlag()) {
|
221
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
222
|
-
}
|
223
|
-
}
|
224
|
-
catch (ex) {
|
225
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
226
|
-
if (this.GetDataview().recExistsById(oldRecId)) {
|
227
|
-
await this.restoreOldDisplayLine(oldDisplayLine);
|
228
|
-
if (!currRec.Synced && oldTaskMode === Constants.TASK_MODE_CREATE) {
|
229
|
-
this._task.setMode(Constants.TASK_MODE_CREATE);
|
230
|
-
currRec.clearMode();
|
231
|
-
currRec.setMode(DataModificationTypes.Insert);
|
232
|
-
currRec.setNewRec();
|
233
|
-
}
|
234
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
235
|
-
}
|
236
|
-
else {
|
237
|
-
if (oldTaskMode === Constants.TASK_MODE_CREATE && oldDisplayLine > 0)
|
238
|
-
await this.restoreOldDisplayLine(oldDisplayLine - 1);
|
239
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
240
|
-
}
|
241
|
-
if (size <= 0 || AccessHelper.eventsManager.GetStopExecutionFlag())
|
242
|
-
Logger.Instance.WriteDevToLog(ex.Message);
|
243
|
-
else {
|
244
|
-
if (!this._task.IsInteractive && this._task.getMode() !== Constants.TASK_MODE_CREATE) {
|
245
|
-
this._task.setExecEndTask();
|
246
|
-
return;
|
247
|
-
}
|
248
|
-
else {
|
249
|
-
if (this._task.ActionManager.isEnabled(InternalInterface.MG_ACT_CRELINE))
|
250
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
|
251
|
-
else {
|
252
|
-
let doRecordSuffix = true;
|
253
|
-
let refdoRecordSuffix = new RefParam(doRecordSuffix);
|
254
|
-
if (!await AccessHelper.eventsManager.DoTaskLevelRecordSuffix(this._task, refdoRecordSuffix))
|
255
|
-
await AccessHelper.eventsManager.DoTaskLevelRecordPrefix(this._task);
|
256
|
-
doRecordSuffix = refdoRecordSuffix.value;
|
257
|
-
}
|
258
|
-
}
|
259
|
-
}
|
260
|
-
return;
|
261
|
-
}
|
262
|
-
}
|
263
|
-
}
|
264
|
-
}
|
265
|
-
else {
|
266
|
-
try {
|
267
|
-
await this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx() + size, true, false, true, SET_DISPLAYLINE_BY_DV);
|
268
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
269
|
-
}
|
270
|
-
catch (ex) {
|
271
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
272
|
-
if (size > 0) {
|
273
|
-
if (!this._task.IsInteractive && this._task.getMode() !== Constants.TASK_MODE_CREATE)
|
274
|
-
this._task.setExecEndTask();
|
275
|
-
else
|
276
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
|
277
|
-
}
|
278
|
-
else
|
279
|
-
Logger.Instance.WriteDevToLog(ex.Message);
|
280
|
-
return;
|
281
|
-
}
|
282
|
-
else if (ex instanceof ServerError) {
|
283
|
-
await this._task.stop();
|
284
|
-
this._task.abort();
|
285
|
-
await AccessHelper.eventsManager.ProcessAbortingError(ex);
|
286
|
-
}
|
287
|
-
else if (ex instanceof Exception) {
|
288
|
-
Logger.Instance.WriteDevToLog(ex.Message);
|
289
|
-
return;
|
290
|
-
}
|
291
|
-
}
|
292
|
-
}
|
293
|
-
}
|
294
|
-
if (returnToVisibleLine) {
|
295
|
-
if (recordOutOfView) {
|
296
|
-
if (visibleLine === 0)
|
297
|
-
this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx());
|
298
|
-
else
|
299
|
-
this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx() - this._rowsInPage);
|
300
|
-
this.SetTableTopIndex();
|
301
|
-
}
|
302
|
-
else {
|
303
|
-
this.SetTableTopIndex();
|
304
|
-
await this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + visibleLine, false, true);
|
305
|
-
}
|
306
|
-
}
|
307
|
-
else
|
308
|
-
this.SetTableTopIndex();
|
309
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_REC_PREFIX);
|
310
|
-
}
|
311
|
-
catch (e) {
|
312
|
-
if (e instanceof RecordOutOfDataViewException) {
|
313
|
-
Logger.Instance.WriteDevToLog(e.Message);
|
314
|
-
}
|
315
|
-
}
|
316
|
-
finally {
|
317
|
-
this.SelectRow();
|
318
|
-
this.IsMovingInView = false;
|
319
|
-
}
|
320
|
-
}
|
321
|
-
async addRec(doSuffix, isCrelineAbove) {
|
322
|
-
let newLine = 1;
|
323
|
-
let currLine = -1;
|
324
|
-
if (!this._task.DataView.isEmptyDataview())
|
325
|
-
currLine = this.getVisibleLine();
|
326
|
-
if (this.isTableWithAbsoluteScrollbar()) {
|
327
|
-
this.GetDataview().TotalRecordsCount += 1;
|
328
|
-
this.RefreshAllRows = true;
|
329
|
-
}
|
330
|
-
let newRecIdx = await this.GetDataview().addRecord(doSuffix, false, isCrelineAbove);
|
331
|
-
if (newRecIdx > -1) {
|
332
|
-
if (this.isLineMode()) {
|
333
|
-
let newCurrRow;
|
334
|
-
if (this.GetDataview().getSize() === 0 || this.GetDataview().getTopRecIdx() === Int32.MinValue) {
|
335
|
-
this.GetDataview().setTopRecIdx(0);
|
336
|
-
newCurrRow = 0;
|
337
|
-
}
|
338
|
-
else if (currLine === this._rowsInPage - 1) {
|
339
|
-
this.GetDataview().setTopRecIdx(this.GetDataview().getTopRecIdx() + 1);
|
340
|
-
newCurrRow = this.getVisibleLine();
|
341
|
-
}
|
342
|
-
else {
|
343
|
-
if (isCrelineAbove)
|
344
|
-
newCurrRow = currLine > 0 ? currLine : 0;
|
345
|
-
else
|
346
|
-
newCurrRow = currLine + 1;
|
347
|
-
}
|
348
|
-
newLine = this.GetDataview().getTopRecIdx() + newCurrRow;
|
349
|
-
this.removeRecordsAfterIdx(this.GetDataview().getTopRecIdx() + newCurrRow);
|
350
|
-
try {
|
351
|
-
if (!this._task.DataView.isEmptyDataview())
|
352
|
-
this._task.setMode(Constants.TASK_MODE_CREATE);
|
353
|
-
await this.setCurrRowByDisplayLine(newLine, false, false);
|
354
|
-
}
|
355
|
-
catch (ex) {
|
356
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
357
|
-
Logger.Instance.WriteDevToLog(NString.Format("in Form.addRec() {0}", ex.Message));
|
358
|
-
}
|
359
|
-
}
|
360
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_TABLE);
|
361
|
-
}
|
362
|
-
}
|
363
|
-
else if (this.isTableWithAbsoluteScrollbar()) {
|
364
|
-
this.GetDataview().TotalRecordsCount -= 1;
|
365
|
-
this.RefreshAllRows = false;
|
366
|
-
}
|
367
|
-
}
|
368
|
-
async delCurrRec() {
|
369
|
-
let topTableRow = super.isLineMode() && this.GetDataview().getTopRecIdx() === this.GetDataview().getCurrRecIdx();
|
370
|
-
await this.GetDataview().removeCurrRec();
|
371
|
-
if (this.GetDataview().isEmpty() && !this._task.IsTryingToStop) {
|
372
|
-
if (this._task.DataView.isEmptyDataview()) {
|
373
|
-
await this.addRec(false, false);
|
374
|
-
}
|
375
|
-
else {
|
376
|
-
if (await this._task.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true)) {
|
377
|
-
if (this._task.getMode() !== Constants.TASK_MODE_CREATE)
|
378
|
-
this._task.setMode(Constants.TASK_MODE_CREATE);
|
379
|
-
this._task.enableCreateActs(true);
|
380
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
|
381
|
-
}
|
382
|
-
else
|
383
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_EXIT);
|
384
|
-
}
|
385
|
-
}
|
386
|
-
if (!this.GetDataview().isEmpty()) {
|
387
|
-
if (topTableRow)
|
388
|
-
this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx());
|
389
|
-
if (super.isLineMode()) {
|
390
|
-
if (super.HasTable()) {
|
391
|
-
if (this.isTableWithAbsoluteScrollbar()) {
|
392
|
-
this.GetDataview().TotalRecordsCount--;
|
393
|
-
this.RefreshAllRows = true;
|
394
|
-
}
|
395
|
-
this.removeRecordsAfterIdx(this.GetDataview().getCurrRecIdx());
|
396
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
397
|
-
}
|
398
|
-
else
|
399
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
400
|
-
}
|
401
|
-
else {
|
402
|
-
try {
|
403
|
-
await this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx(), true, true, true, SET_DISPLAYLINE_BY_DV);
|
404
|
-
}
|
405
|
-
catch (ex) {
|
406
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
407
|
-
}
|
408
|
-
else
|
409
|
-
throw ex;
|
410
|
-
}
|
411
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
412
|
-
}
|
413
|
-
}
|
414
|
-
}
|
415
|
-
async cancelEdit(isActCancel, isQuitEvent) {
|
416
|
-
let mode = this._task.getMode();
|
417
|
-
let newMode;
|
418
|
-
let row = 0;
|
419
|
-
let execRecPrefix = false;
|
420
|
-
if (this.GetDataview().getSize() === 1 && mode === Constants.TASK_MODE_CREATE)
|
421
|
-
newMode = Constants.TASK_MODE_CREATE;
|
422
|
-
else
|
423
|
-
newMode = Constants.TASK_MODE_MODIFY;
|
424
|
-
let recRemoved = await this.GetDataview().cancelEdit(false, false);
|
425
|
-
this.GetDataview().setPrevCurrRec(null);
|
426
|
-
if ((this.GetDataview().isEmpty() || ((isActCancel && recRemoved) && (!GuiEnvironment.Environment.GetSpecialCancelOnCreate()) && this._task.getOriginalTaskMode() === Constants.TASK_MODE_CREATE)) && !this._task.IsTryingToStop) {
|
427
|
-
let orgCancelWasRaised = this._task.cancelWasRaised();
|
428
|
-
this._task.setCancelWasRaised(isActCancel);
|
429
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
|
430
|
-
this._task.setCancelWasRaised(orgCancelWasRaised);
|
431
|
-
}
|
432
|
-
else if (isActCancel)
|
433
|
-
execRecPrefix = true;
|
434
|
-
if (!this.GetDataview().isEmpty()) {
|
435
|
-
if (super.isLineMode()) {
|
436
|
-
try {
|
437
|
-
if (super.HasTable()) {
|
438
|
-
row = this.getVisibleLine();
|
439
|
-
if (row < 0 || row >= this._rowsInPage) {
|
440
|
-
let topRecIdx = this.GetDataview().getTopRecIdx();
|
441
|
-
let currRecIdx = this.GetDataview().getCurrRecIdx();
|
442
|
-
if (topRecIdx > currRecIdx)
|
443
|
-
this.GetDataview().setTopRecIdx(currRecIdx);
|
444
|
-
row = 0;
|
445
|
-
}
|
446
|
-
await this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + row, false, true);
|
447
|
-
}
|
448
|
-
}
|
449
|
-
catch (ex) {
|
450
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
451
|
-
if (row !== 0)
|
452
|
-
Logger.Instance.WriteDevToLog(NString.Format("in Form.cancelEdit() {0}", ex.Message));
|
453
|
-
}
|
454
|
-
else
|
455
|
-
throw ex;
|
456
|
-
}
|
457
|
-
if (super.HasTable()) {
|
458
|
-
if (this.isTableWithAbsoluteScrollbar() && recRemoved) {
|
459
|
-
this.GetDataview().TotalRecordsCount--;
|
460
|
-
this.RefreshAllRows = true;
|
461
|
-
}
|
462
|
-
this.removeRecordsAfterIdx(this.GetDataview().getCurrRecIdx());
|
463
|
-
}
|
464
|
-
}
|
465
|
-
else {
|
466
|
-
try {
|
467
|
-
await this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx(), false, true, true, SET_DISPLAYLINE_BY_DV);
|
468
|
-
}
|
469
|
-
catch (ex) {
|
470
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
471
|
-
Logger.Instance.WriteDevToLog("in Form.cancelEdit() error in Screen mode for Current Record");
|
472
|
-
}
|
473
|
-
else
|
474
|
-
throw ex;
|
475
|
-
}
|
476
|
-
}
|
477
|
-
this._task.setMode(newMode);
|
478
|
-
if (!this._task.InEndTask)
|
479
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
480
|
-
if (!this._task.InEndTask)
|
481
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
482
|
-
}
|
483
|
-
if (execRecPrefix) {
|
484
|
-
this._task.setLevel(Constants.TASK_LEVEL_TASK);
|
485
|
-
let lastParkedCtrl = LastFocusedManager.getLastFocusedControl();
|
486
|
-
if (lastParkedCtrl !== null) {
|
487
|
-
if (lastParkedCtrl.getForm().getTask().pathContains(this._task))
|
488
|
-
for (let parent = lastParkedCtrl.getForm().getTask(); parent !== null && parent !== this._task; parent = parent.getParent()) {
|
489
|
-
parent.setLevel(Constants.TASK_LEVEL_TASK);
|
490
|
-
(parent.DataView.getCurrRec()).resetModified();
|
491
|
-
}
|
492
|
-
else
|
493
|
-
lastParkedCtrl.getForm().getTask().setLevel(Constants.TASK_LEVEL_TASK);
|
494
|
-
}
|
495
|
-
if (!isQuitEvent) {
|
496
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_REC_PREFIX);
|
497
|
-
await AccessHelper.eventsManager.HandleParkabilityOnRowChange(this._task);
|
498
|
-
}
|
499
|
-
}
|
500
|
-
}
|
501
|
-
async refreshOnExpressions() {
|
502
|
-
for (let i = 0; i < this.CtrlTab.getSize(); i = i + 1) {
|
503
|
-
let mgControl = ((this.CtrlTab.getCtrl(i) instanceof MgControl) ? this.CtrlTab.getCtrl(i) : null);
|
504
|
-
if (mgControl != null)
|
505
|
-
await mgControl.refreshOnExpression();
|
506
|
-
else
|
507
|
-
Debug.Assert(false);
|
508
|
-
}
|
509
|
-
await super.refreshPropsOnExpression();
|
510
|
-
}
|
511
|
-
removeRefsToCtrls() {
|
512
|
-
let lastFocusedControl = LastFocusedManager.getLastFocusedControl();
|
513
|
-
if (lastFocusedControl !== null && lastFocusedControl.getForm() === this)
|
514
|
-
LastFocusedManager.setLastFocusedControl(this._task, null);
|
515
|
-
super.removeRefsToCtrls();
|
516
|
-
}
|
517
|
-
getCtrlByCtrlName(ctrlName) {
|
518
|
-
return this.CtrlTab.getCtrl(ctrlName);
|
519
|
-
}
|
520
|
-
getSubFormCtrlByName(ctrlName) {
|
521
|
-
let guiParentTask;
|
522
|
-
let destSubForm = null;
|
523
|
-
for (guiParentTask = this._task; destSubForm === null && guiParentTask !== null && guiParentTask.getForm() !== null; guiParentTask = guiParentTask.getParent()) {
|
524
|
-
destSubForm = guiParentTask.getForm().getCtrlByName(ctrlName, MgControlType.CTRL_TYPE_SUBFORM);
|
525
|
-
if (destSubForm == null) {
|
526
|
-
if (!guiParentTask.IsSubForm || NString.Equals(guiParentTask.getForm().getSubFormCtrl().Name, ctrlName, true))
|
527
|
-
break;
|
528
|
-
}
|
529
|
-
}
|
530
|
-
return destSubForm;
|
531
|
-
}
|
532
|
-
setSuffixDone() {
|
533
|
-
this._suffixDone = true;
|
534
|
-
}
|
535
|
-
getDestinationRow() {
|
536
|
-
return this._destTblRow;
|
537
|
-
}
|
538
|
-
setSubFormCtrl(subFormCtrl) {
|
539
|
-
Debug.Assert(this._subFormCtrl === null && subFormCtrl !== null);
|
540
|
-
this._subFormCtrl = subFormCtrl;
|
541
|
-
}
|
542
|
-
getSubFormCtrlForTask(taskId) {
|
543
|
-
let curr = null;
|
544
|
-
let parentCtrlTab;
|
545
|
-
let guiParentForm = null;
|
546
|
-
let destSubForm = null;
|
547
|
-
for (guiParentForm = this; guiParentForm != null; guiParentForm = guiParentForm.ParentForm) {
|
548
|
-
parentCtrlTab = guiParentForm.CtrlTab;
|
549
|
-
for (let i = 0; i < parentCtrlTab.getSize(); i++) {
|
550
|
-
curr = ((parentCtrlTab.getCtrl(i) instanceof MgControl) ? parentCtrlTab.getCtrl(i) : null);
|
551
|
-
if (curr != null && curr.isSubform() && (curr.getSubformTaskId() != null))
|
552
|
-
if (curr.getSubformTaskId() === taskId) {
|
553
|
-
destSubForm = curr;
|
554
|
-
break;
|
555
|
-
}
|
556
|
-
}
|
557
|
-
if (destSubForm != null)
|
558
|
-
break;
|
559
|
-
}
|
560
|
-
return destSubForm;
|
561
|
-
}
|
562
|
-
removeRecordsAfterIdx(idx) {
|
563
|
-
let removeAll = false;
|
564
|
-
if (this.isTableWithPagination())
|
565
|
-
this.setTableItemsCount(false);
|
566
|
-
else {
|
567
|
-
if (idx <= this._rowsInPage + 1 && this.GetDataview().getSize() > this._rowsInPage)
|
568
|
-
idx = 0;
|
569
|
-
if (idx === 0)
|
570
|
-
removeAll = true;
|
571
|
-
super.SetTableItemsCount(idx, removeAll);
|
572
|
-
this.setTableItemsCount(false);
|
573
|
-
}
|
574
|
-
}
|
575
|
-
isRowValidated(idx) {
|
576
|
-
if (this.Rows.length <= idx || idx < 0)
|
577
|
-
return false;
|
578
|
-
let row = this.Rows.get_Item(idx);
|
579
|
-
if (row == null)
|
580
|
-
return false;
|
581
|
-
return row.Created && row.Validated;
|
582
|
-
}
|
583
|
-
async transferDataToGui() {
|
584
|
-
let saveRowIdx = this.GetDataview().getCurrRecIdx();
|
585
|
-
let maxTime = Misc.getSystemMilliseconds() + MgForm.TIME_LIMIT;
|
586
|
-
let updated = false;
|
587
|
-
let currentEditingControl = super.getTask().CurrentEditingControl;
|
588
|
-
try {
|
589
|
-
let bkpRecord = this.GetDataview().backupCurrent();
|
590
|
-
while (Misc.getSystemMilliseconds() < maxTime && this.RefreshRepeatableAllowed) {
|
591
|
-
if (this._lastRowSent + 1 >= this.GetDataview().getSize()) {
|
592
|
-
this.RefreshUI();
|
593
|
-
break;
|
594
|
-
}
|
595
|
-
else if (this.isTableWithPagination() && this._lastRowSent + 1 >= this.getMaxRowsInPaginatedTable()) {
|
596
|
-
this.RefreshUI();
|
597
|
-
break;
|
598
|
-
}
|
599
|
-
this._lastRowSent++;
|
600
|
-
this._transferringDataToGUI = true;
|
601
|
-
this.AllowedSubformRecompute = false;
|
602
|
-
if (!this.isRowValidated(this._lastRowSent)) {
|
603
|
-
super.checkAndCreateRow(this._lastRowSent);
|
604
|
-
if (this._lastRowSent !== saveRowIdx) {
|
605
|
-
super.getTask().CurrentEditingControl = null;
|
606
|
-
await this.setCurrRowByDisplayLine(this._lastRowSent, false, true);
|
607
|
-
await super.refreshControls(true);
|
608
|
-
updated = true;
|
609
|
-
}
|
610
|
-
}
|
611
|
-
this.AllowedSubformRecompute = true;
|
612
|
-
this._transferringDataToGUI = false;
|
613
|
-
}
|
614
|
-
if (updated) {
|
615
|
-
await this.restoreBackup(saveRowIdx, bkpRecord);
|
616
|
-
await super.refreshControls(true);
|
617
|
-
super.getTask().CurrentEditingControl = currentEditingControl;
|
618
|
-
}
|
619
|
-
}
|
620
|
-
catch (ex) {
|
621
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
622
|
-
Logger.Instance.WriteDevToLog(ex.Message);
|
623
|
-
}
|
624
|
-
else
|
625
|
-
throw ex;
|
626
|
-
}
|
627
|
-
this._transferingData = false;
|
628
|
-
this.checkAndCreateRowsEvent();
|
629
|
-
}
|
630
|
-
checkAndCreateRowsEvent() {
|
631
|
-
if (this._tableMgControl !== null && this.Opened && this.RefreshRepeatableAllowed) {
|
632
|
-
let size = this.GetDataview().getSize();
|
633
|
-
if (this._lastRowSent >= this.Rows.length) {
|
634
|
-
this._lastRowSent = this.Rows.length - 1;
|
635
|
-
}
|
636
|
-
let transferDataToGui = this._lastRowSent < (size - 1);
|
637
|
-
if (this.isTableWithPagination() && (this._lastRowSent + 1) >= this.getMaxRowsInPaginatedTable())
|
638
|
-
transferDataToGui = false;
|
639
|
-
if (transferDataToGui && !this._transferingData) {
|
640
|
-
AccessHelper.eventsManager.addInternalEventWithCtrlAndCodeAndPriority(this._tableMgControl, InternalInterface.MG_ACT_DV_TO_GUI, Priority.LOWEST);
|
641
|
-
this._transferingData = true;
|
642
|
-
}
|
643
|
-
else if (this.shouldFetchRecordsAheadFromServer && !transferDataToGui && (!this.GetDataview().IncludesLast() || !this.GetDataview().IncludesFirst())) {
|
644
|
-
AccessHelper.eventsManager.addInternalEventWithCtrlAndCodeAndPriority(this._tableMgControl, InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER, Priority.LOWEST);
|
645
|
-
}
|
646
|
-
}
|
647
|
-
}
|
648
|
-
async setRowData(desiredTopIndex, sendAll) {
|
649
|
-
let saveRowIdx = this.GetDataview().getCurrRecIdx();
|
650
|
-
let diff = 0;
|
651
|
-
let getPrevChunk = false;
|
652
|
-
let getNextChunk = false;
|
653
|
-
let updated = false;
|
654
|
-
if (desiredTopIndex !== Int32.MinValue) {
|
655
|
-
if (desiredTopIndex < 0) {
|
656
|
-
getPrevChunk = true;
|
657
|
-
this.GetDataview().setTopRecIdx(0);
|
658
|
-
}
|
659
|
-
else if (desiredTopIndex + this._rowsInPage + 1 >= this.GetDataview().getSize())
|
660
|
-
getNextChunk = true;
|
661
|
-
}
|
662
|
-
else
|
663
|
-
desiredTopIndex = this.GetDataview().getTopRecIdx();
|
664
|
-
let bkpRecord = this.GetDataview().backupCurrent();
|
665
|
-
this._transferringDataToGUI = true;
|
666
|
-
this.AllowedSubformRecompute = false;
|
667
|
-
let diffRef = new RefParam(diff);
|
668
|
-
updated = await this.refreshRows(desiredTopIndex, sendAll, saveRowIdx, diffRef);
|
669
|
-
diff = diffRef.value;
|
670
|
-
if ((getPrevChunk && diff !== 0) || getNextChunk) {
|
671
|
-
this.GetDataview().setTopRecIdx(desiredTopIndex + diff);
|
672
|
-
this.SetTableTopIndex();
|
673
|
-
if (this._topIndexUpdated) {
|
674
|
-
this._topIndexUpdated = false;
|
675
|
-
}
|
676
|
-
}
|
677
|
-
this.AllowedSubformRecompute = true;
|
678
|
-
this._transferringDataToGUI = false;
|
679
|
-
if (updated) {
|
680
|
-
await this.restoreBackup(saveRowIdx + diff, bkpRecord);
|
681
|
-
await super.refreshControls(true);
|
682
|
-
}
|
683
|
-
super.SelectRow();
|
684
|
-
if (getPrevChunk) {
|
685
|
-
let lastFocusedControl = LastFocusedManager.getLastFocusedControl();
|
686
|
-
if (lastFocusedControl !== null && lastFocusedControl.getParentTable() === this._tableMgControl) {
|
687
|
-
}
|
688
|
-
}
|
689
|
-
}
|
690
|
-
async refreshRows(desiredTopIndex, sendAll, saveRowIdx, diffRef) {
|
691
|
-
let index = 0;
|
692
|
-
let updated = false;
|
693
|
-
diffRef.value = 0;
|
694
|
-
let orgIncludesFirst = this.GetDataview().IncludesFirst();
|
695
|
-
let orgIncludesLast = this.GetDataview().IncludesLast();
|
696
|
-
for (let i = 0; i < this._rowsInPage; i++) {
|
697
|
-
let idx = desiredTopIndex + i;
|
698
|
-
let prevTopIdx = this.GetDataview().getTopRecIdx();
|
699
|
-
try {
|
700
|
-
index = idx + diffRef.value;
|
701
|
-
if (!this.isRowValidated(idx) || sendAll || this.RefreshAllRows) {
|
702
|
-
if (index >= 0)
|
703
|
-
super.checkAndCreateRow(index);
|
704
|
-
if (saveRowIdx + diffRef.value !== index) {
|
705
|
-
await this.setCurrRowByDisplayLine(index, false, true);
|
706
|
-
await super.refreshControls(true);
|
707
|
-
}
|
708
|
-
updated = true;
|
709
|
-
}
|
710
|
-
}
|
711
|
-
catch (ex) {
|
712
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
713
|
-
if (super.isRowCreated(index))
|
714
|
-
super.markRowNOTCreated(index);
|
715
|
-
break;
|
716
|
-
}
|
717
|
-
else
|
718
|
-
throw ex;
|
719
|
-
}
|
720
|
-
finally {
|
721
|
-
diffRef.value = diffRef.value + (this.GetDataview().getTopRecIdx() - prevTopIdx);
|
722
|
-
prevTopIdx = this.GetDataview().getTopRecIdx();
|
723
|
-
if (!updated && this.GetDataview().DataviewBoundriesAreChanged(orgIncludesFirst, orgIncludesLast))
|
724
|
-
updated = true;
|
725
|
-
}
|
726
|
-
}
|
727
|
-
this.RefreshUI();
|
728
|
-
this.RefreshAllRows = false;
|
729
|
-
return updated;
|
730
|
-
}
|
731
|
-
getVisibleLine() {
|
732
|
-
let currRecIdx = 0;
|
733
|
-
if (this.GetDataview().getCurrRecIdx() !== Int32.MinValue)
|
734
|
-
currRecIdx = this.GetDataview().getCurrRecIdx();
|
735
|
-
return currRecIdx - Math.max(this.GetDataview().getTopRecIdx(), 0);
|
736
|
-
}
|
737
|
-
async bringRecordToPage() {
|
738
|
-
if (this._tableMgControl !== null && !this._task.DataView.isEmptyDataview()) {
|
739
|
-
let topIndex = Commands.getTopIndex(this._tableMgControl);
|
740
|
-
let currIdx = this.GetDataview().getCurrRecIdx();
|
741
|
-
let newTopIndex = topIndex;
|
742
|
-
if (!this.isTableWithPagination()) {
|
743
|
-
if (topIndex > currIdx) {
|
744
|
-
this._topIndexUpdated = true;
|
745
|
-
newTopIndex = currIdx;
|
746
|
-
}
|
747
|
-
else if (topIndex + this._rowsInPage - 1 < currIdx) {
|
748
|
-
this._topIndexUpdated = true;
|
749
|
-
if (this._rowsInPage > 0)
|
750
|
-
newTopIndex = currIdx - this._rowsInPage + 1;
|
751
|
-
else
|
752
|
-
newTopIndex = currIdx;
|
753
|
-
}
|
754
|
-
}
|
755
|
-
else {
|
756
|
-
let currGuiIdx = this.getGuiRowidx(currIdx);
|
757
|
-
let newTopGuiIndex = (currGuiIdx) - ((currGuiIdx) % this._rowsInPage);
|
758
|
-
newTopIndex = this.getDvRowIdx(newTopGuiIndex);
|
759
|
-
if (newTopIndex !== this._prevGuiTopIndex || this.IsMovingInView)
|
760
|
-
this._topIndexUpdated = true;
|
761
|
-
}
|
762
|
-
if (this.GetDataview().getTopRecIdx() !== newTopIndex || this._topIndexUpdated) {
|
763
|
-
this.GetDataview().setTopRecIdx(newTopIndex);
|
764
|
-
this.SetTableTopIndex();
|
765
|
-
await this.setRowData(Int32.MinValue, false);
|
766
|
-
this._topIndexUpdated = false;
|
767
|
-
}
|
768
|
-
}
|
769
|
-
}
|
770
|
-
invalidateTable() {
|
771
|
-
for (let i = 0; i < this.Rows.length; i++) {
|
772
|
-
let row = this.Rows.get_Item(i);
|
773
|
-
if (row !== null)
|
774
|
-
row.Validated = false;
|
775
|
-
}
|
776
|
-
this._lastRowSent = -1;
|
777
|
-
this.checkAndCreateRowsEvent();
|
778
|
-
}
|
779
|
-
getPrevLine(line) {
|
780
|
-
return line - 1;
|
781
|
-
}
|
782
|
-
clearTableColumnSortMark(clearSortMark) {
|
783
|
-
if (clearSortMark) {
|
784
|
-
}
|
785
|
-
}
|
786
|
-
async stopRowEditing(idx) {
|
787
|
-
if (this.getIsRowEditingFromGui(idx)) {
|
788
|
-
Commands.addValueWithLine(CommandType.SET_NOT_IS_ROW_EDITING, this, this.isLineMode() ? idx : 0, this.isLineMode());
|
789
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
790
|
-
Commands.addNoParameters(CommandType.REFRESH_TASK, this.getForm());
|
791
|
-
}
|
792
|
-
}
|
793
|
-
async startRowEditing(idx) {
|
794
|
-
if (!this.getIsRowEditingFromGui(idx)) {
|
795
|
-
Commands.addValueWithLine(CommandType.SET_IS_ROW_EDITING, this, this.isLineMode() ? idx : 0, this.isLineMode());
|
796
|
-
await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
797
|
-
Commands.addNoParameters(CommandType.REFRESH_TASK, this.getForm());
|
798
|
-
}
|
799
|
-
}
|
800
|
-
getIsRowEditingFromGui(displayIndex) {
|
801
|
-
let isRowEditing = Commands.getIsRowEditing(this, this.isLineMode() ? displayIndex : 0, this.isLineMode());
|
802
|
-
return isRowEditing;
|
803
|
-
}
|
804
|
-
async RefreshDisplay(refreshType) {
|
805
|
-
let task = this._task;
|
806
|
-
if (this.isFetchingRecordsAhead)
|
807
|
-
return false;
|
808
|
-
if (task.isAborting())
|
809
|
-
return false;
|
810
|
-
let currRec = this.GetDataview().getCurrRec();
|
811
|
-
if (currRec !== null && currRec.InCompute && !currRec.isNewRec())
|
812
|
-
return false;
|
813
|
-
if (this._inRefreshDisp)
|
814
|
-
return false;
|
815
|
-
this._inRefreshDisp = true;
|
816
|
-
try {
|
817
|
-
if (refreshType === Constants.TASK_REFRESH_FORM || refreshType === Constants.TASK_REFRESH_TABLE) {
|
818
|
-
if (super.HasTable() && this.Opened)
|
819
|
-
await this.refreshTable();
|
820
|
-
}
|
821
|
-
if (refreshType === Constants.TASK_REFRESH_FORM || refreshType === Constants.TASK_REFRESH_CURR_REC) {
|
822
|
-
if (refreshType === Constants.TASK_REFRESH_CURR_REC && super.hasTable()) {
|
823
|
-
this.SetTableTopIndex();
|
824
|
-
super.SelectRow();
|
825
|
-
await this.fetchPrevChunkForCurrentPage();
|
826
|
-
}
|
827
|
-
await super.refreshProps();
|
828
|
-
await super.refreshControls(false);
|
829
|
-
}
|
830
|
-
}
|
831
|
-
catch (ex) {
|
832
|
-
if (ex instanceof Exception) {
|
833
|
-
Logger.Instance.WriteExceptionToLogWithMsg(NString.Format("{0} : {1} in task {2}", ex.GetType(), ex.Message, super.getTask().PreviouslyActiveTaskId));
|
834
|
-
}
|
835
|
-
else
|
836
|
-
throw ex;
|
837
|
-
}
|
838
|
-
finally {
|
839
|
-
this._inRefreshDisp = false;
|
840
|
-
}
|
841
|
-
if (refreshType === Constants.TASK_REFRESH_CURR_REC && (!super.isLineMode() || this._tableRefreshed)) {
|
842
|
-
this.FormRefreshed = true;
|
843
|
-
if (this._task.isFirstRecordCycle() || AccessHelper.eventsManager.getIsInViewRefresh()) {
|
844
|
-
Commands.addNoParameters(CommandType.SET_WC_IDLE, this);
|
845
|
-
AccessHelper.eventsManager.setIsInViewRefresh(false);
|
846
|
-
}
|
847
|
-
}
|
848
|
-
return true;
|
849
|
-
}
|
850
|
-
RefreshUI() {
|
851
|
-
if (!this.getTask().isMainProg()) {
|
852
|
-
Commands.addNoParameters(CommandType.REFRESH_TASK, this.getForm());
|
853
|
-
}
|
854
|
-
}
|
855
|
-
async refreshTable() {
|
856
|
-
if (this.isFetchingRecordsAhead)
|
857
|
-
return;
|
858
|
-
Logger.Instance.WriteGuiToLog("Start form.refreshTable()");
|
859
|
-
this.updateDisplayLineByDV();
|
860
|
-
let oldCurrRow = this.DisplayLine;
|
861
|
-
let currRecIdx = this.GetDataview().getCurrRecIdx();
|
862
|
-
if (!this._tableRefreshed && currRecIdx >= 0) {
|
863
|
-
oldCurrRow = this.GetDataview().getCurrRecIdx();
|
864
|
-
if (oldCurrRow + 1 > this._rowsInPage)
|
865
|
-
this.GetDataview().setTopRecIdx(oldCurrRow - Math.floor(this._rowsInPage / 2) + 1);
|
866
|
-
else
|
867
|
-
this.GetDataview().setTopRecIdx(0);
|
868
|
-
}
|
869
|
-
else {
|
870
|
-
if (oldCurrRow === Int32.MinValue)
|
871
|
-
oldCurrRow = 0;
|
872
|
-
if (this.GetDataview().getTopRecIdx() === Int32.MinValue)
|
873
|
-
this.GetDataview().setTopRecIdx(currRecIdx);
|
874
|
-
}
|
875
|
-
if (this.GetDataview().getTopRecIdx() < 0)
|
876
|
-
return;
|
877
|
-
oldCurrRow = oldCurrRow - this.GetDataview().getTopRecIdx();
|
878
|
-
let bkpRecord = this.GetDataview().backupCurrent();
|
879
|
-
this._tableRefreshed = true;
|
880
|
-
let oriTransferDataToGui = this._transferringDataToGUI;
|
881
|
-
if (!oriTransferDataToGui)
|
882
|
-
this._transferringDataToGUI = true;
|
883
|
-
this.AllowedSubformRecompute = false;
|
884
|
-
for (let i = 0; i < this._rowsInPage; i++) {
|
885
|
-
let topIndex = this.GetDataview().getTopRecIdx();
|
886
|
-
if (topIndex < 0) {
|
887
|
-
this.GetDataview().setTopRecIdx(0);
|
888
|
-
topIndex = 0;
|
889
|
-
}
|
890
|
-
let idx = topIndex + i;
|
891
|
-
try {
|
892
|
-
super.checkAndCreateRow(idx);
|
893
|
-
if (i !== oldCurrRow) {
|
894
|
-
await this.setCurrRowByDisplayLine(idx, false, true);
|
895
|
-
await super.refreshControls(true);
|
896
|
-
}
|
897
|
-
}
|
898
|
-
catch (ex) {
|
899
|
-
if (ex.name == "RecordOutOfDataViewException") {
|
900
|
-
if (super.isRowCreated(idx))
|
901
|
-
super.markRowNOTCreated(idx);
|
902
|
-
break;
|
903
|
-
}
|
904
|
-
else
|
905
|
-
throw ex;
|
906
|
-
}
|
907
|
-
}
|
908
|
-
this.AllowedSubformRecompute = true;
|
909
|
-
if (!oriTransferDataToGui)
|
910
|
-
this._transferringDataToGUI = false;
|
911
|
-
await this.restoreBackup(oldCurrRow + this.GetDataview().getTopRecIdx(), bkpRecord);
|
912
|
-
await super.refreshControls(true);
|
913
|
-
this.RefreshUI();
|
914
|
-
Logger.Instance.WriteGuiToLog("End form.refreshTable()");
|
915
|
-
}
|
916
|
-
updateDisplayLineByDV() {
|
917
|
-
this.DisplayLine = this.recordIdx2DisplayLine(this.GetDataview().getCurrRecIdx());
|
918
|
-
}
|
919
|
-
async setCurrRowByDisplayLine(displayLine, doSuffix, ignoreCurrRec) {
|
920
|
-
let recIdx = this.displayLine2RecordIdx(displayLine);
|
921
|
-
await this.setCurrRowByRecIdx(recIdx, doSuffix, ignoreCurrRec, displayLine);
|
922
|
-
if (super.HasTable())
|
923
|
-
this.updateDisplayLineByDV();
|
924
|
-
else
|
925
|
-
this.DisplayLine = displayLine;
|
926
|
-
}
|
927
|
-
async setCurrRowByRecIdx(rowNum, doSuffix, ignoreCurrRec, displayLine) {
|
928
|
-
if (this.GetDataview() === null || (!super.hasTable() && rowNum !== 0))
|
929
|
-
throw new ApplicationException("in Form.setCurrRow() no table ");
|
930
|
-
try {
|
931
|
-
this._destTblRow = rowNum;
|
932
|
-
await this.GetDataview().setCurrRecByIdx(rowNum, doSuffix, ignoreCurrRec, true, displayLine);
|
933
|
-
}
|
934
|
-
finally {
|
935
|
-
this._destTblRow = rowNum - this.GetDataview().getTopRecIdx();
|
936
|
-
}
|
937
|
-
}
|
938
|
-
getLastValidRow() {
|
939
|
-
return Math.min(this._rowsInPage - 1, this.GetDataview().getSize() - 1 - this.GetDataview().getTopRecIdx());
|
940
|
-
}
|
941
|
-
recordIdx2DisplayLine(recIdx) {
|
942
|
-
return recIdx;
|
943
|
-
}
|
944
|
-
displayLine2RecordIdx(displayLine) {
|
945
|
-
return displayLine;
|
946
|
-
}
|
947
|
-
async restoreOldDisplayLine(displayLine) {
|
948
|
-
try {
|
949
|
-
this._inRestore = true;
|
950
|
-
await this.setCurrRowByDisplayLine(displayLine, false, true);
|
951
|
-
}
|
952
|
-
catch (ex) {
|
953
|
-
if (ex instanceof RecordOutOfDataViewException) {
|
954
|
-
}
|
955
|
-
else
|
956
|
-
throw ex;
|
957
|
-
}
|
958
|
-
finally {
|
959
|
-
this._inRestore = false;
|
960
|
-
}
|
961
|
-
}
|
962
|
-
getTopIndexFromGUI() {
|
963
|
-
let topDisplayLine = super.getTopIndexFromGUI();
|
964
|
-
if (super.hasTable())
|
965
|
-
this.GetDataview().setTopRecIdx(this.displayLine2RecordIdx(topDisplayLine));
|
966
|
-
return topDisplayLine;
|
967
|
-
}
|
968
|
-
getCurrRecPosInForm() {
|
969
|
-
let topDisplayLine = super.getTopIndexFromGUI();
|
970
|
-
return this.DisplayLine - topDisplayLine + 1;
|
971
|
-
}
|
972
|
-
async restoreBackup(oldDisplayLine, bkpRecord) {
|
973
|
-
if (bkpRecord.getId() >= 0 && this.GetDataview().getRecIdx(bkpRecord.getId()) >= 0 && oldDisplayLine >= 0 && oldDisplayLine < this.GetDataview().getSize() && this.GetDataview().getCurrRecIdx() >= 0 && bkpRecord.getMode() === DataModificationTypes.None) {
|
974
|
-
this.GetDataview().restoreCurrent(bkpRecord);
|
975
|
-
this.updateDisplayLineByDV();
|
976
|
-
}
|
977
|
-
else
|
978
|
-
await this.restoreOldDisplayLine(oldDisplayLine);
|
979
|
-
}
|
980
|
-
ConstructMgControl(type, taskOrParentMgForm, parentControlOrParentControlIdx) {
|
981
|
-
if (arguments.length === 0) {
|
982
|
-
return this.ConstructMgControl_0();
|
983
|
-
}
|
984
|
-
if (arguments.length === 3 && (type === null || type.constructor === Number) && (taskOrParentMgForm === null || taskOrParentMgForm instanceof TaskBase) && (parentControlOrParentControlIdx === null || parentControlOrParentControlIdx.constructor === Number)) {
|
985
|
-
return this.ConstructMgControl_1(type, taskOrParentMgForm, parentControlOrParentControlIdx);
|
986
|
-
}
|
987
|
-
return this.ConstructMgControl_2(type, taskOrParentMgForm, parentControlOrParentControlIdx);
|
988
|
-
}
|
989
|
-
ConstructMgControl_0() {
|
990
|
-
return new MgControl();
|
991
|
-
}
|
992
|
-
ConstructMgControl_1(type, task, parentControl) {
|
993
|
-
return new MgControl(type, task, parentControl);
|
994
|
-
}
|
995
|
-
ConstructMgControl_2(type, parentMgForm, parentControlIdx) {
|
996
|
-
return new MgControl(type, parentMgForm, parentControlIdx);
|
997
|
-
}
|
998
|
-
alreadyMovedToFirstControl() {
|
999
|
-
return this._task.getMGData().AlreadyMovedToFirstControl();
|
1000
|
-
}
|
1001
|
-
async firstTableRefresh() {
|
1002
|
-
if (this._tableMgControl !== null) {
|
1003
|
-
super.firstTableRefresh();
|
1004
|
-
this.setTableItemsCount(false);
|
1005
|
-
await this.refreshTable();
|
1006
|
-
super.SelectRow();
|
1007
|
-
}
|
1008
|
-
}
|
1009
|
-
InsertTableItems(idx, count) {
|
1010
|
-
if (this._tableMgControl != null) {
|
1011
|
-
this.Rows.InsertRange(new Array(count));
|
1012
|
-
this.InsertTableChildrenArrays(idx, count);
|
1013
|
-
this._lastRowSent = -1;
|
1014
|
-
}
|
1015
|
-
this.setTableItemsCount(false);
|
1016
|
-
}
|
1017
|
-
setTableItemsCount(removeAll) {
|
1018
|
-
let tableItemsCount;
|
1019
|
-
if (this.isTableWithAbsoluteScrollbar()) {
|
1020
|
-
if (this._task.getOriginalTaskMode() === Constants.TASK_MODE_CREATE
|
1021
|
-
&& this._task.getMode() == Constants.TASK_MODE_CREATE) {
|
1022
|
-
tableItemsCount = this.GetDataview().getSize();
|
1023
|
-
if (this.GetDataview().RecordsBeforeCurrentView > 0) {
|
1024
|
-
this.GetDataview().RecordsBeforeCurrentView = 0;
|
1025
|
-
this.SetRecordsBeforeCurrentView(0);
|
1026
|
-
this.RefreshUI();
|
1027
|
-
}
|
1028
|
-
}
|
1029
|
-
else {
|
1030
|
-
tableItemsCount = (this.GetDataview().TotalRecordsCount > 0) ? this.GetDataview().TotalRecordsCount : 1;
|
1031
|
-
this.SetRecordsBeforeCurrentView(this.GetDataview().RecordsBeforeCurrentView);
|
1032
|
-
}
|
1033
|
-
}
|
1034
|
-
else {
|
1035
|
-
tableItemsCount = this.GetDataview().getSize();
|
1036
|
-
}
|
1037
|
-
super.SetTableItemsCount(this.GetDataview().getSize(), tableItemsCount, removeAll);
|
1038
|
-
}
|
1039
|
-
InitTableControl(dvSize, tableItemsCount, removeAll) {
|
1040
|
-
if (arguments.length === 0) {
|
1041
|
-
this.InitTableControl_00();
|
1042
|
-
return;
|
1043
|
-
}
|
1044
|
-
this.InitTableControl_01(dvSize, tableItemsCount, removeAll);
|
1045
|
-
}
|
1046
|
-
InitTableControl_00() {
|
1047
|
-
let dvSize = 1;
|
1048
|
-
let tableItemsCount = 1;
|
1049
|
-
if (this.isTableWithAbsoluteScrollbar() && this.GetDataview().TotalRecordsCount > 0) {
|
1050
|
-
let recordsBeforeCurrentView = this.GetDataview().RecordsBeforeCurrentView;
|
1051
|
-
tableItemsCount = this.GetDataview().TotalRecordsCount;
|
1052
|
-
Commands.addWithNumber(CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW, this._tableMgControl, recordsBeforeCurrentView);
|
1053
|
-
}
|
1054
|
-
this.InitTableControl(dvSize, tableItemsCount, false);
|
1055
|
-
this.SetTableTopIndex();
|
1056
|
-
}
|
1057
|
-
InitTableControl_01(dvSize, tableItemsCount, removeAll) {
|
1058
|
-
if (this._tableMgControl !== null) {
|
1059
|
-
if (removeAll) {
|
1060
|
-
Commands.addBoolWithLine(CommandType.SET_TABLE_INCLUDES_FIRST, this._tableMgControl, 0, true);
|
1061
|
-
Commands.addBoolWithLine(CommandType.SET_TABLE_INCLUDES_LAST, this._tableMgControl, 0, true);
|
1062
|
-
}
|
1063
|
-
else {
|
1064
|
-
Commands.addBoolWithLine(CommandType.SET_TABLE_INCLUDES_FIRST, this._tableMgControl, 0, this.GetDataview().IncludesFirst() || this.GetDataview().IsOneWayKey);
|
1065
|
-
Commands.addBoolWithLine(CommandType.SET_TABLE_INCLUDES_LAST, this._tableMgControl, 0, this.GetDataview().IncludesLast());
|
1066
|
-
Commands.addBoolWithLine(CommandType.SET_EMPTY_DATAVIEW, this._tableMgControl, 0, this.GetDataview().isEmptyDataview());
|
1067
|
-
}
|
1068
|
-
super.InitTableControl(dvSize, tableItemsCount, removeAll);
|
1069
|
-
this.checkAndCreateRowsEvent();
|
1070
|
-
}
|
1071
|
-
}
|
1072
|
-
SetTableTopIndex() {
|
1073
|
-
if (this._tableMgControl !== null) {
|
1074
|
-
let index = this.GetDataview().getTopRecIdx();
|
1075
|
-
if (index === Int32.MinValue)
|
1076
|
-
index = 0;
|
1077
|
-
if (!this.isTableWithPagination()) {
|
1078
|
-
if (this.GetDataview().IncludesLast()) {
|
1079
|
-
if (index + this._rowsInPage > this.GetDataview().getSize()) {
|
1080
|
-
if (this.GetDataview().IncludesFirst() || this.GetDataview().getSize() > this._rowsInPage + 1) {
|
1081
|
-
index = Math.max(this.GetDataview().getSize() - this._rowsInPage, 0);
|
1082
|
-
this.GetDataview().setTopRecIdx(index);
|
1083
|
-
this._topIndexUpdated = true;
|
1084
|
-
}
|
1085
|
-
}
|
1086
|
-
}
|
1087
|
-
}
|
1088
|
-
if (index !== this._prevGuiTopIndex || this.IsMovingInView) {
|
1089
|
-
Commands.addWithNumber(CommandType.SET_TABLE_TOP_INDEX, this._tableMgControl, index);
|
1090
|
-
this._prevGuiTopIndex = this.getGuiRowidx(index);
|
1091
|
-
}
|
1092
|
-
}
|
1093
|
-
}
|
1094
|
-
createForm() {
|
1095
|
-
super.createForm();
|
1096
|
-
MgForm.CreatedForms.add(this);
|
1097
|
-
}
|
1098
|
-
UpdateStatusBar() {
|
1099
|
-
}
|
1100
|
-
initInnerObjects(foundTagName) {
|
1101
|
-
if (foundTagName === null)
|
1102
|
-
return false;
|
1103
|
-
let parser = Manager.GetCurrentRuntimeContext().Parser;
|
1104
|
-
if (foundTagName === XMLConstants.MG_TAG_RECOMPUTE) {
|
1105
|
-
Logger.Instance.WriteDevToLog("goes to recompute form");
|
1106
|
-
this._task.RecomputeFillData(parser);
|
1107
|
-
return true;
|
1108
|
-
}
|
1109
|
-
return super.initInnerObjects(foundTagName);
|
1110
|
-
}
|
1111
|
-
toString() {
|
1112
|
-
return "{" + this.constructor.name + ": task=" + this._task + ", Id=" + this._userStateId + "}";
|
1113
|
-
}
|
1114
|
-
GetHiddenControlListXML() {
|
1115
|
-
let xml = new StringBuilder();
|
1116
|
-
if (this.hiddenControlsIsnsList !== null && this.hiddenControlsIsnsList.length > 0) {
|
1117
|
-
xml.Append("<" + ConstInterface.MG_TAG_HIDDEN_CONTOLS + " " + ConstInterface.MG_ATTR_ISNS + "=\"");
|
1118
|
-
this.hiddenControlsIsnsList.forEach((change) => {
|
1119
|
-
xml.Append(change + ",");
|
1120
|
-
});
|
1121
|
-
xml.Remove(xml.Length - 1, 1);
|
1122
|
-
xml.Append("\"/>");
|
1123
|
-
this.hiddenControlsIsnsList = null;
|
1124
|
-
}
|
1125
|
-
return xml.ToString();
|
1126
|
-
}
|
1127
|
-
ShouldBehaveAsModal() {
|
1128
|
-
let shouldBeModal = false;
|
1129
|
-
if (!this._task.IsInteractive && !this._task.isMainProg())
|
1130
|
-
shouldBeModal = TaskBase.ShouldNonInteractiveBeModal();
|
1131
|
-
else {
|
1132
|
-
let parentTask = this._task.ParentTask;
|
1133
|
-
if (parentTask !== null && !parentTask.IsInteractive && !parentTask.isMainProg())
|
1134
|
-
shouldBeModal = parentTask.ShouldNonInteractiveChildBeModal();
|
1135
|
-
}
|
1136
|
-
return shouldBeModal;
|
1137
|
-
}
|
1138
|
-
isTableWithPagination() {
|
1139
|
-
return this.isTableWithAbsoluteScrollbar();
|
1140
|
-
}
|
1141
|
-
isTableWithAbsoluteScrollbar() {
|
1142
|
-
let tableWithAbsoluteScrollbar = false;
|
1143
|
-
if (this._tableMgControl !== null)
|
1144
|
-
tableWithAbsoluteScrollbar = this._tableMgControl.IsTableWithAbsoluteScrollbar();
|
1145
|
-
return tableWithAbsoluteScrollbar;
|
1146
|
-
}
|
1147
|
-
SetRecordsBeforeCurrentView(value) {
|
1148
|
-
if (this._tableMgControl !== null) {
|
1149
|
-
Commands.addWithNumber(CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW, this._tableMgControl, value);
|
1150
|
-
}
|
1151
|
-
}
|
1152
|
-
buildFormName() {
|
1153
|
-
let name = this.UniqueName;
|
1154
|
-
let task = this.getTask();
|
1155
|
-
name = (task.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue() + '_' + name;
|
1156
|
-
while (task.IsSubtask) {
|
1157
|
-
task = task.StudioParentTask;
|
1158
|
-
name = (task.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue() + '_' + name;
|
1159
|
-
}
|
1160
|
-
name = name.replace(/ /g, "_");
|
1161
|
-
name = name.replace(/-/g, "_");
|
1162
|
-
return name;
|
1163
|
-
}
|
1164
|
-
async fetchPrevChunkForCurrentPage() {
|
1165
|
-
if (this.isTableWithAbsoluteScrollbar() && this.GetDataview().TotalRecordsCount > 0) {
|
1166
|
-
let recPosOnPage = this.GetDataview().RecordsBeforeCurrentView % this._rowsInPage;
|
1167
|
-
if (recPosOnPage > 0 && this.DisplayLine === 0) {
|
1168
|
-
await this.setRowData(-recPosOnPage, false);
|
1169
|
-
}
|
1170
|
-
}
|
1171
|
-
}
|
1172
|
-
getGuiRowidx(dvRowIdx) {
|
1173
|
-
return dvRowIdx + this.GetDataview().RecordsBeforeCurrentView;
|
1174
|
-
}
|
1175
|
-
getDvRowIdx(guiRowIdx) {
|
1176
|
-
return guiRowIdx - this.GetDataview().RecordsBeforeCurrentView;
|
1177
|
-
}
|
1178
|
-
}
|
1179
|
-
MgForm.TIME_LIMIT = 50;
|
1180
|
-
MgForm._createdForms = new CreatedFormVector();
|
1181
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWdGb3JtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3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XNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0ZPUk0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXRjaCAoZXgpIHtcclxuICAgICAgICAgIGlmIChleCBpbnN0YW5jZW9mIFJlY29yZE91dE9mRGF0YVZpZXdFeGNlcHRpb24pXHJcbiAgICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKGV4Lk1lc3NhZ2UpO1xyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgICAvLyBwYWdlIGFuZCByb3cgbW92ZW1lbnRzXHJcbiAgICAgIGVsc2Uge1xyXG4gICAgICAgIHRoaXMuZ2V0VG9wSW5kZXhGcm9tR1VJKCk7XHJcbiAgICAgICAgLy8gY2FsY3VsYXRlIHRoZSBhbW91bnQgb2YgcmVjb3JkcyB0byBza2lwXHJcbiAgICAgICAgbGV0IHNpemU6IG51bWJlcjtcclxuICAgICAgICBpZiAodW5pdCA9PT0gQ29uc3RhbnRzLk1PVkVfVU5JVF9QQUdFICYmIHRoaXMuaXNMaW5lTW9kZSgpKSB7XHJcbiAgICAgICAgICBzd2l0Y2ggKGRpcmVjdGlvbikge1xyXG4gICAgICAgICAgICBjYXNlIENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9CRUdJTjpcclxuICAgICAgICAgICAgICBzaXplID0gdGhpcy5HZXREYXRhdmlldygpLmdldEN1cnJSZWNJZHgoKSAtIHRoaXMuR2V0RGF0YXZpZXcoKS5nZXRUb3BSZWNJZHgoKTtcclxuICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBDb25zdGFudHMuTU9WRV9ESVJFQ1RJT05fRU5EOlxyXG5cclxuICAgICAgICAgICAgICBsZXQgbGFzdDogbnVtYmVyID0gdGhpcy5HZXREYXRhdmlldygpLmdldFRvcFJlY0lkeCgpICsgdGhpcy5fcm93c0luUGFnZSAtIDE7XHJcbiAgICAgICAgICAgICAgbGFzdCA9IE1hdGgubWluKGxhc3QsIHRoaXMuR2V0RGF0YXZpZXcoKS5nZXRTaXplKCkgLSAxKTtcclxuICAgICAgICAgICAgICBzaXplID0gbGFzdCAtIHRoaXMuR2V0RGF0YXZpZXcoKS5nZXRDdXJyUmVjSWR4KCk7XHJcbiAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgcmV0dXJuVG9WaXNpYmxlTGluZSA9IHRydWU7XHJcbiAgICAgICAgICAgICAgc2l6ZSA9IHRoaXMuX3Jvd3NJblBhZ2U7XHJcbiAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICAgIHNpemUgPSAxO1xyXG5cclxuICAgICAgICBzaXplID0gKGRpcmVjdGlvbiA9PT0gQ29uc3RhbnRzLk1PVkVfRElSRUNUSU9OX1BSRVYgfHxcclxuICAgICAgICBkaXJlY3Rpb24gPT09IENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9CRUdJTlxyXG4gICAgICAgICAgPyAtc2l6ZVxyXG4gICAgICAgICAgOiBzaXplKTtcclxuXHJcbiAgICAgICAgaWYgKHRoaXMuaXNMaW5lTW9kZSgpKSB7XHJcbiAgICAgICAgICB2aXNpYmxlTGluZSA9IHRoaXMuZ2V0VmlzaWJsZUxpbmUoKTtcclxuICAgICAgICAgIGlmICh2aXNpYmxlTGluZSA8IDApIHtcclxuICAgICAgICAgICAgdmlzaWJsZUxpbmUgPSAwO1xyXG4gICAgICAgICAgICByZWNvcmRPdXRPZlZpZXcgPSB0cnVlO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgaWYgKHZpc2libGVMaW5lID4gdGhpcy5fcm93c0luUGFnZSArIDEpIHtcclxuICAgICAgICAgICAgdmlzaWJsZUxpbmUgPSB0aGlzLl9yb3dzSW5QYWdlO1xyXG4gICAgICAgICAgICByZWNvcmRPdXRPZlZpZXcgPSB0cnVlO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgLy8gc2Nyb2xsaW5nIHRoZSB0YWJsZSBvbmUgcGFnZSBvciBvbmUgcm93IHVwIG9yIGRvd25cclxuICAgICAgICAgIGlmICh1bml0ID09PSBDb25zdGFudHMuTU9WRV9VTklUX1BBR0UgJiZcclxuICAgICAgICAgICAgKGRpcmVjdGlvbiA9PT0gQ29uc3RhbnRzLk1PVkVfRElSRUNUSU9OX05FWFQgfHxcclxuICAgICAgICAgICAgICBkaXJlY3Rpb24gPT09IENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9QUkVWKSB8fFxyXG4gICAgICAgICAgICB1bml0ID09PSBDb25zdGFudHMuTU9WRV9VTklUX1JPVyAmJlxyXG4gICAgICAgICAgICAoZGlyZWN0aW9uID09PSBDb25zdGFudHMuTU9WRV9ESVJFQ1RJT05fTkVYVCAmJiB2aXNpYmxlTGluZSA9PT0gdGhpcy5fcm93c0luUGFnZSAtIDEgfHxcclxuICAgICAgICAgICAgICBkaXJlY3Rpb24gPT09IENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9QUkVWICYmIHZpc2libGVMaW5lID09PSAwKSkge1xyXG4gICAgICAgICAgICAvLyBpZiB3ZSBtb3ZlIHRvIHRoZSBwcmV2aW91cyByb3cgYnV0IHdlIGFyZSBhdCB0aGUgZmlyc3Qgcm93IG9mIHRoZSB0YWJsZSBhbmQgZGF0YSB2aWV3XHJcbiAgICAgICAgICAgIC8vIHRoZW4gZG8gbm90aGluZ1xyXG4gICAgICAgICAgICBpZiAoZGlyZWN0aW9uID09PSBDb25zdGFudHMuTU9WRV9ESVJFQ1RJT05fUFJFViAmJlxyXG4gICAgICAgICAgICAgICh1bml0ID09PSBDb25zdGFudHMuTU9WRV9VTklUX1JPVyB8fCB1bml0ID09PSBDb25zdGFudHMuTU9WRV9VTklUX1BBR0UpICYmXHJcbiAgICAgICAgICAgICAgdmlzaWJsZUxpbmUgPT09I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ZmaXhEb25lID0gZmFsc2U7XHJcblxyXG4gICAgICAgICAgICAgIGF3YWl0IHRoaXMuc2V0Q3VyclJvd0J5RGlzcGxheUxpbmUodGhpcy5HZXREYXRhdmlldygpLmdldEN1cnJSZWNJZHgoKSArIHNpemUsIHRydWUsIGZhbHNlKTtcclxuICAgICAgICAgICAgICAoPERhdGFWaWV3PnRoaXMuR2V0RGF0YXZpZXcoKSkuc2V0VG9wUmVjSWR4TW9kaWZpZWQoZmFsc2UpO1xyXG4gICAgICAgICAgICAgIGF3YWl0IHRoaXMuUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9GT1JNKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXRjaCAoZXgpIHtcclxuICAgICAgICAgICAgICBpZiAoZXggaW5zdGFuY2VvZiBSZWNvcmRPdXRPZkRhdGFWaWV3RXhjZXB0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAoPERhdGFWaWV3PnRoaXMuR2V0RGF0YXZpZXcoKSkuc2V0VG9wUmVjSWR4TW9kaWZpZWQoZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgaWYgKEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLkdldFN0b3BFeGVjdXRpb25GbGFnKCkpIHtcclxuICAgICAgICAgICAgICAgICAgKDxEYXRhVmlldz50aGlzLkdldERhdGF2aWV3KCkpLnJlc3RvcmVUb3BSZWNJZHgoKTtcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5yZXN0b3JlT2xkRGlzcGxheUxpbmUob2xkRGlzcGxheUxpbmUpO1xyXG4gICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5HZXREYXRhdmlldygpLmdldFRvcFJlY0lkeCgpIDwgMCkge1xyXG4gICAgICAgICAgICAgICAgICB0aGlzLkdldERhdGF2aWV3KCkuc2V0VG9wUmVjSWR4KDApO1xyXG4gICAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuc2V0Q3VyclJvd0J5RGlzcGxheUxpbmUoMCwgdHJ1ZSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIGNhdGNoIChleGNlcHRpb24pIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoZXhjZXB0aW9uIGluc3RhbmNlb2YgRXhjZXB0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAvLyBRQ1IgIzk5NTQ5Njogd2hlbiB0aGUgcmVjb3JkIHN1ZmZpeCBmYWlsZWQgZ28gYmFjayB0byB0aGVcclxuICAgICAgICAgICAgICAgICAgICAgIC8vIG9yaWdpbmFsIHJvd1xyXG4gICAgICAgICAgICAgICAgICAgICAgaWYgKEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLkdldFN0b3BFeGVjdXRpb25GbGFnKCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgKDxEYXRhVmlldz50aGlzLkdldERhdGF2aWV3KCkpLnJlc3RvcmVUb3BSZWNJZHgoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5yZXN0b3JlT2xkRGlzcGxheUxpbmUob2xkRGlzcGxheUxpbmUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9GT1JNKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHVuaXQgIT09IENvbnN0YW50cy5NT1ZFX1VOSVRfUk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O1xyXG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0ZPUk0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5zZXRDdXJyUm93QnlEaXNwbGF5TGluZSh0aGlzLkdldERhdGF2aWV3KCkuZ2V0VG9wUmVjSWR4KCkgKyB0aGlzLmdldExhc3RWYWxpZFJvdygpLCBmYWxzZSwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICB2aXNpYmxlTGluZSA9IHRoaXMuZ2V0TGFzdFZhbGlkUm93KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChFeGNlcHRpb24pIHtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAoPERhdGFWaWV3PnRoaXMuR2V0RGF0YXZpZXcoKSkucmVzdG9yZVRvcFJlY0lkeCgpO1xyXG4gICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnJlc3RvcmVPbGREaXNwbGF5TGluZShvbGREaXNwbGF5TGluZSk7XHJcbiAgICAgICAgICAgICAgICAgIGlmICh1bml0ID09PSBDb25zdGFudHMuTU9WRV9VTklUX1JPVyAmJiBkaXJlY3Rpb24gPT09IENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9ORVhUKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gbm9uIGludGVyYWN0aXZlLCBlbmQgb2YgZGF0YSBtZWFucyBlbmQgb2Ygb3duZXJUYXNrLCB1bmxlc3Mgd2UgYXJlIGluIGNyZWF0ZSBtb2RlLlxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5fdGFzay5Jc0ludGVyYWN0aXZlICYmIHRoaXMuX3Rhc2suZ2V0TW9kZSgpICE9PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSlcclxuICAgICAgICAgICAgICAgICAgICAgICg8VGFza0Jhc2U+dGhpcy5fdGFzaykuc2V0RXhlY0VuZFRhc2soKTtcclxuICAgICAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGhpcy5fdGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NSRUxJTkUpO1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKGV4Lk1lc3NhZ2UpO1xyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgLy8gbW92aW5nIHRoZSBtYXJraW5nIG9uZSByb3cgdXAgb3IgZG93blxyXG4gICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgb2xkVGFza01vZGUgPSB0aGlzLl90YXNrLmdldE1vZGUoKTtcclxuXHJcbiAgICAgICAgICAgICAgb2xkUmVjSWQgPSAodGhpcy5HZXREYXRhdmlldygpLmdldEN1cnJSZWMoKSkuZ2V0SWQoKTtcclxuICAgICAgICAgICAgICBhd2FpdCB0aGlzLnNldEN1cnJSb3dCeURpc3BsYXlMaW5lKG9sZERpc3BsYXlMaW5lICsgc2l6ZSwgdHJ1ZSwgZmFsc2UpO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gICAgICAgICAgY3VyclJlYy5zZXROZXdSZWMoKTtcclxuICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAvLyBRQ1IgIzk4MDUyODogUmVmcmVzaCB0aGUgY3VycmVudCByb3cgYWZ0ZXIgY2FuY2VsIGVkaXQgdG8gcmVmbGVjdFxyXG4gICAgICAgICAgICAgICAgICAvLyB0aGUgcmVzdG9yZWQgdmFsdWVzXHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9DVVJSX1JFQyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgaWYgKG9sZFRhc2tNb2RlID09PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSAmJiBvbGREaXNwbGF5TGluZSA+IDApXHJcbiAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5yZXN0b3JlT2xkRGlzcGxheUxpbmUob2xkRGlzcGxheUxpbmUgLSAxKTtcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0ZPUk0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKHNpemUgPD0gMCB8fCBBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKVxyXG4gICAgICAgICAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVEZXZUb0xvZyhleC5NZXNzYWdlKTtcclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAvLyBub24gaW50ZXJhY3RpdmUsIGVuZCBvZiBkYXRhIG1lYW5zIGVuZCBvZiBvd25lclRhc2ssIHVubGVzcyB3ZSBhcmUgaW4gY3JlYXRlIG1vZGUuXHJcbiAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5fdGFzay5Jc0ludGVyYWN0aXZlICYmIHRoaXMuX3Rhc2suZ2V0TW9kZSgpICE9PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSkge1xyXG4gICAgICAgICAgICAgICAgICAgICg8VGFza0Jhc2U+dGhpcy5fdGFzaykuc2V0RXhlY0VuZFRhc2soKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3Rhc2suQWN0aW9uTWFuYWdlci5pc0VuYWJsZWQoSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NSRUxJTkUpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgQWNjZXNzSGVscGVyLmV2ZW50c01hbmFnZXIuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRoaXMuX3Rhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DUkVMSU5FKTtcclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgIC8vIGZpeGVkIGJ1ZyAjOjk0MTc2Mywgd2hpbGUgY3JlYXRlIGlzbid0IGFsbG93ZWQgbmVlZCB0byBkbyBzdWZmaXggYW5kIHByZWZpeCBvZiB0aGUgY3VycmVudCByZWNvcmRcclxuICAgICAgICAgICAgICAgICAgICAgIGxldCBkb1JlY29yZFN1ZmZpeDogYm9vbGVhbiA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVmZG9SZWNvcmRTdWZmaXg6IFJlZlBhcmFtPGJvb2xlYW4+ID0gbmV3IFJlZlBhcmFtKGRvUmVjb3JkU3VmZml4KTtcclxuICAgICAgICAgICAgICAgICAgICAgIGlmICghIGF3YWl0IEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLkRvVGFza0xldmVsUmVjb3JkU3VmZml4KDxUYXNrQmFzZT50aGlzLl90YXNrLCByZWZkb1JlY29yZFN1ZmZpeCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLkRvVGFza0xldmVsUmVjb3JkUHJlZml4KHRoaXMuX3Rhc2spO1xyXG4gICAgICAgICAgICAgICAgICAgICAgZG9SZWNvcmRTdWZmaXggPSByZWZkb1JlY29yZFN1ZmZpeC52YWx1ZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gaWYgdGhlIGZvcm0gZG9lcyBub3QgaGF2ZSBhIHRhYmxlLCBtb3ZlIHRvIG9uZSByb3cgaW4gdGhlIGNob3NlbiBEaXJlY3Rpb25cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuR2V0RGF0YXZpZXcoKS5zZXRDdXJyUmVjQnlJZHgodGhpcy5HZXREYXRhdmlldygpLmdldEN1cnJSZWNJZHgoKSArIHNpemUsIHRydWUsIGZhbHNlLCB0cnVlLCBTRVRfRElTUExBWUxJTkVfQllfRFYpO1xyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLlJlZnJlc2hEaXNwbGF5KENvbnN0YW50cy5UQVNLX1JFRlJFU0hfRk9STSk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICBjYXRjaCAoZXgpIHtcclxuICAgICAgICAgICAgaWYgKGV4IGluc3RhbmNlb2YgUmVjb3JkT3V0T2ZEYXRhVmlld0V4Y2VwdGlvbikge1xyXG4gICAgICAgICAgICAgIGlmIChzaXplID4gMCkge1xyXG4gICAgICAgICAgICAgICAgLy8gbm9uIGludGVyYWN0aXZlLCBlbmQgb2YgZGF0YSBtZWFucyBlbmQgb2Ygb3duZXJUYXNrLCB1bmxlc3Mgd2UgYXJlIGluIGNyZWF0ZSBtb2RlLlxyXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLl90YXNrLklzSW50ZXJhY3RpdmUgJiYgdGhpcy5fdGFzay5nZXRNb2RlKCkgIT09IENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFKVxyXG4gICAgICAgICAgICAgICAgICAoPFRhc2tCYXNlPnRoaXMuX3Rhc2spLnNldEV4ZWNFbmRUYXNrKCk7XHJcbiAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0aGlzLl90YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfQ1JFTElORSk7XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKGV4Lk1lc3NhZ2UpO1xyXG4gICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChleCBpbnN0YW5jZW9mIFNlcnZlckVycm9yKSB7XHJcbiAgICAgICAgICAgICAgYXdhaXQgKDxUYXNrQmFzZT50aGlzLl90YXNrKS5zdG9wKCk7XHJcbiAgICAgICAgICAgICAgKDxUYXNrQmFzZT50aGlzLl90YXNrKS5hYm9ydCgpO1xyXG4gICAgICAgICAgICAgIGF3YWl0IEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLlByb2Nlc3NBYm9ydGluZ0Vycm9yKGV4KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChleCBpbnN0YW5jZW9mIEV4Y2VwdGlvbikge1xyXG4gICAgICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKGV4Lk1lc3NhZ2UpO1xyXG4gICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgICBpZiAocmV0dXJuVG9WaXNpYmxlTGluZSkge1xyXG4gICAgICAgIGlmIChyZWNvcmRPdXRPZlZpZXcpIHtcclxuICAgICAgICAgIGlmICh2aXNpYmxlTGluZSA9PT0gMClcclxuICAgICAgICAgICAgdGhpcy5HZXREYXRhdmlldygpLnNldFRvcFJlY0lkeCh0aGlzLkdldERhdGF2aWV3KCkuZ2V0Q3VyclJlY0lkeCgpKTtcclxuICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgdGhpcy5HZXREYXRhdmlldygpLnNldFRvcFJlY0lkeCh0aGlzLkdldERhdGF2aWV3KCkuZ2V0Q3VyclJlY0lkeCgpIC0gdGhpcy5fcm93c0luUGFnZSk7XHJcbiAgICAgICAgICB0aGlzLlNldFRhYmxlVG9wSW5kZXgoKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICB0aGlzLlNldFRhYmxlVG9wSW5kZXgoKTtcclxuICAgICAgICAgIGF3YWl0IHRoaXMuc2V0Q3VyclJvd0J5RGlzcGxheUxpbmUodGhpcy5HZXREYXRhdmlldygpLmdldFRvcFJlY0lkeCgpICsgdmlzaWJsZUxpbmUsIGZhbHNlLCB0cnVlKTtcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgICAgZWxzZVxyXG4gICAgICAgIHRoaXMuU2V0VGFibGVUb3BJbmRleCgpO1xyXG5cclxuICAgICAgYXdhaXQgQWNjZXNzSGVscGVyLmV2ZW50c01hbmFnZXIuaG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yXG4gICAgICAgICAgICAgIGlmICh0b3BSZWNJZHggPiBjdXJyUmVjSWR4KVxyXG4gICAgICAgICAgICAgICAgdGhpcy5HZXREYXRhdmlldygpLnNldFRvcFJlY0lkeChjdXJyUmVjSWR4KTtcclxuICAgICAgICAgICAgICByb3cgPSAwO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuc2V0Q3VyclJvd0J5RGlzcGxheUxpbmUodGhpcy5HZXREYXRhdmlldygpLmdldFRvcFJlY0lkeCgpICsgcm93LCBmYWxzZSwgdHJ1ZSk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhdGNoIChleCkge1xyXG4gICAgICAgICAgaWYgKGV4IGluc3RhbmNlb2YgUmVjb3JkT3V0T2ZEYXRhVmlld0V4Y2VwdGlvbikge1xyXG4gICAgICAgICAgICAvLyBubyBleGNlcHRpb24gc2hvdWxkIHJlYWxseSBiZSBjYXVnaHQgaGVyZS5cclxuICAgICAgICAgICAgaWYgKHJvdyAhPT0gMClcclxuICAgICAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVEZXZUb0xvZyhOU3RyaW5nLkZvcm1hdChcImluIEZvcm0uY2FuY2VsRWRpdCgpIHswfVwiLCBleC5NZXNzYWdlKSk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIHRocm93IGV4O1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoc3VwZXIuSGFzVGFibGUoKSkge1xyXG4gICAgICAgICAgLy8gRGVjcmVtZW50IHRoZSBUb3RhbFJlY29yZHNDb3VudCBhcyByZWNvcmQgYmVpbmcgZGVsZXRlZC5cclxuICAgICAgICAgIGlmICh0aGlzLmlzVGFibGVXaXRoQWJzb2x1dGVTY3JvbGxiYXIoKSAmJiByZWNSZW1vdmVkKVxyXG4gICAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLkdldERhdG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