mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
bug 288775: [Template Engine] Mappings between labels and values in not reversible for <property> with id="functional_area"
This commit is contained in:
parent
ed41e9784a
commit
35b929b894
2 changed files with 16 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue