summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Trimble2012-09-18 18:49:10 (EDT)
committerIan Trimble2012-09-18 18:49:10 (EDT)
commit2312a9f3faf575ae3ef29e890606c93c03818343 (patch)
tree90135da822d5d7379a8e881182f52c391848e855
parent4c250efaaacf70ea4ec3dc9d46e42452a4bdb310 (diff)
downloadwebtools.jsf-2312a9f3faf575ae3ef29e890606c93c03818343.zip
webtools.jsf-2312a9f3faf575ae3ef29e890606c93c03818343.tar.gz
webtools.jsf-2312a9f3faf575ae3ef29e890606c93c03818343.tar.bz2
Bug 374531 - [hotbug] False warning for the valid frame target name
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml4
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AnyStringType.java37
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java4
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties1
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.standard.tagsupport/metadata/html.xml2
5 files changed, 47 insertions, 1 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
index 506509b..2acc735 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
@@ -221,6 +221,10 @@
class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.StringType"
id="attributevalues.StringType"/>
<attributeValueRuntimeType
+ class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.AnyStringType"
+ id="attributevalues.AnyStringType">
+ </attributeValueRuntimeType>
+ <attributeValueRuntimeType
class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.BooleanType"
id="attributevalues.BooleanType"/>
<attributeValueRuntimeType
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AnyStringType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AnyStringType.java
new file mode 100644
index 0000000..d17f6f6
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AnyStringType.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle Corporation.
+ * 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:
+ * Ian Trimble/Oracle - initial API and implementation
+ *
+ ********************************************************************************/
+package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
+
+/**
+ * Meta-data processing type representing a String attribute value runtime type
+ * that extends StringType to allow any String as a valid value while still
+ * providing possible values and default values from metadata.
+ *
+ * <p><b>Provisional API - subject to change</b></p>
+ * @author Ian Trimble - Oracle
+ */
+public class AnyStringType extends StringType {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.StringType#isValidValue(java.lang.String)
+ */
+ public boolean isValidValue(String value) {
+ boolean valid = true;
+ if (value == null || value.length() < 1) {
+ valid = false;
+ addNewValidationMessage(Messages.AnyStringType_empty_value);
+ }
+ return valid;
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java
index 447ef78..3157ac4 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java
@@ -40,6 +40,10 @@ public class Messages extends NLS {
/**
* see messages.properties
*/
+ public static String AnyStringType_empty_value;
+ /**
+ * see messages.properties
+ */
public static String BooleanType_invalid_values;
/**
* see messages.properties
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties
index 22ddc87..d8042c2 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties
@@ -276,3 +276,4 @@ JavaClassType_invalid_type=Value for type attribute must be valid Java class and
JavaClassType_not_found=Java type not found, not instantiable, or does implement correct interfaces or extend correct superclass.
ColorType_invalid_color=Value is not a valid color.
Bundle_not_found_rb=Resource bundle {0} cannot be found on classpath
+AnyStringType_empty_value=Value must not be empty.
diff --git a/jsf/plugins/org.eclipse.jst.jsf.standard.tagsupport/metadata/html.xml b/jsf/plugins/org.eclipse.jst.jsf.standard.tagsupport/metadata/html.xml
index 6aae4ca..bc8f907 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.standard.tagsupport/metadata/html.xml
+++ b/jsf/plugins/org.eclipse.jst.jsf.standard.tagsupport/metadata/html.xml
@@ -530,7 +530,7 @@
</entity>
<entity id="target">
<trait id="attribute-value-runtime-type">
- <value xsi:type="mdt:StringValue">org.eclipse.jst.jsf.core.attributevalues.StringType</value>
+ <value xsi:type="mdt:StringValue">org.eclipse.jst.jsf.core.attributevalues.AnyStringType</value>
</trait>
<trait id="valid-values">
<value xsi:type="mdt:ListOfValues">