Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66643 Details for
Bug 184449
[Template Engine] It should be possible to press "Finish" on the first wizard page for templates having default values assigned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch with fixes for 184449, 184445 and 184593
bugFix.txt (text/plain), 39.61 KB, created by
Bala Torati
on 2007-05-10 06:55:09 EDT
(
hide
)
Description:
Patch with fixes for 184449, 184445 and 184593
Filename:
MIME Type:
Creator:
Bala Torati
Created:
2007-05-10 06:55:09 EDT
Size:
39.61 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.ui >Index: templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java,v >retrieving revision 1.1 >diff -u -r1.1 UITextWidget.java >--- templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java 26 Apr 2007 17:07:39 -0000 1.1 >+++ templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UITextWidget.java 10 May 2007 10:48:44 -0000 >@@ -50,7 +50,7 @@ > /** > * Attributes associated with this widget. > */ >- private UIAttributes/*<String, String>*/ uiAttribute; >+ protected UIAttributes/*<String, String>*/ uiAttribute; > > /** > * Text widget. >@@ -67,6 +67,8 @@ > * 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. > */ > protected UIComposite uiComposite; >+ >+ protected String textValue; > > /** > * Constructor. >@@ -77,6 +79,7 @@ > public UITextWidget(UIAttributes/*<String, String>*/ uiAttribute) { > super(uiAttribute); > this.uiAttribute = uiAttribute; >+ this.textValue = new String(); > } > > /** >@@ -84,7 +87,7 @@ > */ > public Map/*<String, String>*/ getValues() { > Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/(); >- retMap.put(uiAttribute.get(InputUIElement.ID), text.getText()); >+ retMap.put(uiAttribute.get(InputUIElement.ID), textValue); > > return retMap; > } >@@ -108,7 +111,7 @@ > val = subString; > } > val = val.trim(); >- text.setText(val); >+ textValue = val; > } > } > >@@ -141,6 +144,7 @@ > text = getTextWidget((String) uiAttribute.get(UIElement.TYPE)); > text.addModifyListener(this); > text.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$ >+ text.setText(textValue); > } > > /** >@@ -213,17 +217,17 @@ > // other classes, having Text widget. They can just make use of > // modifyText, > // evaluatePattern and isValid. >- String inputText = text.getText(); >+ textValue = text.getText(); > >- if ((patternValue == null) || (inputText == null)) >+ if ((patternValue == null) || (textValue == null)) > return; > > String mandatory = (String) attribute.get(InputUIElement.MANDATORY); >- if ((mandatory == null || !mandatory.equalsIgnoreCase("true")) && inputText.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$ >+ if ((mandatory == null || !mandatory.equalsIgnoreCase("true")) && textValue.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$ > return; > } > >- evaluatePattern(label.getText(), inputText, patternValue); >+ evaluatePattern(label.getText(), textValue, patternValue); > } > > /** >@@ -261,8 +265,8 @@ > String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY); > > if (((mandatory != null) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) >- && ((text.getText() == null) || (text.getText().equals("")) || //$NON-NLS-1$ >- (text.getText().trim().length() < 1))) { >+ && ((textValue == null) || (textValue.equals("")) || //$NON-NLS-1$ >+ (textValue.trim().length() < 1))) { > > retVal = false; > } >Index: templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBrowseWidget.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBrowseWidget.java,v >retrieving revision 1.1 >diff -u -r1.1 UIBrowseWidget.java >--- templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBrowseWidget.java 26 Apr 2007 17:07:39 -0000 1.1 >+++ templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBrowseWidget.java 10 May 2007 10:48:43 -0000 >@@ -32,15 +32,11 @@ > */ > > public class UIBrowseWidget extends UITextWidget implements ModifyListener { >- /** >- * Attributes associated with this widget. >- */ >- UIAttributes/*<String, String>*/ uiAttribute; > > /** > * Browse Button of this widget. > */ >- Button button; >+ protected Button button; > > /** > * Constructor. >@@ -51,6 +47,7 @@ > public UIBrowseWidget(UIAttributes/*<String, String>*/ uiAttribute) { > super(uiAttribute); > this.uiAttribute = uiAttribute; >+ this.textValue = (String) uiAttribute.get(InputUIElement.DEFAULT); > } > > /** >@@ -83,10 +80,7 @@ > text = new Text(textConatiner, SWT.SINGLE | SWT.LEFT | SWT.BORDER); > text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > text.addModifyListener(this); >- >- // set Default values >- if (uiAttribute.get(InputUIElement.DEFAULT) != null) >- text.setText((String) uiAttribute.get(InputUIElement.DEFAULT)); >+ text.setText(textValue); > > button = new Button(textConatiner, SWT.PUSH | SWT.LEFT); > button.setText(InputUIElement.BROWSELABEL); >@@ -95,7 +89,8 @@ > public void widgetSelected(SelectionEvent event) { > String fileName = new FileDialog(uiComposite.getShell()).open(); > if (fileName != null) { >- text.setText(fileName.toString()); >+ textValue = fileName.toString(); >+ text.setText(textValue); > } > } > }); >Index: templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java,v >retrieving revision 1.1 >diff -u -r1.1 UIBooleanWidget.java >--- templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java 26 Apr 2007 17:07:39 -0000 1.1 >+++ templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIBooleanWidget.java 10 May 2007 10:48:43 -0000 >@@ -14,6 +14,8 @@ > import java.util.Map; > > import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; >@@ -35,22 +37,24 @@ > /** > * Attributes associated with this widget. > */ >- UIAttributes/*<String, String>*/ uiAttribute; >+ protected UIAttributes/*<String, String>*/ uiAttribute; > > /** > * Boolean widget. > */ >- Button button; >+ protected Button button; > > /** > * Label of this widget. > */ >- Label label; >+ protected Label label; > > /** > * Composite to which this widget control is added. > */ >- UIComposite uiComposite; >+ protected UIComposite uiComposite; >+ >+ private boolean booleanValue; > > /** > * Constructor. >@@ -61,6 +65,7 @@ > public UIBooleanWidget(UIAttributes/*<String, String>*/ uiAttribute) { > super(uiAttribute); > this.uiAttribute = uiAttribute; >+ this.booleanValue = false; > } > > /** >@@ -69,8 +74,7 @@ > public Map/*<String, String>*/ getValues() { > > Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/(); >- Boolean isCheck = new Boolean(button.getSelection()); >- retMap.put(uiAttribute.get(InputUIElement.ID), isCheck.toString()); >+ retMap.put(uiAttribute.get(InputUIElement.ID), new Boolean(booleanValue).toString()); > > return retMap; > } >@@ -81,11 +85,7 @@ > * @param valueMap > */ > public void setValues(Map/*<String, String>*/ valueMap) { >- String val = (String) valueMap.get(uiAttribute.get(InputUIElement.ID)); >- Boolean bool = new Boolean(val); >- if (val != null) { >- button.setSelection(bool.booleanValue()); >- } >+ booleanValue = new Boolean((String) valueMap.get(uiAttribute.get(InputUIElement.ID))).booleanValue(); > } > > /** >@@ -116,6 +116,12 @@ > booleanConatiner.setLayoutData(gridcData); > button = new Button(booleanConatiner, SWT.CHECK); > button.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$ >+ button.setSelection(new Boolean(booleanValue).booleanValue()); >+ button.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ booleanValue = button.getSelection(); >+ } >+ }); > } > > /** >@@ -130,7 +136,7 @@ > boolean retVal = true; > String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY); > >- if ((button.getSelection() == false) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) { >+ if (!booleanValue && mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE)) { > retVal = false; > } > return retVal; >Index: templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java,v >retrieving revision 1.1 >diff -u -r1.1 UIStringListWidget.java >--- templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java 26 Apr 2007 17:07:39 -0000 1.1 >+++ templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UIStringListWidget.java 10 May 2007 10:48:43 -0000 >@@ -1,5 +1,4 @@ > /******************************************************************************* >- * Copyright (c) 2007 Symbian Software Limited and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -10,7 +9,10 @@ > *******************************************************************************/ > package org.eclipse.cdt.ui.templateengine.uitree.uiwidgets; > >+import java.util.ArrayList; >+import java.util.Arrays; > import java.util.HashMap; >+import java.util.List; > import java.util.Map; > import java.util.StringTokenizer; > >@@ -25,6 +27,7 @@ > import org.eclipse.cdt.ui.templateengine.uitree.UIAttributes; > import org.eclipse.cdt.ui.templateengine.uitree.UIElement; > import org.eclipse.cdt.utils.ui.controls.FileListControl; >+import org.eclipse.cdt.utils.ui.controls.IFileListChangeListener; > > > /** >@@ -37,22 +40,24 @@ > /** > * Attributes associated with this widget. > */ >- UIAttributes/*<String, String>*/ uiAttribute; >+ protected UIAttributes/*<String, String>*/ uiAttribute; > > /** > * StringList widget. > */ >- FileListControl fileListControl; >+ protected FileListControl fileListControl; > > /** > * Label of this widget. > */ >- Label label; >+ protected Label label; > > /** > * Composite to which this widget control is added. > */ >- UIComposite uiComposite; >+ protected UIComposite uiComposite; >+ >+ protected List itemsList; > > /** > * Constructor. >@@ -63,6 +68,7 @@ > public UIStringListWidget(UIAttributes/*<String, String>*/ attribute) { > super(attribute); > uiAttribute = attribute; >+ itemsList = new ArrayList(); > } > > /** >@@ -70,12 +76,10 @@ > */ > public Map/*<String, String>*/ getValues() { > Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/(); >- String[] items = fileListControl.getItems(); > String itemString = new String(); >- >- for (int i = 0; i < items.length; i++) >- itemString = itemString + items[i] + "|"; //$NON-NLS-1$ >- >+ for (int i = 0; i < itemsList.size(); i++) { >+ itemString = itemString + itemsList.get(i) + "|"; //$NON-NLS-1$ >+ } > retMap.put(uiAttribute.get(InputUIElement.ID), itemString); > > return retMap; >@@ -87,19 +91,14 @@ > * @param valueMap > */ > public void setValues(Map/*<String, String>*/ valueMap) { >- > String items = (String) valueMap.get(uiAttribute.get(InputUIElement.ID)); > > if (items != null) { > items = items.trim(); > StringTokenizer st = new StringTokenizer(items, "|"); //$NON-NLS-1$ >- String[] itemList = new String[st.countTokens()]; >- >- for (int i = 0; st.hasMoreTokens(); i++) >- itemList[i] = st.nextToken(); >- >- fileListControl.setList(itemList); >- fileListControl.setSelection(0); >+ for (int i = 0; st.hasMoreTokens(); i++) { >+ itemsList.add(st.nextToken()); >+ } > } > } > >@@ -133,6 +132,14 @@ > flcComposite.setLayoutData(gridData); > > fileListControl = new FileListControl(flcComposite, (String) uiAttribute.get(InputUIElement.WIDGETLABEL), 0); >+ fileListControl.setList((String[])itemsList.toArray()); >+ fileListControl.setSelection(0); >+ fileListControl.addChangeListener(new IFileListChangeListener(){ >+ public void fileListChanged(FileListControl fileList, String oldValue[], String newValue[]) { >+ itemsList.addAll(Arrays.asList(newValue)); >+ } >+ }); >+ > } > > /** >@@ -147,8 +154,7 @@ > boolean retVal = true; > String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY); > >- if ((fileListControl.getItems() == null) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) { >- >+ if ((itemsList == null || itemsList.size() == 0) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) { > retVal = false; > } > return retVal; >Index: templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISpecialListWidget.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISpecialListWidget.java,v >retrieving revision 1.1 >diff -u -r1.1 UISpecialListWidget.java >--- templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISpecialListWidget.java 26 Apr 2007 17:07:39 -0000 1.1 >+++ templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISpecialListWidget.java 10 May 2007 10:48:43 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.cdt.ui.templateengine.uitree.uiwidgets; > >+import java.util.Arrays; >+ > import org.eclipse.swt.SWT; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; >@@ -20,6 +22,7 @@ > import org.eclipse.cdt.ui.templateengine.uitree.UIAttributes; > import org.eclipse.cdt.ui.templateengine.uitree.UIElement; > import org.eclipse.cdt.utils.ui.controls.FileListControl; >+import org.eclipse.cdt.utils.ui.controls.IFileListChangeListener; > > > /** >@@ -69,6 +72,13 @@ > flcComposite.setLayoutData(gridData); > > fileListControl = new FileListControl(flcComposite, (String) uiAttribute.get(InputUIElement.WIDGETLABEL), 1); >+ fileListControl.setList((String[])itemsList.toArray()); >+ fileListControl.setSelection(0); >+ fileListControl.addChangeListener(new IFileListChangeListener(){ >+ public void fileListChanged(FileListControl fileList, String oldValue[], String newValue[]) { >+ itemsList.addAll(Arrays.asList(newValue)); >+ } >+ }); > } > > /** >Index: templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java,v >retrieving revision 1.1 >diff -u -r1.1 UISelectWidget.java >--- templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java 26 Apr 2007 17:07:39 -0000 1.1 >+++ templateengine/org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidget.java 10 May 2007 10:48:43 -0000 >@@ -16,6 +16,8 @@ > import java.util.Set; > > import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Combo; >@@ -35,32 +37,32 @@ > /** > * Attributes associated with this widget. > */ >- UIAttributes/*<String, String>*/ uiAttribute; >+ protected UIAttributes/*<String, String>*/ uiAttribute; > > /** > * Select widget. > */ >- Combo combo; >+ protected Combo combo = null; > > /** > * Label of this widget. > */ >- Label label; >+ protected Label label; > > /** > * Composite to which this widget control is added. > */ >- UIComposite uiComposite; >+ protected UIComposite uiComposite; > > /** > * Map contains the values of Select Widget > */ >- HashMap/*<String, String>*/ itemMap; >+ protected HashMap/*<String, String>*/ itemMap; > > /** > * Default value of Select Widget > */ >- String itemSelected; >+ protected String itemSelected; > > /** > * Constructor for Select Widget. >@@ -70,20 +72,16 @@ > */ > public UISelectWidget(UIAttributes/*<String, String>*/ attribute, HashMap/*<String, String>*/ itemMap, > String itemSelected) { >- > super(attribute); > uiAttribute = attribute; > this.itemMap = itemMap; > this.itemSelected = itemSelected; > } > >- /** >- * @return Boolean value contained in the Boolean Widget. >- */ > public Map/*<String, String>*/ getValues() { > > Map/*<String, String>*/ retMap = new HashMap/*<String, String>*/(); >- retMap.put(uiAttribute.get(InputUIElement.ID), itemMap.get(combo.getItem(combo.getSelectionIndex()))); >+ retMap.put(uiAttribute.get(InputUIElement.ID), itemSelected); > > return retMap; > } >@@ -94,17 +92,17 @@ > * @param valueMap > */ > public void setValues(Map/*<String, String>*/ valueMap) { >- >- String val = (String) valueMap.get(uiAttribute.get(InputUIElement.ID)); >- if (val != null) >- val = val.trim(); >- String[] items = combo.getItems(); >- int index = 0; >- for (int i = 0; i < items.length; i++) >- if (itemMap.get(items[i]).equals(val)) >- index = i; >- >- combo.select(index); >+ itemSelected = (String) valueMap.get(uiAttribute.get(InputUIElement.ID)); >+ >+ if (combo != null) { >+ String[] items = combo.getItems(); >+ for (int i=0; i < items.length; i++) { >+ if (items[i].equals(itemSelected)) { >+ combo.select(i); >+ break; >+ } >+ } >+ } > } > > /** >@@ -149,6 +147,14 @@ > > combo.select(index); > combo.setData(".uid", uiAttribute.get(UIElement.ID)); //$NON-NLS-1$ >+ combo.addSelectionListener(new SelectionListener() { >+ public void widgetSelected(SelectionEvent e) { >+ itemSelected = combo.getItem(combo.getSelectionIndex()); >+ } >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ } >+ }); > } > > /** >@@ -163,9 +169,8 @@ > boolean retVal = true; > String mandatory = (String) uiAttribute.get(InputUIElement.MANDATORY); > >- if (((combo.getText() == null) || (combo.getText().equals("")) //$NON-NLS-1$ >- || (combo.getText().trim().length() < 1)) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) { >- >+ if ((itemSelected == null || itemSelected.equals("") //$NON-NLS-1$ >+ || itemSelected.trim().length() < 1) && (mandatory.equalsIgnoreCase(TemplateEngineHelper.BOOLTRUE))) { > retVal = false; > } > return retVal; >Index: templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPage.java,v >retrieving revision 1.1 >diff -u -r1.1 UIPage.java >--- templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPage.java 26 Apr 2007 17:07:39 -0000 1.1 >+++ templateengine/org/eclipse/cdt/ui/templateengine/pages/UIPage.java 10 May 2007 10:48:43 -0000 >@@ -97,6 +97,7 @@ > > title = name; > uiElement = element; >+ uiElement.setValues(valueStore); > this.valueStore = valueStore; > //TODO: Check the from which plugin the PLUGIN_ID comes from i.e. from CCorePlugin or CUIPlugin > pageId = CUIPlugin.getPluginId() + "." + //$NON-NLS-1$ >@@ -131,7 +132,7 @@ > * @return HashMap. The data contained in the widgets on this page. > */ > public Map/*<String, String>*/ getPageData() { >- return uiComposite.getPageData(); >+ return uiElement.getValues(); > } > > /** >Index: templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java,v >retrieving revision 1.1 >diff -u -r1.1 UIWizardPage.java >--- templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java 26 Apr 2007 17:07:39 -0000 1.1 >+++ templateengine/org/eclipse/cdt/ui/templateengine/pages/UIWizardPage.java 10 May 2007 10:48:43 -0000 >@@ -54,7 +54,7 @@ > /** > * Indicates whether this page is complete. > */ >- private boolean isPageComplete = true; >+ private boolean isPageComplete; > > /** > * That page that was shown right before this page became visible. null if none. >@@ -63,8 +63,6 @@ > > private IWizardPage nextPage = null; > >- private Map valueStore; >- > /** > * Title of the page, Page Name and UIElement group are the parameters. > * >@@ -79,7 +77,7 @@ > super(title, uiElement, valueStore); > name = pageName; > validInvalid = new HashMap/*<Object, String>*/(); >- this.valueStore = valueStore; >+ isPageComplete = uiElement.isValid(); > } > > /** >@@ -219,7 +217,7 @@ > * @return boolean, true if this page is complete, otherwise false. > */ > public boolean isPageComplete() { >- return isPageComplete && getComposite() != null; >+ return isPageComplete; > } > > /** >@@ -268,8 +266,6 @@ > public void createControl(Composite parent) { > super.createControl(parent); > (super.getComposite()).addPatternListener(this); >- (super.getComposite()).getUIElement().setValues(valueStore); >- > > // Page complete is set true of false, based on Mandatory attribute > // and Widgets contents. >#P org.eclipse.cdt.core >Index: templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java,v >retrieving revision 1.1 >diff -u -r1.1 TemplateProcessHandler.java >--- templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java 26 Apr 2007 17:07:27 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/templateengine/process/TemplateProcessHandler.java 10 May 2007 10:48:48 -0000 >@@ -77,13 +77,10 @@ > * @return > */ > public Set/*<String>*/ getAllMacros() { >- Set/*<String>*/ set = null; >+ Set/*<String>*/ set = new HashSet/*<String>*/(); > for (Iterator i = conditionalProcessGroupList.iterator(); i.hasNext();) { > Set/*<String>*/ subSet = ((ConditionalProcessGroup)i.next()).getAllMacros(); > if (subSet != null) { >- if (set == null) { >- set = new HashSet/*<String>*/(); >- } > set.addAll(subSet); > } > } >Index: templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java,v >retrieving revision 1.1 >diff -u -r1.1 TemplateInfo.java >--- templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java 26 Apr 2007 17:07:27 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java 10 May 2007 10:48:48 -0000 >@@ -90,6 +90,10 @@ > return (String[]) toolChainIdSet.toArray(new String[toolChainIdSet.size()]); > } > >+ public void setToolChainSet(Set toolChainIdSet) { >+ this.toolChainIdSet = toolChainIdSet; >+ } >+ > /** > * @return the isCategory > */ >Index: templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java,v >retrieving revision 1.1 >diff -u -r1.1 TemplateCore.java >--- templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java 26 Apr 2007 17:07:27 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java 10 May 2007 10:48:48 -0000 >@@ -43,6 +43,7 @@ > private static final String DESCRIPTION = "description"; //$NON-NLS-1$ > private static final String LABEL = "label"; //$NON-NLS-1$ > private static final String ID = "id"; //$NON-NLS-1$ >+ private static final String TYPE = "type"; //$NON-NLS-1$ > > private static Map/*<TemplateInfo, Template>*/ templateCache = new HashMap/*<TemplateInfo, Template>*/(); > >@@ -60,6 +61,7 @@ > private String description; > private String label; > private String templateId; >+ private String templateType; > private boolean fireDirtyEvents; > > /** >@@ -91,11 +93,9 @@ > */ > public Set/*<String>*/ getAllMissingMacrosInProcesses() { > Set/*<String>*/ set = new TreeSet/*<String>*/(allMacrosInProcesses); >- if (set != null) { >- for (Iterator iter = set.iterator(); iter.hasNext();) { >- if (valueStore.get(iter.next()) != null) { >- iter.remove(); >- } >+ for (Iterator iter = set.iterator(); iter.hasNext();) { >+ if (valueStore.get(iter.next()) != null) { >+ iter.remove(); > } > } > return set; >@@ -155,6 +155,16 @@ > } > > /** >+ * @return String, which contains the id of the template >+ */ >+ public String getTemplateType() { >+ if (templateType == null) { >+ templateType = templateDescriptor.getRootElement().getAttribute(TYPE).trim(); >+ } >+ return templateType; >+ } >+ >+ /** > * @return String, which contains the Label > */ > public String getLabel() { >Index: templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java,v >retrieving revision 1.1 >diff -u -r1.1 TemplateEngine.java >--- templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java 26 Apr 2007 17:07:27 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java 10 May 2007 10:48:48 -0000 >@@ -13,6 +13,7 @@ > import java.io.IOException; > import java.net.URL; > import java.util.ArrayList; >+import java.util.Arrays; > import java.util.HashMap; > import java.util.HashSet; > import java.util.Iterator; >@@ -40,6 +41,7 @@ > public class TemplateEngine { > > public static String TEMPLATES_EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".templates"; //$NON-NLS-1$ >+ public static String ADD_TOOLCHAINS_TO_TEMPLATE_EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".addToolChainsToTemplate"; //$NON-NLS-1$ > > /** > * static reference to the Singleton TemplateEngine instance. >@@ -227,8 +229,38 @@ > ((List/*<TemplateInfo>*/)templateInfoMap.get(projectType)).add(templateInfo); > } > } >+ // Check for tool Chains added to the templates outside template info definition >+ addToolChainsToTemplates(); > } > >+ private void addToolChainsToTemplates() { >+ String location = null; >+ TemplateInfo[] templateInfos = getTemplateInfos(); >+ >+ IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint(ADD_TOOLCHAINS_TO_TEMPLATE_EXTENSION_ID).getExtensions(); >+ for(int i=0; i<extensions.length; i++) { >+ IExtension extension = extensions[i]; >+ IConfigurationElement[] configElements = extension.getConfigurationElements(); >+ for(int j=0; j<configElements.length; j++) { >+ IConfigurationElement config = configElements[j]; >+ location = config.getAttribute(TemplateEngineHelper.LOCATION); >+ >+ IConfigurationElement[] toolChainConfigs = config.getChildren(TemplateEngineHelper.TOOL_CHAIN); >+ Set toolChainIdSet = new HashSet(); >+ for (int k=0; k < toolChainConfigs.length; k++) { >+ toolChainIdSet.add(toolChainConfigs[k].getAttribute(TemplateEngineHelper.ID)); >+ } >+ >+ for (int k=0; k < templateInfos.length; k++) { >+ if (templateInfos[k].getTemplatePath().equals(location)) { >+ toolChainIdSet.addAll(Arrays.asList(templateInfos[k].getToolChainIds())); >+ templateInfos[k].setToolChainSet(toolChainIdSet); >+ } >+ } >+ } >+ } >+ } >+ > /** > * Gets an array of template info objects matching the criteria passed as params. > */ >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/plugin.xml,v >retrieving revision 1.110 >diff -u -r1.110 plugin.xml >--- plugin.xml 26 Apr 2007 17:07:27 -0000 1.110 >+++ plugin.xml 10 May 2007 10:48:48 -0000 >@@ -629,6 +629,7 @@ > <extension-point id="templates" name="Templates Extension point" > schema="schema/templates.exsd"/> > <extension-point id="templateProcessTypes" name="Process Types Extension point" schema="schema/templateProcessTypes.exsd"/> >+ <extension-point id="addToolChainsToTemplate" name="Add Tool Chains To Templates" schema="schema/addToolChainsToTemplate.exsd"/> > > <extension > point="org.eclipse.cdt.core.templateProcessTypes"> >Index: schema/addToolChainsToTemplate.exsd >=================================================================== >RCS file: schema/addToolChainsToTemplate.exsd >diff -N schema/addToolChainsToTemplate.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/addToolChainsToTemplate.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,134 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.cdt.core"> >+<annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.cdt.core" id="addToolChainsToTemplate" name="Add ToolChains to Template"/> >+ </appInfo> >+ <documentation> >+ This extension point facilitates adding new toolchains generated from a different plugin to already defined template without modifying template definition. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <documentation> >+ 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. >+ </documentation> >+ </annotation> >+ <complexType> >+ <sequence> >+ <sequence> >+ <element ref="template" minOccurs="0" maxOccurs="unbounded"/> >+ </sequence> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ Id for the extension in the extender plugin. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="toolChain"> >+ <complexType> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="template"> >+ <complexType> >+ <sequence> >+ <element ref="toolChain" minOccurs="0" maxOccurs="unbounded"/> >+ </sequence> >+ <attribute name="location" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="resource"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ This extension point was added in CDT 4.0 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="apiInfo"/> >+ </appInfo> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="implementation"/> >+ </appInfo> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="copyright"/> >+ </appInfo> >+ <documentation> >+ Copyright (c) 2007 Symbian Software Limited and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+ >+Contributors: >+Symbian - Initial API and implementation >+ </documentation> >+ </annotation> >+ >+</schema> >#P org.eclipse.cdt.core.tests >Index: suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java,v >retrieving revision 1.54 >diff -u -r1.54 AutomatedIntegrationSuite.java >--- suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java 26 Apr 2007 17:07:14 -0000 1.54 >+++ suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java 10 May 2007 10:48:50 -0000 >@@ -33,6 +33,7 @@ > import org.eclipse.cdt.core.parser.failedTests.FailedCompleteParseASTTest; > import org.eclipse.cdt.core.parser.failedTests.STLFailedTests; > import org.eclipse.cdt.core.parser.tests.ParserTestSuite; >+import org.eclipse.cdt.core.tests.templateengine.AllTemplateEngineTests; > import org.eclipse.cdt.internal.index.tests.IndexTests; > import org.eclipse.cdt.internal.pdom.tests.PDOMTests; > >@@ -91,7 +92,7 @@ > suite.addTestSuite(STLFailedTests.class); > suite.addTestSuite(FailedCompleteParseASTTest.class); > >-// suite.addTest(AllTemplateEngineTests.suite()); >+ suite.addTest(AllTemplateEngineTests.suite()); > > return suite; > } >Index: templateengine/org/eclipse/cdt/core/tests/templateengine/TestValueStore.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/templateengine/org/eclipse/cdt/core/tests/templateengine/TestValueStore.java,v >retrieving revision 1.1 >diff -u -r1.1 TestValueStore.java >--- templateengine/org/eclipse/cdt/core/tests/templateengine/TestValueStore.java 26 Apr 2007 17:07:14 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/tests/templateengine/TestValueStore.java 10 May 2007 10:48:50 -0000 >@@ -17,7 +17,6 @@ > > import org.eclipse.cdt.core.templateengine.TemplateCore; > import org.eclipse.cdt.core.templateengine.TemplateDescriptor; >-import org.eclipse.cdt.core.templateengine.TemplateEngine; > > > /** >@@ -49,7 +48,7 @@ > * > */ > public void testValueStoreNotNull(){ >- TemplateCore[] templates = TemplateEngine.getDefault().getTemplates(); >+ TemplateCore[] templates = TemplateEngineTestsHelper.getTestTemplates(); > for (int i=0; i <templates.length; i++) { > Map valueStore = templates[i].getValueStore(); > assertNotNull(valueStore); >@@ -61,7 +60,7 @@ > * FactoryDefaults. Test the same. > */ > public void testCompareValueStoreWithTemplateDefaluts(){ >- TemplateCore[] templates = TemplateEngine.getDefault().getTemplates(); >+ TemplateCore[] templates = TemplateEngineTestsHelper.getTestTemplates(); > for (int i=0; i <templates.length; i++) { > Map valueStore = templates[i].getValueStore(); > TemplateDescriptor templateDescriptor = templates[i].getTemplateDescriptor(); >Index: templateengine/org/eclipse/cdt/core/tests/templateengine/TemplateEngineTestsHelper.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/templateengine/org/eclipse/cdt/core/tests/templateengine/TemplateEngineTestsHelper.java,v >retrieving revision 1.1 >diff -u -r1.1 TemplateEngineTestsHelper.java >--- templateengine/org/eclipse/cdt/core/tests/templateengine/TemplateEngineTestsHelper.java 26 Apr 2007 17:07:14 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/tests/templateengine/TemplateEngineTestsHelper.java 10 May 2007 10:48:50 -0000 >@@ -12,10 +12,12 @@ > > import java.io.IOException; > import java.net.URL; >+import java.util.ArrayList; > import java.util.List; > > import junit.framework.Assert; > >+import org.eclipse.cdt.core.templateengine.TemplateCore; > import org.eclipse.cdt.core.templateengine.TemplateDescriptor; > import org.eclipse.cdt.core.templateengine.TemplateEngine; > import org.eclipse.cdt.core.testplugin.CTestPlugin; >@@ -61,6 +63,17 @@ > return url; > } > >+ public static TemplateCore[] getTestTemplates() { >+ TemplateCore[] templates = TemplateEngine.getDefault().getTemplates(); >+ List testTemplates = new ArrayList(); >+ for (int i =0; i < templates.length; i++) { >+ if (templates[i].getTemplateType().equals("TestTemplate")) { >+ testTemplates.add(templates[i]); >+ } >+ } >+ return (TemplateCore[]) testTemplates.toArray(new TemplateCore[testTemplates.size()]); >+ } >+ > public static int getChildCount(TemplateDescriptor templateDescriptor, String propertyGroupID){ > List list = templateDescriptor.getPropertyGroupList(); > for (int i = 0, l = list.size(); i < l; i++) { >Index: templateengine/org/eclipse/cdt/core/tests/templateengine/TestTemplateCore.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/templateengine/org/eclipse/cdt/core/tests/templateengine/TestTemplateCore.java,v >retrieving revision 1.1 >diff -u -r1.1 TestTemplateCore.java >--- templateengine/org/eclipse/cdt/core/tests/templateengine/TestTemplateCore.java 26 Apr 2007 17:07:14 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/tests/templateengine/TestTemplateCore.java 10 May 2007 10:48:50 -0000 >@@ -13,7 +13,6 @@ > import junit.framework.TestCase; > > import org.eclipse.cdt.core.templateengine.TemplateCore; >-import org.eclipse.cdt.core.templateengine.TemplateEngine; > > /** > * Test the functionality of Tempalte Class. >@@ -24,7 +23,7 @@ > > protected void setUp() throws Exception { > super.setUp(); >- templates = TemplateEngine.getDefault().getTemplates(); >+ templates = TemplateEngineTestsHelper.getTestTemplates(); > } > > /* >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/plugin.xml,v >retrieving revision 1.45 >diff -u -r1.45 plugin.xml >--- plugin.xml 26 Apr 2007 17:07:14 -0000 1.45 >+++ plugin.xml 10 May 2007 10:48:50 -0000 >@@ -103,5 +103,18 @@ > location="testdata/CreateSourceFolder.xml" > projectType="org.eclipse.cdt.core.tests.projectType"/> > </extension> >+ <extension >+ point="org.eclipse.cdt.core.addToolChainsToTemplate"> >+ <template >+ location="testdata/AddFile.xml"> >+ <toolChain id="org.eclipse.cdt.core.tests.toolChain3"/> >+ <toolChain id="org.eclipse.cdt.core.tests.toolChain4"/> >+ </template> >+ <template >+ location="testdata/AddFiles.xml"> >+ <toolChain id="org.eclipse.cdt.core.tests.toolChain5"/> >+ <toolChain id="org.eclipse.cdt.core.tests.toolChain6"/> >+ </template> >+ </extension> > > </plugin>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 184449
: 66643