CVS: Tapestry/framework/src/net/sf/tapestry/engine Namespace.java,1.7.2.4,1.7.2.5

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/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv8408/framework/src/net/sf/tapestry/engine

Modified Files:
      Tag: hship-2-3
	Namespace.java 
Log Message:
Make getPageNames() and getComponentTypes() properly identify "discoverred" pages and components, not explicitly listed in the application/library specification.

Index: Namespace.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/engine/Namespace.java,v
retrieving revision 1.7.2.4
retrieving revision 1.7.2.5
diff -C2 -d -r1.7.2.4 -r1.7.2.5
*** Namespace.java	15 Dec 2002 16:26:12 -0000	1.7.2.4
--- Namespace.java	2 Jan 2003 03:06:07 -0000	1.7.2.5
***************
*** 1,8 ****
--- 1,11 ----
  package net.sf.tapestry.engine;
  
+ import java.util.ArrayList;
  import java.util.Collections;
  import java.util.HashMap;
+ import java.util.HashSet;
  import java.util.List;
  import java.util.Map;
+ import java.util.Set;
  
  import net.sf.tapestry.ApplicationRuntimeException;
***************
*** 114,118 ****
      }
  
!     public synchronized INamespace getChildNamespace(String id)
      {
          String firstId = id;
--- 117,121 ----
      }
  
!     public INamespace getChildNamespace(String id)
      {
          String firstId = id;
***************
*** 150,154 ****
      }
  
!     public synchronized ComponentSpecification getPageSpecification(String name)
      {
          ComponentSpecification result = (ComponentSpecification) _pages.get(name);
--- 153,157 ----
      }
  
!     public ComponentSpecification getPageSpecification(String name)
      {
          ComponentSpecification result = (ComponentSpecification) _pages.get(name);
***************
*** 166,173 ****
      public List getPageNames()
      {
!         return _specification.getPageNames();
      }
  
!     public synchronized ComponentSpecification getComponentSpecification(String alias)
      {
          ComponentSpecification result = (ComponentSpecification) _components.get(alias);
--- 169,185 ----
      public List getPageNames()
      {
!         Set names = new HashSet();
! 
!         names.addAll(_pages.keySet());
!         names.addAll(_specification.getPageNames());
! 
!         List result = new ArrayList(names);
! 
!         Collections.sort(result);
! 
!         return result;
      }
  
!     public ComponentSpecification getComponentSpecification(String alias)
      {
          ComponentSpecification result = (ComponentSpecification) _components.get(alias);
***************
*** 184,188 ****
      public List getComponentAliases()
      {
!         return _specification.getComponentAliases();
      }
  
--- 196,209 ----
      public List getComponentAliases()
      {
!         Set types = new HashSet();
!         
!         types.addAll(_components.keySet());
!         types.addAll(_specification.getComponentTypes());
!         
!         List result = new ArrayList(types);
!         
!         Collections.sort(result);
!         
!         return result;
      }
  
***************
*** 289,300 ****
      }
  
!     public boolean containsAlias(String alias)
      {
!         return _specification.getComponentSpecificationPath(alias) != null;
      }
  
      public boolean containsPage(String name)
      {
!         return _specification.getPageSpecificationPath(name) != null;
      }
  
--- 310,321 ----
      }
  
!     public boolean containsAlias(String type)
      {
!         return _components.containsKey(type) || (_specification.getComponentSpecificationPath(type) != null);
      }
  
      public boolean containsPage(String name)
      {
!         return _pages.containsKey(name) || (_specification.getPageSpecificationPath(name) != null);
      }
  
***************
*** 327,331 ****
      /** @since 2.4 **/
  
!     public void installPageSpecification(String pageName, ComponentSpecification specification)
      {
          _pages.put(pageName, specification);
--- 348,352 ----
      /** @since 2.4 **/
  
!     public synchronized void installPageSpecification(String pageName, ComponentSpecification specification)
      {
          _pages.put(pageName, specification);
***************
*** 334,338 ****
      /** @since 2.4 **/
  
!     public void installComponentSpecification(String type, ComponentSpecification specification)
      {
          _components.put(type, specification);
--- 355,359 ----
      /** @since 2.4 **/
  
!     public synchronized void installComponentSpecification(String type, ComponentSpecification specification)
      {
          _components.put(type, specification);
***************
*** 340,344 ****
  
      // On these renamed methods, we simply invoke the old, deprecated method
!     // for code coverage reasons.
  
      /** @since 2.4 **/
--- 361,366 ----
  
      // On these renamed methods, we simply invoke the old, deprecated method
!     // for code coverage reasons.  In 2.5 we delete the deprecated method
!     // and move its body here.
  
      /** @since 2.4 **/



-------------------------------------------------------
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.