You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/01/12 17:56:05 UTC
svn commit: r898418 - in /myfaces/tobago/trunk:
core/src/main/java/org/apache/myfaces/tobago/component/
core/src/main/java/org/apache/myfaces/tobago/config/
core/src/main/java/org/apache/myfaces/tobago/context/
core/src/main/java/org/apache/myfaces/tob...
Author: lofwyr
Date: Tue Jan 12 16:56:03 2010
New Revision: 898418
URL: http://svn.apache.org/viewvc?rev=898418&view=rev
Log:
TOBAGO-844: Change type of the markup attribute from String[] to new class Markup
Added:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/Markup.java (with props)
myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java (with props)
Modified:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIMenuBar.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/Configurable.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/context/ThemeConfigCacheKey.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/OutTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMarkup.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
myfaces/tobago/trunk/extension/math/src/main/java/org/apache/myfaces/tobago/component/UIEquationGridLayout.java
myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIMenuBar.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIMenuBar.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIMenuBar.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIMenuBar.java Tue Jan 12 16:56:03 2010
@@ -18,6 +18,7 @@
*/
import org.apache.myfaces.tobago.config.Configurable;
+import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.renderkit.RendererBase;
import javax.faces.context.FacesContext;
@@ -25,9 +26,9 @@
public class AbstractUIMenuBar extends javax.faces.component.UIPanel implements Configurable, OnComponentCreated {
- // todo: may have a markup for menubar, also may be a LayoutComponent/Container
- public String[] getMarkup() {
- return new String[0];
+ // todo: may have a markup for menu bar, also may be a LayoutComponent/Container
+ public Markup getMarkup() {
+ return null;
}
public void onComponentCreated(FacesContext context) {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/SupportsMarkup.java Tue Jan 12 16:56:03 2010
@@ -1,5 +1,7 @@
package org.apache.myfaces.tobago.component;
+import org.apache.myfaces.tobago.context.Markup;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,7 +21,7 @@
public interface SupportsMarkup {
- String[] getMarkup();
+ Markup getMarkup();
- void setMarkup(String[] markups);
+ void setMarkup(Markup markup);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/Configurable.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/Configurable.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/Configurable.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/Configurable.java Tue Jan 12 16:56:03 2010
@@ -1,5 +1,7 @@
package org.apache.myfaces.tobago.config;
+import org.apache.myfaces.tobago.context.Markup;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -26,5 +28,5 @@
*/
String getRendererType();
- String[] getMarkup();
+ Markup getMarkup();
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/config/ThemeConfig.java Tue Jan 12 16:56:03 2010
@@ -17,7 +17,6 @@
* limitations under the License.
*/
-import org.apache.commons.lang.ArrayUtils;
import org.apache.myfaces.tobago.context.ResourceManagerFactory;
import org.apache.myfaces.tobago.util.Deprecation;
@@ -34,7 +33,7 @@
public static int getValue(FacesContext facesContext, UIComponent component, String name) {
Deprecation.LOG.warn("please use ThemeConfig.getMeasure()");
return ResourceManagerFactory.getResourceManager(facesContext).getThemeMeasure(
- facesContext, component.getRendererType(), ArrayUtils.EMPTY_STRING_ARRAY, name).getPixel();
+ facesContext, component.getRendererType(), null, name).getPixel();
}
/**
@@ -44,6 +43,6 @@
public static boolean hasValue(FacesContext facesContext, UIComponent component, String name) {
Deprecation.LOG.warn("please use ThemeConfig.getMeasure()");
return ResourceManagerFactory.getResourceManager(facesContext).getThemeMeasure(
- facesContext, component.getRendererType(), ArrayUtils.EMPTY_STRING_ARRAY, name) != null;
+ facesContext, component.getRendererType(), null, name) != null;
}
}
Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/Markup.java?rev=898418&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/Markup.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/Markup.java Tue Jan 12 16:56:03 2010
@@ -0,0 +1,149 @@
+package org.apache.myfaces.tobago.context;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.commons.collections.iterators.EmptyIterator;
+import org.apache.commons.collections.iterators.ObjectArrayIterator;
+import org.apache.commons.collections.iterators.SingletonIterator;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.StringUtils;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * A markup signs a component to be rendered different from the normal.
+ * E. g. <code>markup="emphasized"</code> might be rendered bold
+ * or a <code>markup="deleted"</code> might be rendered with line-through style.
+ * The concrete rendering depends from the theme.
+ * <p>
+ * The markup can also hold more than one value, e. g. <code>markup="emphasized, deleted"</code>.
+ * <p>
+ * The value of the markup is unmodifiable.
+ * <p>
+ * A markup must be registered for a component, before it can be used.
+ * <p>
+ * A markup should only contain ASCII characters and digits.
+ */
+public final class Markup implements Serializable, Iterable<String> {
+
+ public static final Markup NULL = new Markup();
+
+ /* Just one of values and value must be null */
+
+ private String[] values;
+ private String value;
+
+ private Markup() {
+ }
+
+ public static Markup valueOf(String[] values) {
+ if (values == null || values.length == 0) {
+ return null;
+ } else if (values.length == 1) {
+ return valueOf(values[0]);
+ } else {
+ Markup markup = new Markup();
+ markup.values = (String[]) ArrayUtils.clone(values);
+ for (int i = 0; i < markup.values.length; i++) {
+ markup.values[i] = markup.values[i].trim();
+ }
+ return markup;
+ }
+ }
+
+ public static Markup valueOf(String value) {
+ if (StringUtils.isEmpty(value)) {
+ return null;
+ }
+ if (value.contains(",")) {
+ String[] strings = StringUtils.split(value, ", \t\n");
+ Markup markup = new Markup();
+ markup.values = strings;
+ return markup;
+ } else {
+ Markup markup = new Markup();
+ markup.value = value.trim();
+ return markup;
+ }
+ }
+
+ public static Markup valueOf(Object value) {
+ if (value == null) {
+ return null;
+ }
+ if (value instanceof Markup) {
+ return (Markup) value;
+ }
+ if (value instanceof String) {
+ return valueOf((String) value);
+ }
+ if (value instanceof String[]) {
+ return valueOf((String[]) value);
+ }
+ if (value instanceof Iterable) {
+ List<String> list = new ArrayList<String>();
+ for (Object object : (Iterable) value) {
+ list.add(object.toString());
+ }
+ return valueOf(list.toArray(new String[list.size()]));
+ }
+ return valueOf(value.toString());
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ Markup markup = (Markup) o;
+
+ if (value != null ? !value.equals(markup.value) : markup.value != null) {
+ return false;
+ }
+ if (!Arrays.equals(values, markup.values)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = values != null ? Arrays.hashCode(values) : 0;
+ result = 31 * result + (value != null ? value.hashCode() : 0);
+ return result;
+ }
+
+ public Iterator<String> iterator() {
+ if (value != null) {
+ return new SingletonIterator(value);
+ }
+ if (values != null) {
+ return new ObjectArrayIterator(values);
+ }
+ return EmptyIterator.INSTANCE;
+ }
+}
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManager.java Tue Jan 12 16:56:03 2010
@@ -54,7 +54,7 @@
Measure getThemeMeasure(FacesContext facesContext, Configurable configurable, String name);
- Measure getThemeMeasure(FacesContext facesContext, String rendererType, String[] markup, String name);
+ Measure getThemeMeasure(FacesContext facesContext, String rendererType, Markup markup, String name);
@Deprecated
String getImage(UIViewRoot viewRoot, String name);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java Tue Jan 12 16:56:03 2010
@@ -215,7 +215,7 @@
return getThemeMeasure(facesContext, configurable.getRendererType(), configurable.getMarkup(), name);
}
- public Measure getThemeMeasure(FacesContext facesContext, String rendererType, String[] markup, String name) {
+ public Measure getThemeMeasure(FacesContext facesContext, String rendererType, Markup markup, String name) {
ClientPropertiesKey clientKey = ClientPropertiesKey.get(facesContext);
ThemeConfigCacheKey cacheKey = new ThemeConfigCacheKey(clientKey, rendererType, markup, name);
@@ -228,11 +228,13 @@
if (properties != null) {
Measure measure = Measure.valueOf(properties.get(0));
- for (String m : markup) {
- List mProperties = getPaths(clientKey, "", PROPERTY, "tobago-theme-config", "",
- false, true, false, rendererType + "[" + m + "]" + "." + name, true, true);
- if (mProperties != null) {
- measure.add(Measure.valueOf(mProperties.get(0)));
+ if (markup != null) {
+ for (String m : markup) {
+ List mProperties = getPaths(clientKey, "", PROPERTY, "tobago-theme-config", "",
+ false, true, false, rendererType + "[" + m + "]" + "." + name, true, true);
+ if (mProperties != null) {
+ measure.add(Measure.valueOf(mProperties.get(0)));
+ }
}
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/context/ThemeConfigCacheKey.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/context/ThemeConfigCacheKey.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/context/ThemeConfigCacheKey.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/internal/context/ThemeConfigCacheKey.java Tue Jan 12 16:56:03 2010
@@ -17,23 +17,21 @@
* limitations under the License.
*/
-import org.apache.commons.lang.ArrayUtils;
-
-import java.util.Arrays;
+import org.apache.myfaces.tobago.context.Markup;
public final class ThemeConfigCacheKey {
private final ClientPropertiesKey clientPropertiesKey;
private final String rendererType;
private final String name;
- private final String[] markup;
+ private final Markup markup;
private final int hashCode;
public ThemeConfigCacheKey(
- ClientPropertiesKey clientPropertiesKey, String rendererType, String[] markup, String name) {
+ ClientPropertiesKey clientPropertiesKey, String rendererType, Markup markup, String name) {
this.clientPropertiesKey = clientPropertiesKey;
this.rendererType = rendererType;
- this.markup = (String[]) ArrayUtils.clone(markup); // todo: copy ref and don't clone when markup is unmodifiable
+ this.markup = markup;
this.name = name;
hashCode = calcHashCode();
}
@@ -55,7 +53,7 @@
if (!name.equals(cacheKey.name)) {
return false;
}
- if (!Arrays.equals(markup, cacheKey.markup)) {
+ if (markup != null ? !markup.equals(cacheKey.markup) : cacheKey.markup != null) {
return false;
}
if (!clientPropertiesKey.equals(cacheKey.clientPropertiesKey)) {
@@ -69,7 +67,7 @@
int result = clientPropertiesKey.hashCode();
result = 31 * result + rendererType.hashCode();
result = 31 * result + name.hashCode();
- result = 31 * result + Arrays.hashCode(markup);
+ result = 31 * result + (markup != null ? markup.hashCode() : 0);
return result;
}
@@ -83,7 +81,7 @@
public String toString() {
return "ThemeConfigCacheKey(" + clientPropertiesKey
+ "," + rendererType
- + "," + Arrays.toString(markup)
+ + "," + markup
+ "," + name + ')';
}
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/model/SelectItem.java Tue Jan 12 16:56:03 2010
@@ -17,15 +17,15 @@
* limitations under the License.
*/
-import org.apache.commons.lang.ArrayUtils;
import org.apache.myfaces.tobago.component.SupportsMarkup;
+import org.apache.myfaces.tobago.context.Markup;
public class SelectItem extends javax.faces.model.SelectItem implements SupportsMarkup {
private static final long serialVersionUID = 2582455665060354639L;
private String image;
- private String[] markup = ArrayUtils.EMPTY_STRING_ARRAY;
+ private Markup markup = Markup.NULL;
public SelectItem() {
super();
@@ -47,17 +47,26 @@
this(value, label, description, false, image);
}
+ /** @deprecated since 1.5.0 */
+ @Deprecated
public SelectItem(Object value, String label, String description, String image, String[] markup) {
this(value, label, description, false, image, markup);
}
- public SelectItem(Object value, String label, String description,
- boolean disabled, String image) {
- this(value, label, description, disabled, image, null);
+ public SelectItem(Object value, String label, String description, String image, Markup markup) {
+ this(value, label, description, false, image, markup);
+ }
+
+ public SelectItem(Object value, String label, String description, boolean disabled, String image) {
+ this(value, label, description, disabled, image, Markup.NULL);
+ }
+
+ /** @deprecated since 1.5.0 */
+ public SelectItem(Object value, String label, String description, boolean disabled, String image, String[] markup) {
+ this(value, label, description, disabled, image, Markup.valueOf(markup));
}
- public SelectItem(Object value, String label, String description,
- boolean disabled, String image, String[] markup) {
+ public SelectItem(Object value, String label, String description, boolean disabled, String image, Markup markup) {
super(value, label, description, disabled);
this.image = image;
this.markup = markup;
@@ -71,11 +80,11 @@
this.image = image;
}
- public String[] getMarkup() {
+ public Markup getMarkup() {
return markup;
}
- public void setMarkup(String[] markup) {
+ public void setMarkup(Markup markup) {
this.markup = markup;
}
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java Tue Jan 12 16:56:03 2010
@@ -18,13 +18,14 @@
*/
import org.apache.commons.collections.set.ListOrderedSet;
-import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.SupportsMarkup;
+import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.Theme;
import org.apache.myfaces.tobago.util.ComponentUtils;
+import org.apache.myfaces.tobago.util.Deprecation;
import org.apache.myfaces.tobago.util.VariableResolverUtil;
import javax.faces.component.UIComponent;
@@ -35,10 +36,6 @@
import java.util.Locale;
import java.util.Map;
-/*
- * Date: 2007-05-01
- */
-
public class StyleClasses implements Serializable {
private static final long serialVersionUID = 3738052927067803517L;
@@ -139,12 +136,15 @@
}
public void addMarkupClass(SupportsMarkup supportsMarkup, String rendererName, String sub) {
- for (String markup : supportsMarkup.getMarkup()) {
- if (!StringUtils.isBlank(markup)) {
+ Markup m = supportsMarkup.getMarkup();
+ if (m != null) {
+ for (String markup : m) {
Theme theme = VariableResolverUtil.resolveClientProperties(FacesContext.getCurrentInstance()).getTheme();
if (theme.getRenderersConfig().isMarkupSupported(rendererName, markup)) {
addMarkupClass(rendererName, sub, markup);
- } else if (!"none".equals(markup)) {
+ } else if ("none".equals(markup)) {
+ Deprecation.LOG.warn("Markup 'none' is deprecated, please use a NULL pointer instead.");
+ } else {
LOG.warn("Unknown markup='" + markup + "'");
}
}
@@ -166,7 +166,6 @@
return builder.toString();
}
-
public void addAspectClass(String renderer, String sub, Aspect aspect) {
classes.add(nameOfAspectClass(renderer, sub, aspect));
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java Tue Jan 12 16:56:03 2010
@@ -24,6 +24,7 @@
import org.apache.myfaces.tobago.component.ComponentTypes;
import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.taglib.decl.HasLabel;
+import org.apache.myfaces.tobago.taglib.decl.HasMarkup;
import org.apache.myfaces.tobago.taglib.decl.HasTip;
/**
@@ -36,7 +37,7 @@
uiComponentBaseClass = "org.apache.myfaces.tobago.component.AbstractUIColumn",
componentType = ComponentTypes.COLUMN)
//rendererType = "Column")
-public interface ColumnTagDeclaration extends HasIdBindingAndRendered, HasLabel, HasTip {
+public interface ColumnTagDeclaration extends HasIdBindingAndRendered, HasLabel, HasTip, HasMarkup {
/**
* Alignment of this column.
*/
@@ -55,14 +56,6 @@
void setSortable(String sortable);
/**
- * Indicate markup of this component.
- * Possible value is 'none'. But this can be overridden in the theme.
- */
- @TagAttribute
- @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
- void setMarkup(String markup);
-
- /**
* The layout token for this column.
* Allowd layout tokens ('*', '<x>*', '<x>px' or '<x>%').
* Where '*' is equvalent to '1*'.
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java Tue Jan 12 16:56:03 2010
@@ -20,13 +20,12 @@
import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
import org.apache.myfaces.tobago.apt.annotation.Facet;
import org.apache.myfaces.tobago.apt.annotation.Tag;
-import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
-import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.taglib.decl.HasConverter;
import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
+import org.apache.myfaces.tobago.taglib.decl.HasMarkup;
import org.apache.myfaces.tobago.taglib.decl.HasSuggestMethod;
import org.apache.myfaces.tobago.taglib.decl.HasTip;
import org.apache.myfaces.tobago.taglib.decl.InputTagDeclaration;
@@ -55,13 +54,6 @@
})
public interface InTagDeclaration
extends HasIdBindingAndRendered, HasConverter, IsReadonly, IsDisabled, IsInline, IsRequired, HasTip, IsPassword,
- HasSuggestMethod, InputTagDeclaration {
+ HasSuggestMethod, HasMarkup, InputTagDeclaration {
- /**
- * Indicate markup of this component.
- * Possible value is 'none'. But this can be overridden in the theme.
- */
- @TagAttribute
- @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
- void setMarkup(String markup);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/OutTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/OutTagDeclaration.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/OutTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/OutTagDeclaration.java Tue Jan 12 16:56:03 2010
@@ -24,6 +24,7 @@
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import org.apache.myfaces.tobago.component.ComponentTypes;
import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.taglib.decl.HasConverter;
import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.taglib.decl.HasTip;
@@ -57,12 +58,13 @@
/**
* Indicate markup of this component.
- * Possible values are 'none', 'strong' and 'deleted'
+ * Possible values are 'none'(deprecated), 'strong' and 'deleted'. This can be overridden in the theme.
+ * The value 'none' should not be used any longer. Just leave the attribute empty, or use a NULL pointer.
*/
@TagAttribute
- @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]",
+ @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.context.Markup",
allowedValues = {"none", "strong", "deleted"})
- void setMarkup(String markup);
+ void setMarkup(Markup markup);
@UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "Boolean.TRUE")
void setCreateSpan(String createSpan);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTagDeclaration.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTagDeclaration.java Tue Jan 12 16:56:03 2010
@@ -25,6 +25,7 @@
import org.apache.myfaces.tobago.taglib.decl.HasConverter;
import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.taglib.decl.HasLabelAndAccessKey;
+import org.apache.myfaces.tobago.taglib.decl.HasMarkup;
import org.apache.myfaces.tobago.taglib.decl.HasTip;
import org.apache.myfaces.tobago.taglib.decl.InputTagDeclaration;
import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
@@ -41,7 +42,7 @@
rendererType = RendererTypes.TEXT_AREA,
allowedChildComponenents = "NONE")
public interface TextAreaTagDeclaration extends HasIdBindingAndRendered,
- HasConverter, IsReadonly, IsDisabled, IsRequired, HasLabelAndAccessKey, HasTip, InputTagDeclaration {
+ HasConverter, IsReadonly, IsDisabled, IsRequired, HasLabelAndAccessKey, HasTip, HasMarkup, InputTagDeclaration {
/**
* The row count for this component.
@@ -49,12 +50,4 @@
@TagAttribute
@UIComponentTagAttribute()
void setRows(String rows);
-
- /**
- * Indicate markup of this component.
- * Possible value is 'none'. But this can be overridden in the theme.
- */
- @TagAttribute
- @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
- void setMarkup(String markup);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMarkup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMarkup.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMarkup.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasMarkup.java Tue Jan 12 16:56:03 2010
@@ -20,17 +20,14 @@
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
-/*
- * User: bommel
- * Date: Jan 19, 2007
- * Time: 9:51:30 PM
- */
public interface HasMarkup {
+
/**
* Indicate markup of this component.
- * Possible value is 'none'. But this can be overridden in the theme.
+ * The allowed markups can be defined or overridden in the theme.
+ * The value 'none' should not be used any longer. Just leave the attribute empty, or use a NULL pointer.
*/
@TagAttribute
- @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
+ @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.context.Markup")
void setMarkup(String markup);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Tue Jan 12 16:56:03 2010
@@ -34,6 +34,7 @@
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.component.SupportsMarkup;
import org.apache.myfaces.tobago.component.UIInputBase;
+import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.TransientStateHolder;
import org.apache.myfaces.tobago.el.ConstantMethodBinding;
import org.apache.myfaces.tobago.event.PopupActionListener;
@@ -349,8 +350,7 @@
if (UIComponentTag.isValueReference(markup)) {
markupComponent.setValueBinding(Attributes.MARKUP, createValueBinding(markup));
} else {
- String[] markups = splitList(markup);
- ((SupportsMarkup) markupComponent).setMarkup(markups);
+ ((SupportsMarkup) markupComponent).setMarkup(Markup.valueOf(markup));
}
} else {
LOG.error("Component did not support Markup " + markupComponent.getClass().getName());
Added: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java?rev=898418&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java (added)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java Tue Jan 12 16:56:03 2010
@@ -0,0 +1,79 @@
+package org.apache.myfaces.tobago.context;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.commons.collections.IteratorUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Arrays;
+
+public class MarkupUnitTest {
+
+ private static final String[] AB = new String[] {"a", "b"};
+
+ @Test
+ public void testString() {
+ Assert.assertNull(Markup.valueOf((String)null));
+
+ Assert.assertArrayEquals(new String[] {"accent"}, IteratorUtils.toArray(Markup.valueOf("accent").iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf("a,b").iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf("a, b").iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf(", \ta , ,\n b ,").iterator()));
+ }
+
+ @Test
+ public void testStringArray() {
+ Assert.assertNull(Markup.valueOf((String[])null));
+
+ Assert.assertNull(Markup.valueOf(new String[] {}));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf(new String[] {"a", "b"}).iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf(new String[] {" a ", " b "}).iterator()));
+ }
+
+ @Test
+ public void testObject() {
+ Assert.assertNull(Markup.valueOf((Object)null));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf((Object)", \ta , ,\n b ,").iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf((Object)new String[] {"a", "b"}).iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf((Object)new String[] {" a ", " b "}).iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf(new StringBuilder("a, b")).iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf(AB).iterator()));
+
+ Assert.assertArrayEquals(AB, IteratorUtils.toArray(Markup.valueOf(Arrays.asList(AB)).iterator()));
+ }
+
+ @Test
+ public void testMarkup() {
+ Assert.assertNull(Markup.valueOf((Markup)null));
+
+ Markup accent = Markup.valueOf("accent");
+ Assert.assertSame(accent, Markup.valueOf(accent));
+ }
+
+}
Propchange: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/tobago/trunk/extension/math/src/main/java/org/apache/myfaces/tobago/component/UIEquationGridLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/math/src/main/java/org/apache/myfaces/tobago/component/UIEquationGridLayout.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/math/src/main/java/org/apache/myfaces/tobago/component/UIEquationGridLayout.java (original)
+++ myfaces/tobago/trunk/extension/math/src/main/java/org/apache/myfaces/tobago/component/UIEquationGridLayout.java Tue Jan 12 16:56:03 2010
@@ -1,7 +1,6 @@
package org.apache.myfaces.tobago.component;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
import org.apache.myfaces.tobago.layout.Measure;
@@ -9,8 +8,6 @@
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
-import java.util.ArrayList;
-import java.util.List;
public class UIEquationGridLayout
extends AbstractUIEquationGridLayout {
@@ -30,7 +27,7 @@
private String marginTop;
private String columns;
private String rows;
- private java.lang.String[] markup;
+ private Markup markup;
public String getFamily() {
return COMPONENT_FAMILY;
@@ -298,7 +295,7 @@
this.rows = rows;
}
- public String[] getMarkup() {
+ public Markup getMarkup() {
if (markup != null) {
return markup;
}
@@ -306,30 +303,15 @@
if (ve != null) {
try {
Object strArray = ve.getValue(getFacesContext().getELContext());
- if (strArray instanceof String[]) {
- return (String[]) strArray;
- } else if (strArray instanceof String) {
- String[] strings = StringUtils.split((String) strArray, ", ");
- List<String> result = new ArrayList<String>(strings.length);
- for (String string : strings) {
- if (string.trim().length() != 0) {
- result.add(string.trim());
- }
- }
- return result.toArray(new String[result.size()]);
- } else if (strArray == null) {
- return ArrayUtils.EMPTY_STRING_ARRAY;
- } else {
- return new String[]{strArray.toString()};
- }
- } catch (ELException e) {
+ return Markup.valueOf(strArray);
+ } catch (ELException e) {
throw new FacesException(e);
}
}
- return ArrayUtils.EMPTY_STRING_ARRAY;
+ return Markup.NULL;
}
- public void setMarkup(String[] markup) {
+ public void setMarkup(Markup markup) {
this.markup = markup;
}
@@ -347,7 +329,7 @@
marginTop = (String) values[9];
columns = (String) values[10];
rows = (String) values[11];
- markup = (java.lang.String[]) values[12];
+ markup = (Markup) values[12];
}
public Object saveState(FacesContext context) {
Modified: myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java (original)
+++ myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java Tue Jan 12 16:56:03 2010
@@ -1,6 +1,6 @@
package org.apache.myfaces.tobago.layout;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.myfaces.tobago.context.Markup;
import javax.faces.component.UIComponentBase;
@@ -50,7 +50,7 @@
private Display display;
- private String[] markup = ArrayUtils.EMPTY_STRING_ARRAY;
+ private Markup markup;
public String getFamily() {
return null;
@@ -193,11 +193,11 @@
this.display = display;
}
- public String[] getMarkup() {
+ public Markup getMarkup() {
return markup;
}
- public void setMarkup(String[] markup) {
+ public void setMarkup(Markup markup) {
this.markup = markup;
}
}
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg Tue Jan 12 16:56:03 2010
@@ -481,6 +481,26 @@
}
>>
+MarkupProperty(property) ::= <<
+
+<checkDeprecated(property)>
+public <property.type> get<property.upperCamelCaseName>() {
+ if (<property.propertyName> != null) {
+ return <property.propertyName>;
+ }
+ <getValueExpression(property)>
+ if (vb != null) {
+ Object object = <getValue(property)>
+ return Markup.valueOf(object);
+ }
+ return null;
+}
+
+<checkDeprecated(property)>
+public void set<property.upperCamelCaseName>(<property.type> <property.propertyName>) {
+ this.<property.propertyName> = <property.propertyName>;
+}
+>>
field() ::= <<
private <it.internalType> <it.propertyName>;
@@ -526,6 +546,10 @@
values[<it.indexPlusOne>] = <it.propertyName>;
>>
+MarkupSaveStateProperty() ::= <<
+values[<it.indexPlusOne>] = <it.propertyName>;
+>>
+
DisplaySaveStateProperty() ::= <<
values[<it.indexPlusOne>] = <it.propertyName>;
>>
@@ -579,6 +603,10 @@
<it.propertyName> = (<it.type>) values[<it.indexPlusOne>];
>>
+MarkupRestoreStateProperty() ::= <<
+<it.propertyName> = (<it.type>) values[<it.indexPlusOne>];
+>>
+
DisplayRestoreStateProperty() ::= <<
<it.propertyName> = (<it.type>) values[<it.indexPlusOne>];
>>
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg Tue Jan 12 16:56:03 2010
@@ -441,6 +441,30 @@
}
>>
+MarkupProperty(property) ::= <<
+
+<checkDeprecated(property)>
+public <property.type> get<property.upperCamelCaseName>() {
+ if (<property.propertyName> != null) {
+ return <property.propertyName>;
+ }
+ <getValueExpression(property)>
+ if (ve != null) {
+ try {
+ Object object = <getValue(property)>
+ return Markup.valueOf(object);
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ }
+ return null;
+}
+
+<checkDeprecated(property)>
+public void set<property.upperCamelCaseName>(<property.type> <property.propertyName>) {
+ this.<property.propertyName> = <property.propertyName>;
+}
+>>
field() ::= <<
<if(it.elAlternativeAvailable)>
@@ -497,6 +521,10 @@
values[<it.indexPlusOne>] = <it.propertyName>;
>>
+MarkupSaveStateProperty() ::= <<
+values[<it.indexPlusOne>] = <it.propertyName>;
+>>
+
DisplaySaveStateProperty() ::= <<
values[<it.indexPlusOne>] = <it.propertyName>;
>>
@@ -557,6 +585,10 @@
<it.propertyName> = (<it.type>) values[<it.indexPlusOne>];
>>
+MarkupRestoreStateProperty() ::= <<
+<it.propertyName> = (<it.type>) values[<it.indexPlusOne>];
+>>
+
DisplayRestoreStateProperty() ::= <<
<it.propertyName> = (<it.type>) values[<it.indexPlusOne>];
>>
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg Tue Jan 12 16:56:03 2010
@@ -202,6 +202,16 @@
}
>>
+Markup() ::= <<
+if (<it.propertyName> != null) {
+ if (isValueReference(<it.propertyName>)) {
+ <createValueBinding(it)>
+ } else {
+ component.set<it.upperCamelCaseName>(org.apache.myfaces.tobago.context.Markup.valueOf(<it.propertyName>));
+ }
+}
+>>
+
OrderBy() ::= <<
if (<it.propertyName> != null) {
if (isValueReference(<it.propertyName>)) {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg Tue Jan 12 16:56:03 2010
@@ -229,7 +229,17 @@
if (!<it.propertyName>.isLiteralText()) {
<createValueBinding(it)>
} else {
- component.set<it.upperCamelCaseName>(org.apache.myfaces.tobago.layout.Measure.parse(<it.propertyName>.getExpressionString()));
+ component.set<it.upperCamelCaseName>(org.apache.myfaces.tobago.layout.Measure.valueOf(<it.propertyName>.getExpressionString()));
+ }
+}
+>>
+
+Markup() ::= <<
+if (<it.propertyName> != null) {
+ if (!<it.propertyName>.isLiteralText()) {
+ <createValueBinding(it)>
+ } else {
+ component.set<it.upperCamelCaseName>(org.apache.myfaces.tobago.context.Markup.valueOf(<it.propertyName>.getExpressionString()));
}
}
>>
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg Tue Jan 12 16:56:03 2010
@@ -172,6 +172,16 @@
}
>>
+Markup() ::= <<
+if (<it.propertyName> != null) {
+ if (isValueReference(<it.propertyName>)) {
+ <createValueBinding(it)>
+ } else {
+ component.set<it.upperCamelCaseName>(org.apache.myfaces.tobago.context.Markup.valueOf(<it.propertyName>));
+ }
+}
+>>
+
OrderBy() ::= <<
if (<it.propertyName> != null) {
if (isValueReference(<it.propertyName>)) {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg?rev=898418&r1=898417&r2=898418&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg Tue Jan 12 16:56:03 2010
@@ -209,6 +209,16 @@
}
>>
+Markup() ::= <<
+if (<it.propertyName> != null) {
+ if (!<it.propertyName>.isLiteralText()) {
+ <createValueBinding(it)>
+ } else {
+ component.set<it.upperCamelCaseName>(org.apache.myfaces.tobago.context.Markup.valueOf(<it.propertyName>));
+ }
+}
+>>
+
OrderBy() ::= <<
if (<it.propertyName> != null) {
if (!<it.propertyName>.isLiteralText()) {