CVS: Tapestry/framework/src/net/sf/tapestry AbstractComponent.java,1.20.2.1,1.20.2.2

Howard Lewis Ship <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry
In directory sc8-pr-cvs1:/tmp/cvs-serv10255a/framework/src/net/sf/tapestry

Modified Files:
      Tag: hship-2-3
	AbstractComponent.java 
Log Message:
Change getBindingNames() to work properly for implicit components.

Index: AbstractComponent.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/AbstractComponent.java,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -C2 -d -r1.20.2.1 -r1.20.2.2
*** AbstractComponent.java	30 Dec 2002 03:04:56 -0000	1.20.2.1
--- AbstractComponent.java	31 Dec 2002 12:23:22 -0000	1.20.2.2
***************
*** 7,10 ****
--- 7,11 ----
  import java.util.HashSet;
  import java.util.Iterator;
+ import java.util.List;
  import java.util.Map;
  
***************
*** 694,718 ****
              return null;
  
!         ContainedComponent contained = _container.getSpecification().getComponent(_id);
  
!         // If no informal parameters, then it's safe to return
!         // just the names of the formal parameters.
  
!         if (_bindings == null || _bindings.size() == 0)
!             return contained.getBindingNames();
  
!         // The new HTML parser means that sometimes, the informal attributes
!         // come from the HTML template and aren't known in the contained component
!         // specification.  The only thing to do is to build up a set of
!         // informal bindings.  A degenerate case:  an informal binding that has
!         // setXXXBinding and getXXXBinding methods --- that makes the
!         // informal parameter invisible to this method (and thus, to the Inspector).
  
!         HashSet result = new HashSet(contained.getBindingNames());
  
!         // All the informal bindings go into the bindings Map.   Also
!         // formal parameters where there isn't a corresponding JavaBeans property.
  
!         result.addAll(_bindings.keySet());
  
          return result;
--- 695,723 ----
              return null;
  
!         HashSet result = new HashSet();
  
!         // All the informal bindings go into the bindings Map.   Also
!         // formal parameters where there isn't a corresponding JavaBeans property.
  
!         if (_bindings != null)
!             result.addAll(_bindings.keySet());
  
!         // Now, iterate over the formal parameters and add the formal parameters
!         // that have a binding.
!         
!         List names = _specification.getParameterNames();
  
!         int count = names.size();
  
!         for (int i = 0; i < count; i++)
!         {
!             String name = (String) names.get(i);
  
!             if (result.contains(name))
!                 continue;
! 
!             if (getBinding(name) != null)
!                 result.add(name);
!         }
  
          return result;



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.