rdonkin 01/03/29 15:06:07
Modified: src/java/org/apache/ecs XhtmlFrameSetDocument.java
Log:
Adding missing get/setDoctype()
Revision Changes Path
1.2 +64 -9 jakarta-ecs/src/java/org/apache/ecs/XhtmlFrameSetDocument.java
Index: XhtmlFrameSetDocument.java
===================================================================
RCS file: /home/cvs/jakarta-ecs/src/java/org/apache/ecs/XhtmlFrameSetDocument.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XhtmlFrameSetDocument.java 2000/11/28 17:37:56 1.1
+++ XhtmlFrameSetDocument.java 2001/03/29 23:06:07 1.2
@@ -63,9 +63,10 @@
import org.apache.ecs.xhtml.noframes;
/**
- This class creates a XhtmlFrameSetDocument container, for convience.
+ This class creates a XhtmlFrameSetDocument container, for convience.
+ Make sure that you add elements from org.apache.ecs.xhtml and not from
org.apache.ecs.html!
- @version $Id: XhtmlFrameSetDocument.java,v 1.1 2000/11/28 17:37:56 jstoor Exp $
+ @version $Id: XhtmlFrameSetDocument.java,v 1.2 2001/03/29 23:06:07 rdonkin Exp
$
@author <a href="mailto:[EMAIL PROTECTED]">Stephan Nagy</a>
@author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
@author <a href="mailto:[EMAIL PROTECTED]">Bojan Smojver</a>
@@ -87,6 +88,8 @@
/** @serial codeset codeset */
private String codeset = null;
+ /** @serial doctype doctype */
+ private Doctype doctype = null;
{
html = new html();
@@ -190,7 +193,7 @@
}
/**
- Append to the head element for this FrameSetDocument container.
+ Append to the head element for this XhtmlFrameSetDocument container.
@param value adds to the value between the head tags
*/
public XhtmlFrameSetDocument appendFrameSet(Element value)
@@ -305,15 +308,35 @@
*/
public void output(OutputStream out)
{
+ if (doctype != null)
+ {
+ doctype.output(out);
+ try
+ {
+ out.write('\n');
+ }
+ catch ( Exception e)
+ {}
+ }
// XhtmlFrameSetDocument is just a convient wrapper for html call
html.output
html.output(out);
}
/**
- Write the container to the PrinteWriter
+ Write the container to the PrintWriter
*/
public void output(PrintWriter out)
{
+ if (doctype != null)
+ {
+ doctype.output(out);
+ try
+ {
+ out.write('\n');
+ }
+ catch ( Exception e)
+ {}
+ }
// XhtmlFrameSetDocument is just a convient wrapper for html call
html.output
html.output(out);
}
@@ -323,10 +346,21 @@
*/
public final String toString()
{
+ StringBuffer sb = new StringBuffer();
if ( getCodeset() != null )
- return (html.toString(getCodeset()));
+ {
+ if (doctype != null)
+ sb.append (doctype.toString(getCodeset()));
+ sb.append (html.toString(getCodeset()));
+ return (sb.toString());
+ }
else
- return(html.toString());
+ {
+ if (doctype != null)
+ sb.append (doctype.toString());
+ sb.append (html.toString());
+ return(sb.toString());
+ }
}
/**
@@ -334,15 +368,36 @@
*/
public final String toString(String codeset)
{
- return(html.toString(codeset));
+ StringBuffer sb = new StringBuffer();
+ if (doctype != null)
+ sb.append (doctype.toString(getCodeset()));
+ sb.append (html.toString(getCodeset()));
+ return(sb.toString());
}
+
/**
Allows the XhtmlFrameSetDocument to be cloned. Doesn't return an
instanceof XhtmlFrameSetDocument returns instance of html.
-
*/
-
public Object clone()
{
return(html.clone());
}
+
+ /**
+ Get the doctype element for this XhtmlFrameSetDocument container.
+ */
+ public Doctype getDoctype()
+ {
+ return(doctype);
+ }
+
+ /**
+ Set the doctype element for this XhtmlFrameSetDocument container.
+ */
+ public XhtmlFrameSetDocument setDoctype(Doctype set_doctype)
+ {
+ this.doctype = set_doctype;
+ return(this);
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]