tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drobia...@apache.org
Subject svn commit: r1148187 - in /tapestry/tapestry5/trunk: tapestry-core/src/main/java/org/apache/tapestry5/services/ tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/
Date Tue, 19 Jul 2011 05:57:38 GMT
Author: drobiazko
Date: Tue Jul 19 05:57:36 2011
New Revision: 1148187

URL: http://svn.apache.org/viewvc?rev=1148187&view=rev
Log:
TAP5-1574: Provide constants for available data types

Added:
    tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataTypeConstants.java
  (with props)
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
    tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataType.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=1148187&r1=1148186&r2=1148187&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
Tue Jul 19 05:57:36 2011
@@ -18,6 +18,7 @@ import org.apache.tapestry5.*;
 import org.apache.tapestry5.ajax.MultiZoneUpdate;
 import org.apache.tapestry5.annotations.*;
 import org.apache.tapestry5.annotations.ContentType;
+import org.apache.tapestry5.beaneditor.DataTypeConstants;
 import org.apache.tapestry5.beaneditor.Validate;
 import org.apache.tapestry5.corelib.ClientValidation;
 import org.apache.tapestry5.grid.GridDataSource;
@@ -682,36 +683,36 @@ public final class TapestryModule
 
         configuration.add(Object.class, "");
 
-        configuration.add(String.class, "text");
-        configuration.add(Number.class, "number");
-        configuration.add(Enum.class, "enum");
-        configuration.add(Boolean.class, "boolean");
-        configuration.add(Date.class, "date");
-        configuration.add(Calendar.class, "calendar");
+        configuration.add(String.class, DataTypeConstants.TEXT);
+        configuration.add(Number.class, DataTypeConstants.NUMBER);
+        configuration.add(Enum.class, DataTypeConstants.ENUM);
+        configuration.add(Boolean.class, DataTypeConstants.BOOLEAN);
+        configuration.add(Date.class, DataTypeConstants.DATE);
+        configuration.add(Calendar.class, DataTypeConstants.CALENDAR);
     }
 
     @Contribute(BeanBlockSource.class)
     public static void provideDefaultBeanBlocks(Configuration<BeanBlockContribution>
configuration)
     {
-        addEditBlock(configuration, "text");
-        addEditBlock(configuration, "number");
-        addEditBlock(configuration, "enum");
-        addEditBlock(configuration, "boolean");
-        addEditBlock(configuration, "date");
-        addEditBlock(configuration, "password");
-        addEditBlock(configuration, "calendar");
+        addEditBlock(configuration, DataTypeConstants.TEXT);
+        addEditBlock(configuration, DataTypeConstants.NUMBER);
+        addEditBlock(configuration, DataTypeConstants.ENUM);
+        addEditBlock(configuration, DataTypeConstants.BOOLEAN);
+        addEditBlock(configuration, DataTypeConstants.DATE);
+        addEditBlock(configuration, DataTypeConstants.PASSWORD);
+        addEditBlock(configuration, DataTypeConstants.CALENDAR);
 
         // longtext uses a text area, not a text field
 
-        addEditBlock(configuration, "longtext");
+        addEditBlock(configuration, DataTypeConstants.LONG_TEXT);
 
-        addDisplayBlock(configuration, "enum");
-        addDisplayBlock(configuration, "date");
-        addDisplayBlock(configuration, "calendar");
+        addDisplayBlock(configuration, DataTypeConstants.ENUM);
+        addDisplayBlock(configuration, DataTypeConstants.DATE);
+        addDisplayBlock(configuration, DataTypeConstants.CALENDAR);
 
         // Password and long text have special output needs.
-        addDisplayBlock(configuration, "password");
-        addDisplayBlock(configuration, "longtext");
+        addDisplayBlock(configuration, DataTypeConstants.PASSWORD);
+        addDisplayBlock(configuration, DataTypeConstants.LONG_TEXT);
     }
 
     private static void addEditBlock(Configuration<BeanBlockContribution> configuration,
String dataType)
@@ -1600,8 +1601,7 @@ public final class TapestryModule
      * partial page renders.
      * Supports an ordered configuration of {@link org.apache.tapestry5.services.PartialMarkupRendererFilter}s.
      *
-     * @see #contributePartialMarkupRenderer(org.apache.tapestry5.ioc.OrderedConfiguration,
org.apache.tapestry5.Asset,
-     *      org.apache.tapestry5.ioc.services.SymbolSource, AssetSource)
+     * @see #contributePartialMarkupRenderer(org.apache.tapestry5.ioc.OrderedConfiguration,
org.apache.tapestry5.Asset, org.apache.tapestry5.services.javascript.JavaScriptStackSource,
org.apache.tapestry5.internal.services.javascript.JavaScriptStackPathConstructor, org.apache.tapestry5.ioc.services.SymbolSource,
AssetSource)
      */
     public PartialMarkupRenderer buildPartialMarkupRenderer(Logger logger,
                                                             List<PartialMarkupRendererFilter>
configuration, @Autobuild

Modified: tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataType.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataType.java?rev=1148187&r1=1148186&r2=1148187&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataType.java
(original)
+++ tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataType.java
Tue Jul 19 05:57:36 2011
@@ -23,6 +23,8 @@ import java.lang.annotation.*;
  * Used to explicitly set the data type used to select an editor (or display) block.  Normally,
the data type is
  * determined from the type of the property (for example, property type java.lang.String
would map to data type "text").
  * This annotation may be attached to a getter or setter method, or the matching field.
+ *
+ * @see DataTypeConstants
  */
 @Target({ ElementType.FIELD, ElementType.METHOD })
 @Retention(RetentionPolicy.RUNTIME)

Added: tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataTypeConstants.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataTypeConstants.java?rev=1148187&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataTypeConstants.java
(added)
+++ tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataTypeConstants.java
Tue Jul 19 05:57:36 2011
@@ -0,0 +1,65 @@
+// Copyright 2007, 2008 The Apache Software Foundation
+//
+// Licensed 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.
+
+package org.apache.tapestry5.beaneditor;
+
+/**
+ * Defines the names of data types used to select an editor (or display) block for a property.
+ *
+ * @see DataType
+ * @since 5.3
+ */
+public class DataTypeConstants
+{
+    /**
+     * Used for {@link String} properties.
+     */
+    public static final String TEXT = "text";
+
+    /**
+     * Used for properties of {@link Number} type.
+     */
+    public static final String NUMBER = "number";
+
+    /**
+     * Used for {@link Enum}s.
+     */
+    public static final String ENUM = "enum";
+
+    /**
+     * Used for boolean properties.
+     */
+    public static final String BOOLEAN = "boolean";
+
+    /**
+     * Used to render a JavaScript calendar for a {@link java.util.Date} property.
+     */
+    public static final String DATE = "date";
+
+    /**
+     * Used to render a JavaScript calendar for a {@link java.util.Calendar} property.
+     */
+    public static final String CALENDAR = "calendar";
+
+    /**
+     * Used to render a password field for a {@link String} property.
+     */
+    public static final String PASSWORD = "password";
+
+    /**
+     * Used to render a textarea field for a {@link String} property.
+     */
+    public static final String LONG_TEXT = "longtext";
+
+}

Propchange: tapestry/tapestry5/trunk/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/DataTypeConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message