ChromeLogsExtensionDialogController.js .
In the below screenshots , you can find on your left side of the code is the 1.x supported old UI5 commons controls where-as on your right side of the screen , you can find the changed sap.m controls code.
/*
Copyright 2015, SAP SE
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
define(function() {
"use strict";
var ChromeLogsExtensionDialogController = function(acquisitionState,
oDeferred, fServiceCall, workflow) {
/*
* Create dialog controls
*/
var dLayout = new sap.ui.layout.VerticalLayout({
});
var datasetNameTxt = new sap.m.Input({
enabled : workflow === "CREATE"
});
var datasetNameLbl = new sap.m.Label({
text : "Dataset Name:",
labelFor : datasetNameTxt
});
dLayout.addContent( datasetNameLbl);
dLayout.addContent( datasetNameTxt);
// These paths correspond to the included sample data if the workspace
// was unzipped to the C drive
var datasetTxt = new sap.m.Input({
width : '300px',
value : 'C:\\'
});
var datasetLbl = new sap.m.Label({
text : "Logs Folder:",
labelFor : datasetTxt
});
dLayout.addContent( datasetLbl);
dLayout.addContent(datasetTxt);
var metadataTxt = new sap.m.Input({
width : '300px',
value : 'C:\\metadata.txt'
});
var metadataLbl = new sap.m.Label({
text : "Metadata File:",
labelFor : metadataTxt
});
dLayout.addContent( metadataLbl);
dLayout.addContent(metadataTxt);
/*
* Button press events
*/
this.buttonCancelPressed = function() {
oDeferred.reject(); // promise fail
dialog.close();
};
var buttonOKPressed = function() {
var info = {};
info.logsFolder = datasetTxt.getValue();
info.metadataFile = metadataTxt.getValue();
info.datasetName = datasetNameTxt.getValue();
// info.model = oAccordion.getModel().oData;
acquisitionState.info = JSON.stringify(info);
oDeferred.resolve(acquisitionState, datasetNameTxt.getValue());
dialog.close();
};
var okButton = new sap.m.Button({
press : [ buttonOKPressed, this ],
text : "OK",
tooltip : "OK"
});
var cancelButton = new sap.m.Button({
press : [ this.buttonCancelPressed, this ],
text : "Cancel",
tooltip : "Cancel"
});//.addStyleClass(sap.ui.commons.ButtonStyle.Default);
var onClosed = function() {
if (oDeferred.state() === "pending") {
oDeferred.reject();
}
};
/*
* Modify controls based on acquisitionState
*/
var envProperties = acquisitionState.envProps;
if (acquisitionState.info) {
var info = JSON.parse(acquisitionState.info);
datasetTxt.setValue(info.logsFolder);
metadataTxt.setValue(info.metadataFile);
envProperties.datasetName = info.datasetName;
}
datasetNameTxt.setValue(envProperties.datasetName);
/*
* Create the dialog
*/
var dialog = new sap.m.Dialog({
width : "720px",
height : "240px",
modal : true,
resizable : false,
closed : onClosed,
content : [ dLayout ],
buttons : [ okButton, cancelButton ]
});
dialog.setTitle("Chrome Logs Extension: " + envProperties.datasetName);
this.showDialog = function() {
dialog.open();
};
};
return ChromeLogsExtensionDialogController;
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |