You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2003/03/31 23:46:58 UTC

cvs commit: jakarta-tapestry/framework/src/org/apache/tapestry/html Shell.java Shell.jwc

hlship      2003/03/31 13:46:58

  Modified:    framework/src/org/apache/tapestry/html Shell.java Shell.jwc
  Log:
  Add stylesheets parameter to Shell component.
  
  Revision  Changes    Path
  1.3       +24 -6     jakarta-tapestry/framework/src/org/apache/tapestry/html/Shell.java
  
  Index: Shell.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/html/Shell.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Shell.java	15 Mar 2003 21:22:21 -0000	1.2
  +++ Shell.java	31 Mar 2003 21:46:57 -0000	1.3
  @@ -56,6 +56,7 @@
   package org.apache.tapestry.html;
   
   import java.util.Date;
  +import java.util.Iterator;
   
   import org.apache.tapestry.AbstractComponent;
   import org.apache.tapestry.IAsset;
  @@ -138,12 +139,18 @@
               IAsset stylesheet = getStylesheet();
   
               if (stylesheet != null)
  +                writeStylesheetLink(writer, cycle, stylesheet);
  +
  +            Iterator i = Tapestry.coerceToIterator(getStylesheets());
  +
  +            if (i != null)
               {
  -                writer.beginEmpty("link");
  -                writer.attribute("rel", "stylesheet");
  -                writer.attribute("type", "text/css");
  -                writer.attribute("href", stylesheet.buildURL(cycle));
  -                writer.println();
  +                while (i.hasNext())
  +                {
  +                    stylesheet = (IAsset) i.next();
  +
  +                    writeStylesheetLink(writer, cycle, stylesheet);
  +                }
               }
   
               writeRefresh(writer, cycle);
  @@ -167,6 +174,15 @@
   
       }
   
  +    private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle cycle, IAsset stylesheet)
  +    {
  +        writer.beginEmpty("link");
  +        writer.attribute("rel", "stylesheet");
  +        writer.attribute("type", "text/css");
  +        writer.attribute("href", stylesheet.buildURL(cycle));
  +        writer.println();
  +    }
  +
       private void writeRefresh(IMarkupWriter writer, IRequestCycle cycle)
       {
           int refresh = getRefresh();
  @@ -205,6 +221,8 @@
       public abstract String getDTD();
   
       public abstract void setDTD(String DTD);
  +
  +    public abstract Object getStylesheets();
   
       protected void finishLoad()
       {
  
  
  
  1.2       +8 -2      jakarta-tapestry/framework/src/org/apache/tapestry/html/Shell.jwc
  
  Index: Shell.jwc
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/html/Shell.jwc,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Shell.jwc	5 Mar 2003 22:59:30 -0000	1.1
  +++ Shell.jwc	31 Mar 2003 21:46:57 -0000	1.2
  @@ -26,6 +26,12 @@
       If specified, provides an external stylesheet for the page.
       </description>
     </parameter>
  +  
  +  <parameter name="stylesheets" type="java.lang.Object" direction="in">
  +  	<description>
  +  	Array or collection of stylesheet assets.
  +  	</description>	
  +  </parameter>
   
     <parameter name="DTD" 
     	type="java.lang.String"
  @@ -49,7 +55,7 @@
     	type="org.apache.tapestry.IRender"
     	direction="in">
       <description>
  -    If specified, the delegate is allowed to render before the close of the &lt;head&gt;
  +    If specified, the delegate is rendered before the close of the &lt;head&gt;
       tag (typically used to provide &lt;meta&gt; tags).
       </description>
     </parameter>