summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxwu2013-05-23 05:50:23 (EDT)
committer mwu2013-05-23 05:50:23 (EDT)
commitb756d5092ceeef33a025cf7686baa63f92e37f4c (patch)
tree65d4e785e59d2648c46bb756b8eddafe272cd7c8
parent3e83eb6e59fcb41bc806f73f7bc31b767e156a66 (diff)
downloadorg.eclipse.datatools.enablement.oda-b756d5092ceeef33a025cf7686baa63f92e37f4c.zip
org.eclipse.datatools.enablement.oda-b756d5092ceeef33a025cf7686baa63f92e37f4c.tar.gz
org.eclipse.datatools.enablement.oda-b756d5092ceeef33a025cf7686baa63f92e37f4c.tar.bz2
Fix bugzilla bug [408796] - Enhancement: The error message should be
enhanced when XPath expression is invalid.
-rw-r--r--plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties2
-rw-r--r--plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java15
2 files changed, 5 insertions, 12 deletions
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties
index 8edf5e7..2ec59dc 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties
@@ -106,7 +106,7 @@ error.columnMapping.noMappingColumn=Please map at least one column.
error.columnMapping.tableMappingXPathNotExist=The table mapping XPath does not exist.
error.file.null=All the URLs are empty, it means you haven't select any data source. Are you sure you want to keep it?
error.columnMapping.sameColumnName=The column name [{0}] already exists. Please use another name.
-error.invalidXpath=The XPath expression "{0}" is invalid.
+error.invalidXpath=The XPath expression is invalid.
error.invalidSource=The xml source file cannot be found.
#data types for column mapping
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java
index dbcd00f..18bc873 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java
@@ -540,16 +540,11 @@ public class XPathChoosePage extends DataSetWizardPage
}
}
- /**
- *
- * @return
- */
private boolean isRootPathValid( )
{
- return !(rootPath == null
- || rootPath.trim( ).length( ) == 0);
+ return rootPath != null && rootPath.trim( ).length( ) > 0;
}
-
+
/**
* when XPath text has changed, reset the dataSetHandle.CONST_PROP_XPATH
*
@@ -624,12 +619,10 @@ public class XPathChoosePage extends DataSetWizardPage
{
if ( this.getControl( ) == null || this.getControl( ).isDisposed( ) )
return true;
+
if ( !isRootPathValid( ) )
{
- this.setMessage( Messages.getFormattedString( "error.invalidXpath", //$NON-NLS-1$
- new Object[]{
- rootPath == null ? EMPTY_STRING : rootPath
- } ), IMessageProvider.ERROR );
+ this.setMessage( Messages.getString( "error.invalidXpath" ), IMessageProvider.ERROR ); //$NON-NLS-1$
return false;
}
else