mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-28 10:43: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.9=Please select a CDT project
|
||||||
ProjectSelectionPage.10=Project Selection
|
ProjectSelectionPage.10=Project Selection
|
||||||
ProjectSelectionPage.11=Choose a Project
|
ProjectSelectionPage.11=Choose a Project
|
||||||
UIElementTreeBuilderHelper.InvalidEmptyLabel=Invalid item element in <property> with id="{0}": attributes ''label'' and ''value'' must be present.
|
UIElementTreeBuilderHelper.InvalidEmptyLabel=Invalid item element in <property 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.InvalidNonUniqueValue=Duplicate item value="{0}" in combo box <property id="{1}">.
|
||||||
UIElementTreeBuilderHelper.UnknownWidgetType0=Unknown widget type: {0}
|
UIElementTreeBuilderHelper.UnknownWidgetType0=Unknown widget type: {0}
|
||||||
UISelectWidget_ErrorNoneSelected0=Please choose a value for {0}
|
UISelectWidget_ErrorNoneSelected0=Please choose a value for {0}
|
||||||
UITextWidget.0=\ Project already exists in workspace.
|
UITextWidget.0=\ Project already exists in workspace.
|
||||||
SimpleElementException.0=This Operation not supported on InputUIElement
|
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;
|
package org.eclipse.cdt.ui.templateengine.uitree;
|
||||||
|
|
||||||
import com.ibm.icu.text.MessageFormat;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.Element;
|
||||||
import org.w3c.dom.NamedNodeMap;
|
import org.w3c.dom.NamedNodeMap;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
|
|
||||||
|
import com.ibm.icu.text.MessageFormat;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
|
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
|
||||||
import org.eclipse.cdt.core.templateengine.TemplateEngine;
|
import org.eclipse.cdt.core.templateengine.TemplateEngine;
|
||||||
import org.eclipse.cdt.core.templateengine.TemplateInfo;
|
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.
|
* UIElement. The UIElement can be a simple UI Widget or a group.
|
||||||
*/
|
*/
|
||||||
public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
|
public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
|
||||||
|
private static final String TEMPLATE_ENGINE_ERROR = Messages.getString("TemplateEngineMessage.Error"); //$NON-NLS-1$
|
||||||
/**
|
/**
|
||||||
* TemplateDescriptor representing the TemplaeDescriptor XML.
|
* TemplateDescriptor representing the TemplaeDescriptor XML.
|
||||||
*/
|
*/
|
||||||
|
@ -118,12 +123,14 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
|
||||||
value= item.getAttribute(InputUIElement.COMBOITEM_VALUE);
|
value= item.getAttribute(InputUIElement.COMBOITEM_VALUE);
|
||||||
}
|
}
|
||||||
if(label==null || value==null) {
|
if(label==null || value==null) {
|
||||||
String msg= Messages.getString("UIElementTreeBuilderHelper.InvalidEmptyLabel"); //$NON-NLS-1$
|
String msg = MessageFormat.format(Messages.getString("UIElementTreeBuilderHelper.InvalidEmptyLabel"), //$NON-NLS-1$
|
||||||
CUIPlugin.log(MessageFormat.format(msg, new Object[] {id}), null);
|
new Object[] {id});
|
||||||
|
CUIPlugin.log(TEMPLATE_ENGINE_ERROR, new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, msg)));
|
||||||
} else {
|
} else {
|
||||||
if(value2name.put(value, label)!=null) {
|
if(value2name.put(value, label)!=null) {
|
||||||
String msg= Messages.getString("UIElementTreeBuilderHelper.InvalidNonUniqueValue"); //$NON-NLS-1$
|
String msg = MessageFormat.format(Messages.getString("UIElementTreeBuilderHelper.InvalidNonUniqueValue"), //$NON-NLS-1$
|
||||||
CUIPlugin.log(MessageFormat.format(msg, new Object[] {id}), null);
|
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.
|
// for generating UI pages as TABS in a single page.
|
||||||
} else {
|
} else {
|
||||||
String msg= MessageFormat.format(Messages.getString("UIElementTreeBuilderHelper.UnknownWidgetType0"), new Object[] {type}); //$NON-NLS-1$
|
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;
|
return widgetElement;
|
||||||
|
|
Loading…
Add table
Reference in a new issue