Mike Wilson wrote:
> Does anyone have any code examples for ECS with Cascading Style Sheets that
> are more complicated than the ones in TestBed.java.
I was going to codeup an interface and elements that would allow this when I
got distracted with work. It occured to me today we could do the following to
get the result you need.
>
> Specificially I need to implement inline styles such as:
> <P style="font-size: 10pt; font-family: times" id="p10"> foo </P>
> <SPAN style="font-size: 10pt; font-family: times" id="s10"> bar </SPAN>
P p = new P();
p.setStyle("font-size: 10pt; font-family: times");
p.setId("s10");
p.addElement("foo");
Span span = new Span();
span.setStyle("font-size: 10pt; font-family: times");
span.setId(s10");
span.addElement("bar");
p.output(System.out);
span.output(System.out);
>
> <STYLE>
> BODY {background:#000000; color: #FFFF00; margin-left:0.5in}
> H2 {font-size:18pt; color:#FF0000; background:#FFFFFF}
> P {font-size:10pt}
> </STYLE>
Style style = new Style();
style.addElement(new StringElement("BODY { background: #000000; color:
#FFFF00; magrin-left: 0.5in }"));
style.addElement(new StringElement("H2 { font-size: 18pt; color:#FF0000;
background: #FFFFFF}"));
style.addElement(new StringElement("P{font-size: 10pt}"));
style.output(System.out);
>
> <H2 id="h2_1"> Using a style. </H2>
H2 h2 = new H2();
h2.setId("h2_1");
h2.addElement("Using a style");
h2.output(System.out);
Hope this helps,
-stephan
--
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]