Author: hlship
Date: Fri Apr 3 16:52:40 2009
New Revision: 761728
URL: http://svn.apache.org/viewvc?rev=761728&view=rev
Log:
TAP5-619: Add parameter to PropertyEditor to allow custom BeanBlockSource to be
used in place of the default one
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractPropertyOutput.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractPropertyOutput.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractPropertyOutput.java?rev=761728&r1=761727&r2=761728&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractPropertyOutput.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractPropertyOutput.java
Fri Apr 3 16:52:40 2009
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008 The Apache Software Foundation
+// Copyright 2007, 2008, 2009 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.
@@ -24,6 +24,7 @@
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.services.BeanBlockSource;
+import org.apache.tapestry5.services.Core;
import org.apache.tapestry5.services.Environment;
import org.apache.tapestry5.services.PropertyOutputContext;
@@ -59,14 +60,27 @@
@Parameter(required = true)
private Object object;
- @Inject
+ /**
+ * Source for property display blocks. This defaults to the default
implementation of {...@link
+ * org.apache.tapestry5.services.BeanBlockSource}.
+ */
+ @Parameter(required = true, allowNull = false)
private BeanBlockSource beanBlockSource;
@Inject
+ @Core
+ private BeanBlockSource defaultBeanBlockSource;
+
+ @Inject
private Environment environment;
private boolean mustPopEnvironment;
+ BeanBlockSource defaultBeanBlockSource()
+ {
+ return defaultBeanBlockSource;
+ }
+
protected PropertyModel getPropertyModel()
{
return model;
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java?rev=761728&r1=761727&r2=761728&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java
Fri Apr 3 16:52:40 2009
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008 The Apache Software Foundation
+// Copyright 2007, 2008, 2009 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.
@@ -111,10 +111,18 @@
@Inject
private Environment environment;
- @Inject
+ /**
+ * Source for property editor blocks. This defaults to the default
implementation of {...@link
+ * org.apache.tapestry5.services.BeanBlockSource}.
+ */
+ @Parameter(required = true, allowNull = false)
private BeanBlockSource beanBlockSource;
@Inject
+ @Core
+ private BeanBlockSource defaultBeanBlockSource;
+
+ @Inject
private Messages messages;
@Inject
@@ -131,6 +139,11 @@
private PropertyModel propertyModel;
+ BeanBlockSource defaultBeanBlockSource()
+ {
+ return defaultBeanBlockSource;
+ }
+
/**
* Creates a {...@link org.apache.tapestry5.services.PropertyEditContext}
and pushes it onto the {...@link
* org.apache.tapestry5.services.Environment} stack.