Project

General

Profile

Defect #531 ยป patch3.txt

Sanneke Aleman, 07/26/2012 11:28 AM

 
1
### Eclipse Workspace Patch 1.0
2
#P mod_dialog
3
Index: forms/dialogs_select.js
4
===================================================================
5
--- forms/dialogs_select.js	(revision 672)
6
+++ forms/dialogs_select.js	(working copy)
7
@@ -21,7 +21,7 @@
8
 }
9
 
10
 /**
11
- * @param {Array} _aArguments
12
+ * @param {Array<String>} _aArguments
13
  * @param {String} _sIconStyle
14
  * @param {Number} _nDialogWidth
15
  * @param {Number} _nDialogHeight
16
@@ -42,7 +42,10 @@
17
 	controller.recreateUI();
18
 	elements.fldValue.setLocation(85, _nDialogHeight - 71);
19
 	elements.fldValue.setSize(_nDialogWidth - 120, 22);
20
-	application.setValueListItems("dialogs_valuelist", _aArguments[1]);
21
+	
22
+	/** @type {Array<String>} */
23
+	var _values = _aArguments[1]
24
+	application.setValueListItems("dialogs_valuelist", _values);
25
 	retVal = _aArguments[1][0];
26
 	callbackMethod = handleButtonAction;
27
 }
28
Index: globals.js
29
===================================================================
30
--- globals.js	(revision 672)
31
+++ globals.js	(working copy)
32
@@ -42,7 +42,7 @@
33
 		application.output('Marking form "' + formName + '" for cleanup', LOGGINGLEVEL.DEBUG);
34
 		bluePrintStack.push(formName);
35
 	}
36
-
37
+	
38
 	var terminator = (application.getApplicationType() == APPLICATION_TYPES.WEB_CLIENT ? new Continuation() : null);
39
 
40
 	/**
41
@@ -62,6 +62,7 @@
42
 	 */
43
 	function newFormBluePrint(_sFormName, _sBaseFormName, _nWidth, _nHeight) {
44
 		//Cleanup of previously used blueprints
45
+		/** @type {String} */
46
 		var formName;
47
 		for (var i = 0; i < bluePrintStack.length; i++) {
48
 			formName = bluePrintStack[i];
49
@@ -91,7 +92,7 @@
50
 	/**
51
 	 * @private
52
 	 *
53
-	 * @param {String} _sFormName
54
+	 * @param {String|RuntimeForm} _sFormName
55
 	 * @param {String} _sDlgType
56
 	 * @param {Array} _aArguments
57
 	 * @param {String} [_sIconStyle]
58
@@ -99,17 +100,25 @@
59
 	 * @return {String}
60
 	 */
61
 	function showDialog(_sFormName, _sDlgType, _aArguments, _sIconStyle) {
62
+		
63
+		/** @type {Object} */
64
 		var _aArgs = Array.prototype.slice.call(_aArguments),
65
 			_nWidthPadding = 22,
66
-			i, dialogWindow;
67
+			dialogWindow;
68
 		var _sUniqueName = _aArgs[8] || utils.stringReplace(application.getUUID().toString(), "-", "");
69
 
70
+		if(_aArgs[0] instanceof  RuntimeForm) _aArgs[0] = _aArgs[0].controller.getName()
71
+		
72
 		if (_sDlgType == 'FIMD') {
73
 			dialogWindow = application.createWindow("W_" + _sUniqueName, JSWindow.MODAL_DIALOG);
74
 			dialogWindow.setLocation(_aArgs[1] | JSWindow.DEFAULT, _aArgs[2] || JSWindow.DEFAULT);
75
 			if (_aArgs[5]) {
76
 				dialogWindow.title = _aArgs[5];
77
 			}
78
+			else
79
+			{
80
+				dialogWindow.title = solutionModel.getForm(_aArgs[0]).titleText
81
+			}
82
 			dialogWindow.resizable = (_aArgs[6] == null ? true : _aArgs[6]);
83
 			dialogWindow.showTextToolbar(_aArgs[7] == null ? false : _aArgs[7]);
84
 			forms[_aArgs[0]]['windowName'] = "W_" + _sUniqueName;
85
@@ -152,7 +161,8 @@
86
 
87
 				switch (_sDlgType) {
88
 				case 'input':
89
-					dialog.setupForm([_aArgs[1], i18n.getI18NMessage('servoy.button.ok'), i18n.getI18NMessage('servoy.button.cancel')], _sIconStyle, _aArgs[2], _nDialogWidth, _nDialogHeight + 30);
90
+					var _top = _aArgs[2]
91
+					dialog.setupForm([_aArgs[1], i18n.getI18NMessage('servoy.button.ok'), i18n.getI18NMessage('servoy.button.cancel')], _sIconStyle, _top, _nDialogWidth, _nDialogHeight + 30);
92
 					break;
93
 				case 'select':
94
 					dialog.setupForm([_aArgs[1], _aArgs[2], i18n.getI18NMessage('servoy.button.ok'), i18n.getI18NMessage('servoy.button.cancel')], _sIconStyle, _nDialogWidth, _nDialogHeight + 30);
95
Index: forms/dialogs_base.js
96
===================================================================
97
--- forms/dialogs_base.js	(revision 672)
98
+++ forms/dialogs_base.js	(working copy)
99
@@ -94,7 +94,7 @@
100
  */
101
 function setupButtons(buttonArray, redraw, dialogWidth, dialogHeight) {
102
 	var _oForm = solutionModel.getForm(controller.getName()),
103
-		_oMethod = solutionModel.getForm("dialogs_base").getFormMethod('onButtonAction'),
104
+		_oMethod = solutionModel.getForm("dialogs_base").getMethod('onButtonAction'),
105
 		_oBtn,
106
 		_nBtnMinWidth = 80,
107
 		_nBtnWidth, // = _nBtnMinWidth,
108
@@ -150,14 +150,17 @@
109
 
110
 /**
111
  * Abstract method, to be overridden by childforms
112
- * @param {Array} _aArguments
113
+ * @param {Array|Object} _aArguments
114
  * @param {String} _sIconStyle
115
+ * @param {Number} [_par3]
116
+ * @param {Number} [_par4]
117
+ * @param {Number} [_par5]
118
  * 
119
  * @SuppressWarnings('wrongparameters')
120
  *
121
  * @properties={typeid:24,uuid:"74DE135A-C68C-4CA4-B889-E77359CD9700"}
122
  */
123
-function setupForm(_aArguments, _sIconStyle) { }
124
+function setupForm(_aArguments, _sIconStyle, _par3, _par4, _par5) { }
125
 
126
 /**
127
  * Callback method for when form is shown.
128
Index: forms/dialogs_message.js
129
===================================================================
130
--- forms/dialogs_message.js	(revision 672)
131
+++ forms/dialogs_message.js	(working copy)
132
@@ -31,7 +31,9 @@
133
 	_oLabel = _oForm.newLabel("", 90, 15, _nDialogWidth - 100, 90);
134
 	_oLabel.styleClass = 'dialogs_message';
135
 	_oLabel.verticalAlignment = SM_ALIGNMENT.TOP;
136
-	_oLabel.text = '<html>' + utils.stringReplace(utils.stringReplace(utils.stringReplace(_aArguments[1], "\r\n", "<br />"), "\n", "<br />"), "\r", "<br />") + '</html>';
137
+	/** @type {String} */
138
+	var _args1 = _aArguments[1]
139
+	_oLabel.text = '<html>' + utils.stringReplace(utils.stringReplace(utils.stringReplace(_args1, "\r\n", "<br />"), "\n", "<br />"), "\r", "<br />") + '</html>';
140
 
141
 	controller.recreateUI();
142
 	callbackMethod = handleButtonAction;
143
Index: forms/dialogs_input.js
144
===================================================================
145
--- forms/dialogs_input.js	(revision 672)
146
+++ forms/dialogs_input.js	(working copy)
147
@@ -40,7 +40,9 @@
148
 	_oLabel = _oForm.newLabel("", 90, 15, _nDialogWidth - 100, 90);
149
 	_oLabel.styleClass = 'dialogs_message';
150
 	_oLabel.verticalAlignment = SM_ALIGNMENT.TOP;
151
-	_oLabel.text = '<html>' + utils.stringReplace(utils.stringReplace(utils.stringReplace(_aArguments[0], "\r\n", "<br />"), "\n", "<br />"), "\r", "<br />") + '</html>';
152
+	/** @type {String} */
153
+	var _args0 = _aArguments[0]
154
+	_oLabel.text = '<html>' + utils.stringReplace(utils.stringReplace(utils.stringReplace(_args0, "\r\n", "<br />"), "\n", "<br />"), "\r", "<br />") + '</html>';
155
 	controller.recreateUI();
156
 	elements.fldValue.setLocation(85, _nDialogHeight - 71);
157
 	elements.fldValue.setSize(_nDialogWidth - 120, 20);
    (1-1/1)