[jboss-cvs] jboss-seam/src/main/org/jboss/seam ...
Gavin King
gavin.king at jboss.com
Thu Sep 28 18:31:40 EDT 2006
User: gavin
Date: 06/09/28 18:31:40
Modified: src/main/org/jboss/seam Component.java
Log:
make @Out default to scope of the component
Revision Changes Path
1.166 +14 -14 jboss-seam/src/main/org/jboss/seam/Component.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Component.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -b -r1.165 -r1.166
--- Component.java 27 Sep 2006 03:53:48 -0000 1.165
+++ Component.java 28 Sep 2006 22:31:40 -0000 1.166
@@ -104,7 +104,7 @@
*
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
* @author Gavin King
- * @version $Revision: 1.165 $
+ * @version $Revision: 1.166 $
*/
@Scope(ScopeType.APPLICATION)
public class Component
@@ -1021,7 +1021,7 @@
{
ScopeType scope = wrapper.getVariableScope(dataModelAnn);
- Object dataModel = getDataModelContext(scope).get(name);
+ Object dataModel = getOutContext(scope).get(name);
if ( dataModel != null )
{
@@ -1110,7 +1110,7 @@
ScopeType scope = wrapper.getVariableScope(dataModelAnn);
- Context context = getDataModelContext(scope);
+ Context context = getOutContext(scope);
Object existingDataModel = context.get(name);
boolean dirty = existingDataModel == null || scope==PAGE ||
wrapper.isDirty(dataModelAnn, existingDataModel, list);
@@ -1129,7 +1129,7 @@
}
- private Context getDataModelContext(ScopeType specifiedScope) {
+ private Context getOutContext(ScopeType specifiedScope) {
ScopeType scope = this.scope;
if (scope==STATELESS)
{
@@ -1223,10 +1223,10 @@
}
else
{
- ScopeType scope;
- if (out.scope()==UNSPECIFIED)
+ Component component = null;
+ if ( out.scope()==UNSPECIFIED )
{
- Component component = Component.forName(name);
+ component = Component.forName(name);
if (value!=null && component!=null)
{
if ( !component.isInstance(value) )
@@ -1237,19 +1237,19 @@
);
}
}
- scope = component==null ? EVENT : component.getScope();
- }
- else
- {
- scope = out.scope();
}
+
+ Context context = component==null ?
+ getOutContext( out.scope() ) :
+ component.getScope().getContext();
+
if (value==null)
{
- scope.getContext().remove(name);
+ context.remove(name);
}
else
{
- scope.getContext().set(name, value);
+ context.set(name, value);
}
}
}
More information about the jboss-cvs-commits
mailing list