View | Details | Raw Unified | Return to bug 184449
Collapse All | Expand All

(-)templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java (-9 / +13 lines)
Lines 50-56 Link Here
50
	/**
50
	/**
51
	 * Attributes associated with this widget.
51
	 * Attributes associated with this widget.
52
	 */
52
	 */
53
	private UIAttributes/*<String, String>*/ uiAttribute;
53
	protected UIAttributes/*<String, String>*/ uiAttribute;
54
54
55
	/**
55
	/**
56
	 * Text widget.
56
	 * Text widget.
Lines 67-72 Link Here
67
	 * Composite to which this widget control is added. Classes extending this class, should make sure that they initialize this from the respective class createWidgets method.
67
	 * Composite to which this widget control is added. Classes extending this class, should make sure that they initialize this from the respective class createWidgets method.
68
	 */
68
	 */
69
	protected UIComposite uiComposite;
69
	protected UIComposite uiComposite;
70
	
71
	protected String textValue;
70
72
71
	/**
73
	/**
72
	 * Constructor.
74
	 * Constructor.
Lines 77-82 Link Here
77
	public UITextWidget(UIAttributes/*<String, String>*/ uiAttribute) {
79
	public UITextWidget(UIAttributes/*<String, String>*/ uiAttribute) {
78
		super(uiAttribute);
80
		super(uiAttribute);
79
		this.uiAttribute = uiAttribute;
81
		this.uiAttribute = uiAttribute;
82
		this.textValue = new String();
80
	}
83
	}
81
84
82
	/**
85
	/**
Lines 84-90 Link Here
84
	 */
87
	 */
85
	public Map/*<String, String>*/ getValues() {
88
	public Map/*<String, String>*/ getValues() {
86
		Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/();
89
		Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/();
87
		retMap.put(uiAttribute.get(InputUIElement.ID), text.getText());
90
		retMap.put(uiAttribute.get(InputUIElement.ID), textValue);
88
91
89
		return retMap;
92
		return retMap;
90
	}
93
	}
Lines 108-114 Link Here
108
					val = subString;
111
					val = subString;
109
			}
112
			}
110
			val = val.trim();
113
			val = val.trim();
111
			text.setText(val);
114
			textValue = val;
112
		}
115
		}
113
	}
116
	}
114
117
Lines 141-146 Link Here
141
		text = getTextWidget((String) uiAttribute.get(UIElement.TYPE));
144
		text = getTextWidget((String) uiAttribute.get(UIElement.TYPE));
142
		text.addModifyListener(this);
145
		text.addModifyListener(this);
143
		text.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$
146
		text.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$
147
		text.setText(textValue);
144
	}
148
	}
145
149
146
	/**
150
	/**
Lines 213-229 Link Here
213
		// other classes, having Text widget. They can just make use of
217
		// other classes, having Text widget. They can just make use of
214
		// modifyText,
218
		// modifyText,
215
		// evaluatePattern and isValid.
219
		// evaluatePattern and isValid.
216
		String inputText = text.getText();
220
		textValue = text.getText();
217
221
218
		if ((patternValue == null) || (inputText == null)) 
222
		if ((patternValue == null) || (textValue == null)) 
219
			return;
223
			return;
220
		
224
		
221
		String mandatory = (String) attribute.get(InputUIElement.MANDATORY);
225
		String mandatory = (String) attribute.get(InputUIElement.MANDATORY);
222
		if ((mandatory == null || !mandatory.equalsIgnoreCase("true")) && inputText.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
226
		if ((mandatory == null || !mandatory.equalsIgnoreCase("true")) && textValue.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
223
			return;
227
			return;
224
		}
228
		}
225
229
226
		evaluatePattern(label.getText(), inputText, patternValue);
230
		evaluatePattern(label.getText(), textValue, patternValue);
227
	}
231
	}
228
232
229
	/**
233
	/**
Lines 261-268 Link Here
261
		String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY);
265
		String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY);
262
266
263
		if (((mandatory != null) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE)))
267
		if (((mandatory != null) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE)))
264
				&& ((text.getText() == null) || (text.getText().equals("")) || //$NON-NLS-1$
268
				&& ((textValue == null) || (textValue.equals("")) || //$NON-NLS-1$
265
				(text.getText().trim().length() < 1))) {
269
				(textValue.trim().length() < 1))) {
266
270
267
			retVal = false;
271
			retVal = false;
268
		}
272
		}
(-)templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBrowseWidget.java (-10 / +5 lines)
Lines 32-46 Link Here
32
 */
32
 */
33
33
34
public class UIBrowseWidget extends UITextWidget implements ModifyListener {
34
public class UIBrowseWidget extends UITextWidget implements ModifyListener {
35
	/**
36
	 * Attributes associated with this widget.
37
	 */
38
	UIAttributes/*<String, String>*/ uiAttribute;
39
35
40
	/**
36
	/**
41
	 * Browse Button of this widget.
37
	 * Browse Button of this widget.
42
	 */
38
	 */
43
	Button button;
39
	protected  Button button;
44
40
45
	/**
41
	/**
46
	 * Constructor.
42
	 * Constructor.
Lines 51-56 Link Here
51
	public UIBrowseWidget(UIAttributes/*<String, String>*/ uiAttribute) {
47
	public UIBrowseWidget(UIAttributes/*<String, String>*/ uiAttribute) {
52
		super(uiAttribute);
48
		super(uiAttribute);
53
		this.uiAttribute = uiAttribute;
49
		this.uiAttribute = uiAttribute;
50
		this.textValue = (String) uiAttribute.get(InputUIElement.DEFAULT);
54
	}
51
	}
55
52
56
	/**
53
	/**
Lines 83-92 Link Here
83
		text = new Text(textConatiner, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
80
		text = new Text(textConatiner, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
84
		text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
81
		text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
85
		text.addModifyListener(this);
82
		text.addModifyListener(this);
86
83
		text.setText(textValue);
87
		// set Default values
88
		if (uiAttribute.get(InputUIElement.DEFAULT) != null)
89
			text.setText((String) uiAttribute.get(InputUIElement.DEFAULT));
90
84
91
		button = new Button(textConatiner, SWT.PUSH | SWT.LEFT);
85
		button = new Button(textConatiner, SWT.PUSH | SWT.LEFT);
92
		button.setText(InputUIElement.BROWSELABEL);
86
		button.setText(InputUIElement.BROWSELABEL);
Lines 95-101 Link Here
95
			public void widgetSelected(SelectionEvent event) {
89
			public void widgetSelected(SelectionEvent event) {
96
				String fileName = new FileDialog(uiComposite.getShell()).open();
90
				String fileName = new FileDialog(uiComposite.getShell()).open();
97
				if (fileName != null) {
91
				if (fileName != null) {
98
					text.setText(fileName.toString());
92
					textValue = fileName.toString();
93
					text.setText(textValue);
99
				}
94
				}
100
			}
95
			}
101
		});
96
		});
(-)templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java (-12 / +18 lines)
Lines 14-19 Link Here
14
import java.util.Map;
14
import java.util.Map;
15
15
16
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.SWT;
17
import org.eclipse.swt.events.SelectionAdapter;
18
import org.eclipse.swt.events.SelectionEvent;
17
import org.eclipse.swt.layout.GridData;
19
import org.eclipse.swt.layout.GridData;
18
import org.eclipse.swt.layout.GridLayout;
20
import org.eclipse.swt.layout.GridLayout;
19
import org.eclipse.swt.widgets.Button;
21
import org.eclipse.swt.widgets.Button;
Lines 35-56 Link Here
35
	/**
37
	/**
36
	 * Attributes associated with this widget.
38
	 * Attributes associated with this widget.
37
	 */
39
	 */
38
	UIAttributes/*<String, String>*/ uiAttribute;
40
	protected UIAttributes/*<String, String>*/ uiAttribute;
39
41
40
	/**
42
	/**
41
	 * Boolean widget.
43
	 * Boolean widget.
42
	 */
44
	 */
43
	Button button;
45
	protected Button button;
44
46
45
	/**
47
	/**
46
	 * Label of this widget.
48
	 * Label of this widget.
47
	 */
49
	 */
48
	Label label;
50
	protected Label label;
49
51
50
	/**
52
	/**
51
	 * Composite to which this widget control is added.
53
	 * Composite to which this widget control is added.
52
	 */
54
	 */
53
	UIComposite uiComposite;
55
	protected UIComposite uiComposite;
56
	
57
	private boolean booleanValue;
54
58
55
	/**
59
	/**
56
	 * Constructor.
60
	 * Constructor.
Lines 61-66 Link Here
61
	public UIBooleanWidget(UIAttributes/*<String, String>*/ uiAttribute) {
65
	public UIBooleanWidget(UIAttributes/*<String, String>*/ uiAttribute) {
62
		super(uiAttribute);
66
		super(uiAttribute);
63
		this.uiAttribute = uiAttribute;
67
		this.uiAttribute = uiAttribute;
68
		this.booleanValue = false;
64
	}
69
	}
65
70
66
	/**
71
	/**
Lines 69-76 Link Here
69
	public Map/*<String, String>*/ getValues() {
74
	public Map/*<String, String>*/ getValues() {
70
75
71
		Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/();
76
		Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/();
72
		Boolean isCheck = new Boolean(button.getSelection());
77
		retMap.put(uiAttribute.get(InputUIElement.ID), new Boolean(booleanValue).toString());
73
		retMap.put(uiAttribute.get(InputUIElement.ID), isCheck.toString());
74
78
75
		return retMap;
79
		return retMap;
76
	}
80
	}
Lines 81-91 Link Here
81
	 * @param valueMap
85
	 * @param valueMap
82
	 */
86
	 */
83
	public void setValues(Map/*<String, String>*/ valueMap) {
87
	public void setValues(Map/*<String, String>*/ valueMap) {
84
		String val = (String) valueMap.get(uiAttribute.get(InputUIElement.ID));
88
		booleanValue = new Boolean((String) valueMap.get(uiAttribute.get(InputUIElement.ID))).booleanValue();
85
		Boolean bool = new Boolean(val);
86
		if (val != null) {
87
			button.setSelection(bool.booleanValue());
88
		}
89
	}
89
	}
90
90
91
	/**
91
	/**
Lines 116-121 Link Here
116
		booleanConatiner.setLayoutData(gridcData);
116
		booleanConatiner.setLayoutData(gridcData);
117
		button = new Button(booleanConatiner, SWT.CHECK);
117
		button = new Button(booleanConatiner, SWT.CHECK);
118
		button.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$
118
		button.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$
119
		button.setSelection(new Boolean(booleanValue).booleanValue());
120
		button.addSelectionListener(new SelectionAdapter() {
121
			public void widgetSelected(SelectionEvent e) {
122
				booleanValue = button.getSelection();
123
			}
124
		});
119
	}
125
	}
120
126
121
	/**
127
	/**
Lines 130-136 Link Here
130
		boolean retVal = true;
136
		boolean retVal = true;
131
		String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY);
137
		String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY);
132
138
133
		if ((button.getSelection() == false) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) {
139
		if (!booleanValue && mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE)) {
134
			retVal = false;
140
			retVal = false;
135
		}
141
		}
136
		return retVal;
142
		return retVal;
(-)templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java (-20 / +26 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 Symbian Software Limited and others.
3
 * All rights reserved. This program and the accompanying materials
2
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
3
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
4
 * which accompanies this distribution, and is available at
Lines 10-16 Link Here
10
 *******************************************************************************/
9
 *******************************************************************************/
11
package org.eclipse.cdt.ui.templateengine.uitree.uiwidgets;
10
package org.eclipse.cdt.ui.templateengine.uitree.uiwidgets;
12
11
12
import java.util.ArrayList;
13
import java.util.Arrays;
13
import java.util.HashMap;
14
import java.util.HashMap;
15
import java.util.List;
14
import java.util.Map;
16
import java.util.Map;
15
import java.util.StringTokenizer;
17
import java.util.StringTokenizer;
16
18
Lines 25-30 Link Here
25
import org.eclipse.cdt.ui.templateengine.uitree.UIAttributes;
27
import org.eclipse.cdt.ui.templateengine.uitree.UIAttributes;
26
import org.eclipse.cdt.ui.templateengine.uitree.UIElement;
28
import org.eclipse.cdt.ui.templateengine.uitree.UIElement;
27
import org.eclipse.cdt.utils.ui.controls.FileListControl;
29
import org.eclipse.cdt.utils.ui.controls.FileListControl;
30
import org.eclipse.cdt.utils.ui.controls.IFileListChangeListener;
28
31
29
32
30
/**
33
/**
Lines 37-58 Link Here
37
	/**
40
	/**
38
	 * Attributes associated with this widget.
41
	 * Attributes associated with this widget.
39
	 */
42
	 */
40
	UIAttributes/*<String, String>*/ uiAttribute;
43
	protected UIAttributes/*<String, String>*/ uiAttribute;
41
44
42
	/**
45
	/**
43
	 * StringList widget.
46
	 * StringList widget.
44
	 */
47
	 */
45
	FileListControl fileListControl;
48
	protected FileListControl fileListControl;
46
49
47
	/**
50
	/**
48
	 * Label of this widget.
51
	 * Label of this widget.
49
	 */
52
	 */
50
	Label label;
53
	protected Label label;
51
54
52
	/**
55
	/**
53
	 * Composite to which this widget control is added.
56
	 * Composite to which this widget control is added.
54
	 */
57
	 */
55
	UIComposite uiComposite;
58
	protected UIComposite uiComposite;
59
	
60
	protected List itemsList;
56
61
57
	/**
62
	/**
58
	 * Constructor.
63
	 * Constructor.
Lines 63-68 Link Here
63
	public UIStringListWidget(UIAttributes/*<String, String>*/ attribute) {
68
	public UIStringListWidget(UIAttributes/*<String, String>*/ attribute) {
64
		super(attribute);
69
		super(attribute);
65
		uiAttribute = attribute;
70
		uiAttribute = attribute;
71
		itemsList = new ArrayList();
66
	}
72
	}
67
73
68
	/**
74
	/**
Lines 70-81 Link Here
70
	 */
76
	 */
71
	public Map/*<String, String>*/ getValues() {
77
	public Map/*<String, String>*/ getValues() {
72
		Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/();
78
		Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/();
73
		String[] items = fileListControl.getItems();
74
		String itemString = new String();
79
		String itemString = new String();
75
80
		for (int i = 0; i < itemsList.size(); i++) {
76
		for (int i = 0; i < items.length; i++)
81
			itemString = itemString + itemsList.get(i) + "|"; //$NON-NLS-1$
77
			itemString = itemString + items[i] + "|"; //$NON-NLS-1$
82
		}
78
79
		retMap.put(uiAttribute.get(InputUIElement.ID), itemString);
83
		retMap.put(uiAttribute.get(InputUIElement.ID), itemString);
80
84
81
		return retMap;
85
		return retMap;
Lines 87-105 Link Here
87
	 * @param valueMap
91
	 * @param valueMap
88
	 */
92
	 */
89
	public void setValues(Map/*<String, String>*/ valueMap) {
93
	public void setValues(Map/*<String, String>*/ valueMap) {
90
91
		String items = (String) valueMap.get(uiAttribute.get(InputUIElement.ID));
94
		String items = (String) valueMap.get(uiAttribute.get(InputUIElement.ID));
92
95
93
		if (items != null) {
96
		if (items != null) {
94
			items = items.trim();
97
			items = items.trim();
95
			StringTokenizer st = new StringTokenizer(items, "|"); //$NON-NLS-1$
98
			StringTokenizer st = new StringTokenizer(items, "|"); //$NON-NLS-1$
96
			String[] itemList = new String[st.countTokens()];
99
			for (int i = 0; st.hasMoreTokens(); i++) {
97
100
				itemsList.add(st.nextToken());
98
			for (int i = 0; st.hasMoreTokens(); i++)
101
			}
99
				itemList[i] = st.nextToken();
100
101
			fileListControl.setList(itemList);
102
			fileListControl.setSelection(0);
103
		}
102
		}
104
	}
103
	}
105
104
Lines 133-138 Link Here
133
		flcComposite.setLayoutData(gridData);
132
		flcComposite.setLayoutData(gridData);
134
133
135
		fileListControl = new FileListControl(flcComposite, (String) uiAttribute.get(InputUIElement.WIDGETLABEL), 0);
134
		fileListControl = new FileListControl(flcComposite, (String) uiAttribute.get(InputUIElement.WIDGETLABEL), 0);
135
		fileListControl.setList((String[])itemsList.toArray());
136
		fileListControl.setSelection(0);
137
		fileListControl.addChangeListener(new IFileListChangeListener(){
138
			public void fileListChanged(FileListControl fileList, String oldValue[], String newValue[]) {
139
				itemsList.addAll(Arrays.asList(newValue));
140
			}
141
		});
142
136
	}
143
	}
137
144
138
	/**
145
	/**
Lines 147-154 Link Here
147
		boolean retVal = true;
154
		boolean retVal = true;
148
		String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY);
155
		String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY);
149
156
150
		if ((fileListControl.getItems() == null) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) {
157
		if ((itemsList == null || itemsList.size() == 0) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) {
151
152
			retVal = false;
158
			retVal = false;
153
		}
159
		}
154
		return retVal;
160
		return retVal;
(-)templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISpecialListWidget.java (+10 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.ui.templateengine.uitree.uiwidgets;
11
package org.eclipse.cdt.ui.templateengine.uitree.uiwidgets;
12
12
13
import java.util.Arrays;
14
13
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.layout.GridData;
16
import org.eclipse.swt.layout.GridData;
15
import org.eclipse.swt.layout.GridLayout;
17
import org.eclipse.swt.layout.GridLayout;
Lines 20-25 Link Here
20
import org.eclipse.cdt.ui.templateengine.uitree.UIAttributes;
22
import org.eclipse.cdt.ui.templateengine.uitree.UIAttributes;
21
import org.eclipse.cdt.ui.templateengine.uitree.UIElement;
23
import org.eclipse.cdt.ui.templateengine.uitree.UIElement;
22
import org.eclipse.cdt.utils.ui.controls.FileListControl;
24
import org.eclipse.cdt.utils.ui.controls.FileListControl;
25
import org.eclipse.cdt.utils.ui.controls.IFileListChangeListener;
23
26
24
27
25
/**
28
/**
Lines 69-74 Link Here
69
		flcComposite.setLayoutData(gridData);
72
		flcComposite.setLayoutData(gridData);
70
73
71
		fileListControl = new FileListControl(flcComposite, (String) uiAttribute.get(InputUIElement.WIDGETLABEL), 1);
74
		fileListControl = new FileListControl(flcComposite, (String) uiAttribute.get(InputUIElement.WIDGETLABEL), 1);
75
		fileListControl.setList((String[])itemsList.toArray());
76
		fileListControl.setSelection(0);
77
		fileListControl.addChangeListener(new IFileListChangeListener(){
78
			public void fileListChanged(FileListControl fileList, String oldValue[], String newValue[]) {
79
				itemsList.addAll(Arrays.asList(newValue));
80
			}
81
		});
72
	}
82
	}
73
83
74
	/**
84
	/**
(-)templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java (-25 / +30 lines)
Lines 16-21 Link Here
16
import java.util.Set;
16
import java.util.Set;
17
17
18
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.SWT;
19
import org.eclipse.swt.events.SelectionEvent;
20
import org.eclipse.swt.events.SelectionListener;
19
import org.eclipse.swt.layout.GridData;
21
import org.eclipse.swt.layout.GridData;
20
import org.eclipse.swt.layout.GridLayout;
22
import org.eclipse.swt.layout.GridLayout;
21
import org.eclipse.swt.widgets.Combo;
23
import org.eclipse.swt.widgets.Combo;
Lines 35-66 Link Here
35
	/**
37
	/**
36
	 * Attributes associated with this widget.
38
	 * Attributes associated with this widget.
37
	 */
39
	 */
38
	UIAttributes/*<String, String>*/ uiAttribute;
40
	protected UIAttributes/*<String, String>*/ uiAttribute;
39
41
40
	/**
42
	/**
41
	 * Select widget.
43
	 * Select widget.
42
	 */
44
	 */
43
	Combo combo;
45
	protected Combo combo = null;
44
46
45
	/**
47
	/**
46
	 * Label of this widget.
48
	 * Label of this widget.
47
	 */
49
	 */
48
	Label label;
50
	protected Label label;
49
51
50
	/**
52
	/**
51
	 * Composite to which this widget control is added.
53
	 * Composite to which this widget control is added.
52
	 */
54
	 */
53
	UIComposite uiComposite;
55
	protected UIComposite uiComposite;
54
56
55
	/**
57
	/**
56
	 * Map contains the values of Select Widget
58
	 * Map contains the values of Select Widget
57
	 */
59
	 */
58
	HashMap/*<String, String>*/ itemMap;
60
	protected HashMap/*<String, String>*/ itemMap;
59
61
60
	/**
62
	/**
61
	 * Default value of Select Widget
63
	 * Default value of Select Widget
62
	 */
64
	 */
63
	String itemSelected;
65
	protected String itemSelected;
64
66
65
	/**
67
	/**
66
	 * Constructor for Select Widget.
68
	 * Constructor for Select Widget.
Lines 70-89 Link Here
70
	 */
72
	 */
71
	public UISelectWidget(UIAttributes/*<String, String>*/ attribute, HashMap/*<String, String>*/ itemMap,
73
	public UISelectWidget(UIAttributes/*<String, String>*/ attribute, HashMap/*<String, String>*/ itemMap,
72
			String itemSelected) {
74
			String itemSelected) {
73
74
		super(attribute);
75
		super(attribute);
75
		uiAttribute = attribute;
76
		uiAttribute = attribute;
76
		this.itemMap = itemMap;
77
		this.itemMap = itemMap;
77
		this.itemSelected = itemSelected;
78
		this.itemSelected = itemSelected;
78
	}
79
	}
79
80
80
	/**
81
	 * @return Boolean value contained in the Boolean Widget.
82
	 */
83
	public Map/*<String, String>*/ getValues() {
81
	public Map/*<String, String>*/ getValues() {
84
82
85
		Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/();
83
		Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/();
86
		retMap.put(uiAttribute.get(InputUIElement.ID), itemMap.get(combo.getItem(combo.getSelectionIndex())));
84
		retMap.put(uiAttribute.get(InputUIElement.ID), itemSelected);
87
85
88
		return retMap;
86
		return retMap;
89
	}
87
	}
Lines 94-110 Link Here
94
	 * @param valueMap
92
	 * @param valueMap
95
	 */
93
	 */
96
	public void setValues(Map/*<String, String>*/ valueMap) {
94
	public void setValues(Map/*<String, String>*/ valueMap) {
97
95
		itemSelected = (String) valueMap.get(uiAttribute.get(InputUIElement.ID));
98
		String val = (String) valueMap.get(uiAttribute.get(InputUIElement.ID));
96
		
99
		if (val != null)
97
		if (combo != null) {
100
			val = val.trim();
98
			String[] items = combo.getItems();
101
		String[] items = combo.getItems();
99
			for (int i=0; i < items.length; i++) {
102
		int index = 0;
100
				if (items[i].equals(itemSelected)) {
103
		for (int i = 0; i < items.length; i++)
101
					combo.select(i);
104
			if (itemMap.get(items[i]).equals(val))
102
					break;
105
				index = i;
103
				}
106
104
			}
107
		combo.select(index);
105
		}
108
	}
106
	}
109
107
110
	/**
108
	/**
Lines 149-154 Link Here
149
147
150
		combo.select(index);
148
		combo.select(index);
151
		combo.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$
149
		combo.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$
150
		combo.addSelectionListener(new SelectionListener() {
151
			public void widgetSelected(SelectionEvent e) {
152
				itemSelected = combo.getItem(combo.getSelectionIndex());
153
			}
154
			
155
			public void widgetDefaultSelected(SelectionEvent e) {	
156
			}
157
		});
152
	}
158
	}
153
159
154
	/**
160
	/**
Lines 163-171 Link Here
163
		boolean retVal = true;
169
		boolean retVal = true;
164
		String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY);
170
		String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY);
165
171
166
		if (((combo.getText() == null) || (combo.getText().equals("")) //$NON-NLS-1$
172
		if ((itemSelected == null || itemSelected.equals("") //$NON-NLS-1$
167
		|| (combo.getText().trim().length() < 1)) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) {
173
		|| itemSelected.trim().length() < 1) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) {
168
169
			retVal = false;
174
			retVal = false;
170
		}
175
		}
171
		return retVal;
176
		return retVal;
(-)templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPage.java (-1 / +2 lines)
Lines 97-102 Link Here
97
97
98
		title = name;
98
		title = name;
99
		uiElement = element;
99
		uiElement = element;
100
		uiElement.setValues(valueStore);
100
		this.valueStore = valueStore;
101
		this.valueStore = valueStore;
101
		//TODO: Check the from which plugin the PLUGIN_ID comes from i.e. from CCorePlugin or CUIPlugin
102
		//TODO: Check the from which plugin the PLUGIN_ID comes from i.e. from CCorePlugin or CUIPlugin
102
		pageId = CUIPlugin.getPluginId() + "." + //$NON-NLS-1$
103
		pageId = CUIPlugin.getPluginId() + "." + //$NON-NLS-1$
Lines 131-137 Link Here
131
	 * @return HashMap. The data contained in the widgets on this page.
132
	 * @return HashMap. The data contained in the widgets on this page.
132
	 */
133
	 */
133
	public Map/*<String, String>*/ getPageData() {
134
	public Map/*<String, String>*/ getPageData() {
134
		return uiComposite.getPageData();
135
		return uiElement.getValues();
135
	}
136
	}
136
137
137
	/**
138
	/**
(-)templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java (-7 / +3 lines)
Lines 54-60 Link Here
54
	/**
54
	/**
55
	 * Indicates whether this page is complete.
55
	 * Indicates whether this page is complete.
56
	 */
56
	 */
57
	private boolean isPageComplete = true;
57
	private boolean isPageComplete;
58
58
59
	/**
59
	/**
60
	 * That page that was shown right before this page became visible. null if none.
60
	 * That page that was shown right before this page became visible. null if none.
Lines 63-70 Link Here
63
63
64
	private IWizardPage nextPage = null;
64
	private IWizardPage nextPage = null;
65
	
65
	
66
	private Map valueStore;
67
68
	/**
66
	/**
69
	 * Title of the page, Page Name and UIElement group are the parameters.
67
	 * Title of the page, Page Name and UIElement group are the parameters.
70
	 * 
68
	 * 
Lines 79-85 Link Here
79
		super(title, uiElement, valueStore);
77
		super(title, uiElement, valueStore);
80
		name = pageName;
78
		name = pageName;
81
		validInvalid = new HashMap/*<Object, String>*/();
79
		validInvalid = new HashMap/*<Object, String>*/();
82
		this.valueStore = valueStore;
80
		isPageComplete = uiElement.isValid();
83
	}
81
	}
84
82
85
	/**
83
	/**
Lines 219-225 Link Here
219
	 * @return boolean, true if this page is complete, otherwise false.
217
	 * @return boolean, true if this page is complete, otherwise false.
220
	 */
218
	 */
221
	public boolean isPageComplete() {
219
	public boolean isPageComplete() {
222
		return isPageComplete && getComposite() != null;
220
		return isPageComplete;
223
	}
221
	}
224
222
225
	/**
223
	/**
Lines 268-275 Link Here
268
	public void createControl(Composite parent) {
266
	public void createControl(Composite parent) {
269
		super.createControl(parent);
267
		super.createControl(parent);
270
		(super.getComposite()).addPatternListener(this);
268
		(super.getComposite()).addPatternListener(this);
271
		(super.getComposite()).getUIElement().setValues(valueStore);
272
273
269
274
		// Page complete is set true of false, based on Mandatory attribute
270
		// Page complete is set true of false, based on Mandatory attribute
275
		// and Widgets contents.
271
		// and Widgets contents.
(-)templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java (-4 / +1 lines)
Lines 77-89 Link Here
77
	 * @return
77
	 * @return
78
	 */
78
	 */
79
	public Set/*<String>*/ getAllMacros() {
79
	public Set/*<String>*/ getAllMacros() {
80
		Set/*<String>*/ set = null;
80
		Set/*<String>*/ set = new HashSet/*<String>*/();
81
		for (Iterator i = conditionalProcessGroupList.iterator(); i.hasNext();) {
81
		for (Iterator i = conditionalProcessGroupList.iterator(); i.hasNext();) {
82
			Set/*<String>*/ subSet = ((ConditionalProcessGroup)i.next()).getAllMacros();
82
			Set/*<String>*/ subSet = ((ConditionalProcessGroup)i.next()).getAllMacros();
83
			if (subSet != null) {
83
			if (subSet != null) {
84
				if (set == null) {
85
					set = new HashSet/*<String>*/();
86
				}
87
				set.addAll(subSet);
84
				set.addAll(subSet);
88
			}
85
			}
89
		}
86
		}
(-)templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java (+4 lines)
Lines 90-95 Link Here
90
		return (String[]) toolChainIdSet.toArray(new String[toolChainIdSet.size()]);
90
		return (String[]) toolChainIdSet.toArray(new String[toolChainIdSet.size()]);
91
	}
91
	}
92
92
93
	public void setToolChainSet(Set toolChainIdSet) {
94
		this.toolChainIdSet = toolChainIdSet;
95
	}
96
	
93
	/**
97
	/**
94
	 * @return the isCategory
98
	 * @return the isCategory
95
	 */
99
	 */
(-)templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java (-5 / +15 lines)
Lines 43-48 Link Here
43
	private static final String DESCRIPTION = "description"; //$NON-NLS-1$
43
	private static final String DESCRIPTION = "description"; //$NON-NLS-1$
44
	private static final String LABEL = "label"; //$NON-NLS-1$
44
	private static final String LABEL = "label"; //$NON-NLS-1$
45
	private static final String ID = "id"; //$NON-NLS-1$
45
	private static final String ID = "id"; //$NON-NLS-1$
46
	private static final String TYPE = "type"; //$NON-NLS-1$
46
	
47
	
47
	private static Map/*<TemplateInfo, Template>*/ templateCache = new HashMap/*<TemplateInfo, Template>*/();
48
	private static Map/*<TemplateInfo, Template>*/ templateCache = new HashMap/*<TemplateInfo, Template>*/();
48
49
Lines 60-65 Link Here
60
	private String description;
61
	private String description;
61
	private String label;
62
	private String label;
62
	private String templateId;
63
	private String templateId;
64
	private String templateType;
63
	private boolean fireDirtyEvents;
65
	private boolean fireDirtyEvents;
64
	
66
	
65
	/**
67
	/**
Lines 91-101 Link Here
91
	 */
93
	 */
92
	public Set/*<String>*/ getAllMissingMacrosInProcesses() {
94
	public Set/*<String>*/ getAllMissingMacrosInProcesses() {
93
		Set/*<String>*/ set = new TreeSet/*<String>*/(allMacrosInProcesses);
95
		Set/*<String>*/ set = new TreeSet/*<String>*/(allMacrosInProcesses);
94
		if (set != null) {
96
		for (Iterator iter = set.iterator(); iter.hasNext();) {
95
			for (Iterator iter = set.iterator(); iter.hasNext();) {
97
			if (valueStore.get(iter.next()) != null) {
96
				if (valueStore.get(iter.next()) != null) {
98
				iter.remove();
97
					iter.remove();
98
				}
99
			}
99
			}
100
		}
100
		}
101
		return set;
101
		return set;
Lines 155-160 Link Here
155
	}
155
	}
156
	
156
	
157
	/**
157
	/**
158
	 * @return   String, which contains the id of the template
159
	 */
160
	public String getTemplateType() {
161
        if (templateType == null) {
162
        	templateType = templateDescriptor.getRootElement().getAttribute(TYPE).trim();
163
        }
164
        return templateType;
165
	}
166
	
167
	/**
158
	 * @return   String, which contains the Label
168
	 * @return   String, which contains the Label
159
	 */
169
	 */
160
	public String getLabel() {
170
	public String getLabel() {
(-)templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java (+32 lines)
Lines 13-18 Link Here
13
import java.io.IOException;
13
import java.io.IOException;
14
import java.net.URL;
14
import java.net.URL;
15
import java.util.ArrayList;
15
import java.util.ArrayList;
16
import java.util.Arrays;
16
import java.util.HashMap;
17
import java.util.HashMap;
17
import java.util.HashSet;
18
import java.util.HashSet;
18
import java.util.Iterator;
19
import java.util.Iterator;
Lines 40-45 Link Here
40
public class TemplateEngine {
41
public class TemplateEngine {
41
42
42
	public static String TEMPLATES_EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".templates"; //$NON-NLS-1$
43
	public static String TEMPLATES_EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".templates"; //$NON-NLS-1$
44
	public static String ADD_TOOLCHAINS_TO_TEMPLATE_EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".addToolChainsToTemplate"; //$NON-NLS-1$
43
	
45
	
44
	/**
46
	/**
45
	 * static reference to the Singleton TemplateEngine instance.
47
	 * static reference to the Singleton TemplateEngine instance.
Lines 227-234 Link Here
227
				((List/*<TemplateInfo>*/)templateInfoMap.get(projectType)).add(templateInfo);
229
				((List/*<TemplateInfo>*/)templateInfoMap.get(projectType)).add(templateInfo);
228
			}
230
			}
229
		}
231
		}
232
		// Check for tool Chains added to the templates outside template info definition
233
		addToolChainsToTemplates();
230
	}
234
	}
231
235
236
	private void addToolChainsToTemplates() {
237
		String location = null;
238
		TemplateInfo[] templateInfos = getTemplateInfos();
239
240
		IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint(ADD_TOOLCHAINS_TO_TEMPLATE_EXTENSION_ID).getExtensions();
241
		for(int i=0; i<extensions.length; i++) {
242
			IExtension extension = extensions[i];
243
			IConfigurationElement[] configElements = extension.getConfigurationElements();
244
			for(int j=0; j<configElements.length; j++) {
245
				IConfigurationElement config = configElements[j];
246
				location = config.getAttribute(TemplateEngineHelper.LOCATION);
247
				
248
				IConfigurationElement[] toolChainConfigs = config.getChildren(TemplateEngineHelper.TOOL_CHAIN);
249
				Set toolChainIdSet = new HashSet();
250
				for (int k=0; k < toolChainConfigs.length; k++) {
251
					toolChainIdSet.add(toolChainConfigs[k].getAttribute(TemplateEngineHelper.ID));
252
				}
253
				
254
				for (int k=0; k < templateInfos.length; k++) {
255
					if (templateInfos[k].getTemplatePath().equals(location)) {
256
						toolChainIdSet.addAll(Arrays.asList(templateInfos[k].getToolChainIds()));
257
						templateInfos[k].setToolChainSet(toolChainIdSet);
258
					}
259
				}
260
			}
261
		}
262
	}
263
	
232
	/**
264
	/**
233
	 * Gets an array of template info objects matching the criteria passed as params.
265
	 * Gets an array of template info objects matching the criteria passed as params.
234
	 */
266
	 */
(-)plugin.xml (+1 lines)
Lines 629-634 Link Here
629
   <extension-point id="templates" name="Templates Extension point" 
629
   <extension-point id="templates" name="Templates Extension point" 
630
                    schema="schema/templates.exsd"/>
630
                    schema="schema/templates.exsd"/>
631
   <extension-point id="templateProcessTypes" name="Process Types Extension point" schema="schema/templateProcessTypes.exsd"/>
631
   <extension-point id="templateProcessTypes" name="Process Types Extension point" schema="schema/templateProcessTypes.exsd"/>
632
   <extension-point id="addToolChainsToTemplate" name="Add Tool Chains To Templates" schema="schema/addToolChainsToTemplate.exsd"/>
632
633
633
   <extension
634
   <extension
634
         point="org.eclipse.cdt.core.templateProcessTypes">
635
         point="org.eclipse.cdt.core.templateProcessTypes">
(-)schema/addToolChainsToTemplate.exsd (+134 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.cdt.core">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.cdt.core" id="addToolChainsToTemplate" name="Add ToolChains to Template"/>
7
      </appInfo>
8
      <documentation>
9
         This extension point facilitates adding new toolchains generated from a different plugin to already defined template without modifying template definition.
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <documentation>
16
            Extension point added to Template Engine plugin.  Any plugin, which intends to contribute XML templates to Temaplate Engine has to extend this extension point, and add template element.
17
         </documentation>
18
      </annotation>
19
      <complexType>
20
         <sequence>
21
            <sequence>
22
               <element ref="template" minOccurs="0" maxOccurs="unbounded"/>
23
            </sequence>
24
         </sequence>
25
         <attribute name="point" type="string" use="required">
26
            <annotation>
27
               <documentation>
28
                  
29
               </documentation>
30
            </annotation>
31
         </attribute>
32
         <attribute name="id" type="string">
33
            <annotation>
34
               <documentation>
35
                  Id for the extension in the extender plugin.
36
               </documentation>
37
            </annotation>
38
         </attribute>
39
         <attribute name="name" type="string">
40
            <annotation>
41
               <documentation>
42
                  
43
               </documentation>
44
               <appInfo>
45
                  <meta.attribute translatable="true"/>
46
               </appInfo>
47
            </annotation>
48
         </attribute>
49
      </complexType>
50
   </element>
51
52
   <element name="toolChain">
53
      <complexType>
54
         <attribute name="id" type="string" use="required">
55
            <annotation>
56
               <documentation>
57
                  
58
               </documentation>
59
            </annotation>
60
         </attribute>
61
      </complexType>
62
   </element>
63
64
   <element name="template">
65
      <complexType>
66
         <sequence>
67
            <element ref="toolChain" minOccurs="0" maxOccurs="unbounded"/>
68
         </sequence>
69
         <attribute name="location" type="string" use="required">
70
            <annotation>
71
               <documentation>
72
                  
73
               </documentation>
74
               <appInfo>
75
                  <meta.attribute kind="resource"/>
76
               </appInfo>
77
            </annotation>
78
         </attribute>
79
      </complexType>
80
   </element>
81
82
   <annotation>
83
      <appInfo>
84
         <meta.section type="since"/>
85
      </appInfo>
86
      <documentation>
87
         This extension point was added in CDT 4.0
88
      </documentation>
89
   </annotation>
90
91
   <annotation>
92
      <appInfo>
93
         <meta.section type="examples"/>
94
      </appInfo>
95
      <documentation>
96
         
97
      </documentation>
98
   </annotation>
99
100
   <annotation>
101
      <appInfo>
102
         <meta.section type="apiInfo"/>
103
      </appInfo>
104
      <documentation>
105
         
106
      </documentation>
107
   </annotation>
108
109
   <annotation>
110
      <appInfo>
111
         <meta.section type="implementation"/>
112
      </appInfo>
113
      <documentation>
114
         
115
      </documentation>
116
   </annotation>
117
118
   <annotation>
119
      <appInfo>
120
         <meta.section type="copyright"/>
121
      </appInfo>
122
      <documentation>
123
         Copyright (c) 2007 Symbian Software Limited and others.
124
All rights reserved. This program and the accompanying materials
125
are made available under the terms of the Eclipse Public License v1.0
126
which accompanies this distribution, and is available at
127
http://www.eclipse.org/legal/epl-v10.html
128
129
Contributors:
130
Symbian - Initial API and implementation
131
      </documentation>
132
   </annotation>
133
134
</schema>
(-)suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java (-1 / +2 lines)
Lines 33-38 Link Here
33
import org.eclipse.cdt.core.parser.failedTests.FailedCompleteParseASTTest;
33
import org.eclipse.cdt.core.parser.failedTests.FailedCompleteParseASTTest;
34
import org.eclipse.cdt.core.parser.failedTests.STLFailedTests;
34
import org.eclipse.cdt.core.parser.failedTests.STLFailedTests;
35
import org.eclipse.cdt.core.parser.tests.ParserTestSuite;
35
import org.eclipse.cdt.core.parser.tests.ParserTestSuite;
36
import org.eclipse.cdt.core.tests.templateengine.AllTemplateEngineTests;
36
import org.eclipse.cdt.internal.index.tests.IndexTests;
37
import org.eclipse.cdt.internal.index.tests.IndexTests;
37
import org.eclipse.cdt.internal.pdom.tests.PDOMTests;
38
import org.eclipse.cdt.internal.pdom.tests.PDOMTests;
38
39
Lines 91-97 Link Here
91
		suite.addTestSuite(STLFailedTests.class);
92
		suite.addTestSuite(STLFailedTests.class);
92
		suite.addTestSuite(FailedCompleteParseASTTest.class);
93
		suite.addTestSuite(FailedCompleteParseASTTest.class);
93
94
94
//        suite.addTest(AllTemplateEngineTests.suite());
95
        suite.addTest(AllTemplateEngineTests.suite());
95
96
96
		return suite;
97
		return suite;
97
	}
98
	}
(-)templateengine/org/eclipse/cdt/core/tests/templateengine/TestValueStore.java (-3 / +2 lines)
Lines 17-23 Link Here
17
17
18
import org.eclipse.cdt.core.templateengine.TemplateCore;
18
import org.eclipse.cdt.core.templateengine.TemplateCore;
19
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
19
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
20
import org.eclipse.cdt.core.templateengine.TemplateEngine;
21
20
22
21
23
/**
22
/**
Lines 49-55 Link Here
49
	 *
48
	 *
50
	 */
49
	 */
51
	public void testValueStoreNotNull(){
50
	public void testValueStoreNotNull(){
52
		TemplateCore[] templates = TemplateEngine.getDefault().getTemplates();
51
		TemplateCore[] templates = TemplateEngineTestsHelper.getTestTemplates();
53
		for (int i=0; i <templates.length; i++) {
52
		for (int i=0; i <templates.length; i++) {
54
			Map valueStore = templates[i].getValueStore();
53
			Map valueStore = templates[i].getValueStore();
55
			assertNotNull(valueStore);
54
			assertNotNull(valueStore);
Lines 61-67 Link Here
61
	 * FactoryDefaults. Test the same.
60
	 * FactoryDefaults. Test the same.
62
	 */
61
	 */
63
	public void testCompareValueStoreWithTemplateDefaluts(){
62
	public void testCompareValueStoreWithTemplateDefaluts(){
64
		TemplateCore[] templates = TemplateEngine.getDefault().getTemplates();
63
		TemplateCore[] templates = TemplateEngineTestsHelper.getTestTemplates();
65
		for (int i=0; i <templates.length; i++) {
64
		for (int i=0; i <templates.length; i++) {
66
			Map valueStore = templates[i].getValueStore();
65
			Map valueStore = templates[i].getValueStore();
67
			TemplateDescriptor templateDescriptor = templates[i].getTemplateDescriptor();
66
			TemplateDescriptor templateDescriptor = templates[i].getTemplateDescriptor();
(-)templateengine/org/eclipse/cdt/core/tests/templateengine/TemplateEngineTestsHelper.java (+13 lines)
Lines 12-21 Link Here
12
12
13
import java.io.IOException;
13
import java.io.IOException;
14
import java.net.URL;
14
import java.net.URL;
15
import java.util.ArrayList;
15
import java.util.List;
16
import java.util.List;
16
17
17
import junit.framework.Assert;
18
import junit.framework.Assert;
18
19
20
import org.eclipse.cdt.core.templateengine.TemplateCore;
19
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
21
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
20
import org.eclipse.cdt.core.templateengine.TemplateEngine;
22
import org.eclipse.cdt.core.templateengine.TemplateEngine;
21
import org.eclipse.cdt.core.testplugin.CTestPlugin;
23
import org.eclipse.cdt.core.testplugin.CTestPlugin;
Lines 61-66 Link Here
61
		return url;
63
		return url;
62
	}
64
	}
63
	
65
	
66
	public static TemplateCore[] getTestTemplates() {
67
		TemplateCore[] templates = TemplateEngine.getDefault().getTemplates();
68
	    List testTemplates = new ArrayList();
69
		for (int i =0; i < templates.length; i++) {
70
			if (templates[i].getTemplateType().equals("TestTemplate")) {
71
				testTemplates.add(templates[i]);
72
			}
73
		}
74
		return (TemplateCore[]) testTemplates.toArray(new TemplateCore[testTemplates.size()]); 
75
	}
76
	
64
	public static int getChildCount(TemplateDescriptor templateDescriptor, String propertyGroupID){
77
	public static int getChildCount(TemplateDescriptor templateDescriptor, String propertyGroupID){
65
		List list = templateDescriptor.getPropertyGroupList();
78
		List list = templateDescriptor.getPropertyGroupList();
66
		for (int i = 0, l = list.size(); i < l; i++) {
79
		for (int i = 0, l = list.size(); i < l; i++) {
(-)templateengine/org/eclipse/cdt/core/tests/templateengine/TestTemplateCore.java (-2 / +1 lines)
Lines 13-19 Link Here
13
import junit.framework.TestCase;
13
import junit.framework.TestCase;
14
14
15
import org.eclipse.cdt.core.templateengine.TemplateCore;
15
import org.eclipse.cdt.core.templateengine.TemplateCore;
16
import org.eclipse.cdt.core.templateengine.TemplateEngine;
17
16
18
/**
17
/**
19
 * Test the functionality of Tempalte Class.
18
 * Test the functionality of Tempalte Class.
Lines 24-30 Link Here
24
    
23
    
25
    protected void setUp() throws Exception {
24
    protected void setUp() throws Exception {
26
		super.setUp();
25
		super.setUp();
27
		templates = TemplateEngine.getDefault().getTemplates();
26
		templates = TemplateEngineTestsHelper.getTestTemplates();
28
	}
27
	}
29
28
30
	/*
29
	/*
(-)plugin.xml (+13 lines)
Lines 103-107 Link Here
103
            location="testdata/CreateSourceFolder.xml"
103
            location="testdata/CreateSourceFolder.xml"
104
            projectType="org.eclipse.cdt.core.tests.projectType"/>
104
            projectType="org.eclipse.cdt.core.tests.projectType"/>
105
   </extension>
105
   </extension>
106
   <extension
107
         point="org.eclipse.cdt.core.addToolChainsToTemplate">
108
      <template
109
	     location="testdata/AddFile.xml">
110
         <toolChain id="org.eclipse.cdt.core.tests.toolChain3"/>
111
         <toolChain id="org.eclipse.cdt.core.tests.toolChain4"/>
112
      </template>
113
      <template
114
	     location="testdata/AddFiles.xml">
115
         <toolChain id="org.eclipse.cdt.core.tests.toolChain5"/>
116
         <toolChain id="org.eclipse.cdt.core.tests.toolChain6"/>
117
      </template>
118
   </extension>
106
119
107
</plugin>
120
</plugin>

Return to bug 184449