@@ -46,11 +46,12 @@ sap.ui.require(['ToolsAPI'], function (ToolsAPI) {
46
46
47
47
if ( isMutationValid === true ) {
48
48
controlTreeModel = ToolsAPI . getRenderedControlTree ( ) ;
49
- commonInformation = ToolsAPI . getFrameworkInformation ( ) . commonInformation ;
50
-
51
- message . send ( {
52
- action : 'on-application-dom-update' ,
53
- controlTree : controlUtils . getControlTreeModel ( controlTreeModel , commonInformation )
49
+ ToolsAPI . getFrameworkInformation ( ) . then ( function ( frameworkInformation ) {
50
+ commonInformation = frameworkInformation . commonInformation ;
51
+ message . send ( {
52
+ action : 'on-application-dom-update' ,
53
+ controlTree : controlUtils . getControlTreeModel ( controlTreeModel , commonInformation )
54
+ } ) ;
54
55
} ) ;
55
56
}
56
57
} ) ,
@@ -93,25 +94,25 @@ sap.ui.require(['ToolsAPI'], function (ToolsAPI) {
93
94
*/
94
95
'get-initial-information' : function ( ) {
95
96
var controlTreeModel = ToolsAPI . getRenderedControlTree ( ) ;
96
- var frameworkInformation = ToolsAPI . getFrameworkInformation ( ) ;
97
-
98
- message . send ( {
99
- action : 'on-receiving-initial-data' ,
100
- applicationInformation : applicationUtils . getApplicationInfo ( frameworkInformation ) ,
101
- controlTree : controlUtils . getControlTreeModel ( controlTreeModel , frameworkInformation . commonInformation ) ,
102
- elementRegistry : ToolsAPI . getRegisteredElements ( )
97
+ ToolsAPI . getFrameworkInformation ( ) . then ( function ( frameworkInformation ) {
98
+ message . send ( {
99
+ action : 'on-receiving-initial-data' ,
100
+ applicationInformation : applicationUtils . getApplicationInfo ( frameworkInformation ) ,
101
+ controlTree : controlUtils . getControlTreeModel ( controlTreeModel , frameworkInformation . commonInformation ) ,
102
+ elementRegistry : ToolsAPI . getRegisteredElements ( )
103
+ } ) ;
103
104
} ) ;
104
105
} ,
105
106
106
107
/**
107
108
* Send framework information.
108
109
*/
109
110
'get-framework-information' : function ( ) {
110
- var frameworkInformation = ToolsAPI . getFrameworkInformation ( ) ;
111
-
112
- message . send ( {
113
- action : 'on-framework-information' ,
114
- frameworkInformation : applicationUtils . getInformationForPopUp ( frameworkInformation )
111
+ ToolsAPI . getFrameworkInformation ( ) . then ( function ( frameworkInformation ) {
112
+ message . send ( {
113
+ action : 'on-framework-information' ,
114
+ frameworkInformation : applicationUtils . getInformationForPopUp ( frameworkInformation )
115
+ } ) ;
115
116
} ) ;
116
117
} ,
117
118
@@ -121,7 +122,7 @@ sap.ui.require(['ToolsAPI'], function (ToolsAPI) {
121
122
*/
122
123
'do-console-log-event-listener' : function ( event ) {
123
124
var evtData = event . detail . data ;
124
- console . log ( sap . ui . getCore ( ) . byId ( evtData . controlId ) . mEventRegistry [ evtData . eventName ] [ evtData . listenerIndex ] . fFunction ) ;
125
+ console . log ( controlUtils . getElementById ( evtData . controlId ) . mEventRegistry [ evtData . eventName ] [ evtData . listenerIndex ] . fFunction ) ;
125
126
} ,
126
127
127
128
/**
@@ -196,7 +197,7 @@ sap.ui.require(['ToolsAPI'], function (ToolsAPI) {
196
197
'do-control-property-change' : function ( event ) {
197
198
var oData = event . detail . data ;
198
199
var sControlId = oData . controlId ;
199
- var oControl = sap . ui . getCore ( ) . byId ( sControlId ) ;
200
+ var oControl = controlUtils . getElementById ( sControlId ) ;
200
201
201
202
if ( ! oControl ) {
202
203
return ;
@@ -215,7 +216,7 @@ sap.ui.require(['ToolsAPI'], function (ToolsAPI) {
215
216
'do-control-invalidate' : function ( event ) {
216
217
var oData = event . detail . data ;
217
218
var sControlId = oData . controlId ;
218
- var oControl = sap . ui . getCore ( ) . byId ( sControlId ) ;
219
+ var oControl = controlUtils . getElementById ( sControlId ) ;
219
220
220
221
if ( ! oControl ) {
221
222
return ;
@@ -234,7 +235,7 @@ sap.ui.require(['ToolsAPI'], function (ToolsAPI) {
234
235
'do-control-focus' : function ( event ) {
235
236
var oData = event . detail . data ;
236
237
var sControlId = oData . controlId ;
237
- var oControl = sap . ui . getCore ( ) . byId ( sControlId ) ;
238
+ var oControl = controlUtils . getElementById ( sControlId ) ;
238
239
239
240
if ( ! oControl ) {
240
241
return ;
@@ -251,7 +252,7 @@ sap.ui.require(['ToolsAPI'], function (ToolsAPI) {
251
252
'do-control-property-change-elements-registry' : function ( event ) {
252
253
var oData = event . detail . data ;
253
254
var sControlId = oData . controlId ;
254
- var oControl = sap . ui . getCore ( ) . byId ( sControlId ) ;
255
+ var oControl = controlUtils . getElementById ( sControlId ) ;
255
256
256
257
if ( ! oControl ) {
257
258
return ;
@@ -303,7 +304,7 @@ sap.ui.require(['ToolsAPI'], function (ToolsAPI) {
303
304
'do-copy-control-to-console' : function ( event ) {
304
305
var oData = event . detail . data ;
305
306
var sControlId = oData . controlId ;
306
- const control = sap . ui . getCore ( ) . byId ( sControlId ) ;
307
+ const control = controlUtils . getElementById ( sControlId ) ;
307
308
if ( control ) {
308
309
try {
309
310
const tempVarName = ui5Temp [ sControlId ] && ui5Temp [ sControlId ] . savedAs || `ui5$${ tempVarCount ++ } ` ;
0 commit comments