Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2009-09-07 17:06:46 -0400
committerAndrew Gvozdev2009-09-07 17:06:46 -0400
commit246f2f19b065b854efb0bf13b3e3210f5800cc06 (patch)
tree1dac880d54e0dd05a645056b69bf221b4f2a5907
parente5cac49c11893237e676711a0b7f5fa6e7415bf0 (diff)
downloadorg.eclipse.cdt-246f2f19b065b854efb0bf13b3e3210f5800cc06.tar.gz
org.eclipse.cdt-246f2f19b065b854efb0bf13b3e3210f5800cc06.tar.xz
org.eclipse.cdt-246f2f19b065b854efb0bf13b3e3210f5800cc06.zip
bug 288775: [Template Engine] Mappings between labels and values in not reversible for <property> with id="functional_area"
-rw-r--r--core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/messages.properties5
-rw-r--r--core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java19
2 files changed, 16 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/messages.properties b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/messages.properties
index 4cca2d124b..88f811953a 100644
--- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/messages.properties
+++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/messages.properties
@@ -36,10 +36,11 @@ ProjectSelectionPage.8=The project does not exist
ProjectSelectionPage.9=Please select a CDT project
ProjectSelectionPage.10=Project Selection
ProjectSelectionPage.11=Choose a Project
-UIElementTreeBuilderHelper.InvalidEmptyLabel=Invalid item element in <property> with id="{0}": attributes ''label'' and ''value'' must be present.
-UIElementTreeBuilderHelper.InvalidNonUniqueValue=Mappings between labels and values in not reversible for <property> with id="{0}"
+UIElementTreeBuilderHelper.InvalidEmptyLabel=Invalid item element in <property id="{0}">: attributes "label" and "value" must be present.
+UIElementTreeBuilderHelper.InvalidNonUniqueValue=Duplicate item value="{0}" in combo box <property id="{1}">.
UIElementTreeBuilderHelper.UnknownWidgetType0=Unknown widget type: {0}
UISelectWidget_ErrorNoneSelected0=Please choose a value for {0}
UITextWidget.0=\ Project already exists in workspace.
SimpleElementException.0=This Operation not supported on InputUIElement
+TemplateEngineMessage.Error=CDT New Project Wizard Template Engine Error
diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java
index 7a35b154c9..b36915b2ab 100644
--- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java
+++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java
@@ -11,15 +11,19 @@
*******************************************************************************/
package org.eclipse.cdt.ui.templateengine.uitree;
-import com.ibm.icu.text.MessageFormat;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import com.ibm.icu.text.MessageFormat;
+
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
import org.eclipse.cdt.core.templateengine.TemplateEngine;
import org.eclipse.cdt.core.templateengine.TemplateInfo;
@@ -37,6 +41,7 @@ import org.eclipse.cdt.ui.templateengine.uitree.uiwidgets.UITextWidget;
* UIElement. The UIElement can be a simple UI Widget or a group.
*/
public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
+ private static final String TEMPLATE_ENGINE_ERROR = Messages.getString("TemplateEngineMessage.Error"); //$NON-NLS-1$
/**
* TemplateDescriptor representing the TemplaeDescriptor XML.
*/
@@ -118,12 +123,14 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
value= item.getAttribute(InputUIElement.COMBOITEM_VALUE);
}
if(label==null || value==null) {
- String msg= Messages.getString("UIElementTreeBuilderHelper.InvalidEmptyLabel"); //$NON-NLS-1$
- CUIPlugin.log(MessageFormat.format(msg, new Object[] {id}), null);
+ String msg = MessageFormat.format(Messages.getString("UIElementTreeBuilderHelper.InvalidEmptyLabel"), //$NON-NLS-1$
+ new Object[] {id});
+ CUIPlugin.log(TEMPLATE_ENGINE_ERROR, new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, msg)));
} else {
if(value2name.put(value, label)!=null) {
- String msg= Messages.getString("UIElementTreeBuilderHelper.InvalidNonUniqueValue"); //$NON-NLS-1$
- CUIPlugin.log(MessageFormat.format(msg, new Object[] {id}), null);
+ String msg = MessageFormat.format(Messages.getString("UIElementTreeBuilderHelper.InvalidNonUniqueValue"), //$NON-NLS-1$
+ new Object[] {value, id});
+ CUIPlugin.log(TEMPLATE_ENGINE_ERROR, new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, msg)));
}
}
}
@@ -148,7 +155,7 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
// for generating UI pages as TABS in a single page.
} else {
String msg= MessageFormat.format(Messages.getString("UIElementTreeBuilderHelper.UnknownWidgetType0"), new Object[] {type}); //$NON-NLS-1$
- CUIPlugin.log(msg, null);
+ CUIPlugin.log(TEMPLATE_ENGINE_ERROR, new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, msg)));
}
return widgetElement;

Back to the top