FramesSelection.js
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Ext.define('treps.controller.Frames.FramesSelection', {
extend: 'Ext.app.Controller',
requires: [
'treps.controller.Frames.FramesManager'
],
views: [
'Steps.TransformationDefinition.TransformationDefinitionPanel'
],
refs: [
{
ref: 'sourceCombo',
selector: '#srcSysFrame'
},
{
ref: 'destCombo',
selector: '#destSysFrame'
}
],
init: function() {
var me = this;
},
initStore: function(onReady)
{
var me = this;
treps.controller.Frames.FramesManager.loadFramesStore(
function(store)
{
me.getSourceCombo().store = store;
me.getDestCombo().store = store;
if (onReady != null)
onReady.call(me, store);
});
},
getSrcFrame: function() {
return this.getSourceCombo().getValue();
},
getDstFrame: function() {
return this.getDestCombo().getValue();
},
setSrcFrame: function(srcFrame) {
this.getSourceCombo().setValue(srcFrame);
},
isValid: function() {
var srcFrame = this.getSrcFrame();
var dstFrame = this.getDstFrame();
if ((srcFrame == null) && (dstFrame == null))
{
treps.Messages.showError('Please select a source frame and a destination frame');
return false;
}
else if (srcFrame == null)
{
treps.Messages.showError('Please select a source frame');
return false;
}
else if (dstFrame == null)
{
treps.Messages.showError('Please select a destination frame');
return false;
}
return true;
}
});