Author: norman.richards(a)jboss.com
Date: 2008-01-25 18:28:30 -0500 (Fri, 25 Jan 2008)
New Revision: 7242
Added:
branches/Seam_2_0/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java
branches/Seam_2_0/examples/itext/view/html.xhtml
branches/Seam_2_0/examples/itext/view/swing.xhtml
Modified:
branches/Seam_2_0/examples/itext/resources/WEB-INF/components.xml
branches/Seam_2_0/examples/itext/view/index.xhtml
Log:
update html and swing examples
Modified: branches/Seam_2_0/examples/itext/resources/WEB-INF/components.xml
===================================================================
--- branches/Seam_2_0/examples/itext/resources/WEB-INF/components.xml 2008-01-25 20:36:19
UTC (rev 7241)
+++ branches/Seam_2_0/examples/itext/resources/WEB-INF/components.xml 2008-01-25 23:28:30
UTC (rev 7242)
@@ -17,4 +17,7 @@
<core:init debug="true" jndi-pattern="@jndiPattern@" />
+ <component name="sampleButton"
class="javax.swing.JButton">
+ <property name="label">A JButton!</property>
+ </component>
</components>
Added:
branches/Seam_2_0/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java
===================================================================
--- branches/Seam_2_0/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java
(rev 0)
+++
branches/Seam_2_0/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java 2008-01-25
23:28:30 UTC (rev 7242)
@@ -0,0 +1,29 @@
+package org.jboss.seam.example.pdf;
+
+import java.awt.*;
+import javax.swing.*;
+
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Name;
+
+@Name("swing")
+public class SwingComponent
+{
+ @Create
+ public void init() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
+ } catch(Exception e) {
+ System.out.println("Error setting Java LAF: " + e);
+ }
+
+ System.out.println("** " + UIManager.getLookAndFeel());
+ }
+
+ public Component getButton() {
+ JLabel label = new JLabel("Hello, Seam", SwingConstants.CENTER);
+
+ return label;
+ }
+
+}
Added: branches/Seam_2_0/examples/itext/view/html.xhtml
===================================================================
--- branches/Seam_2_0/examples/itext/view/html.xhtml (rev 0)
+++ branches/Seam_2_0/examples/itext/view/html.xhtml 2008-01-25 23:28:30 UTC (rev 7242)
@@ -0,0 +1,29 @@
+<p:document
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+
+ <p:paragraph>This is a regular paragraph.</p:paragraph>
+
+
+ <p:html value="This is HTML that is just plain text." />
+ <p:html value="This is HTML with <b>some
markup</b>." />
+
+ <p:html>
+ This is HTML with text with text in the <b>body</b>.
+ </p:html>
+
+
+ <p:html>
+ <h1>This is more complex HTML</h1>
+ <ul>
+ <li>one</li>
+ <li>two</li>
+ <li>three</li>
+ </ul>
+ </p:html>
+
+
+ <p:html>
+ <s:formattedText value="*This* /is/ |Seam Text| as HTML. It's
very^cool^." />
+ </p:html>
+</p:document>
Modified: branches/Seam_2_0/examples/itext/view/index.xhtml
===================================================================
--- branches/Seam_2_0/examples/itext/view/index.xhtml 2008-01-25 20:36:19 UTC (rev 7241)
+++ branches/Seam_2_0/examples/itext/view/index.xhtml 2008-01-25 23:28:30 UTC (rev 7242)
@@ -34,6 +34,8 @@
<li><s:link view="/table.xhtml" value="Tables"
/></li>
<li><s:link view="/nested.xhtml" value="Nested
Tables" /></li>
<li><s:link view="/html.xhtml" value="HTML
Conversion" /></li>
+ <li><s:link view="/swing.xhtml" value="Swing
Component" /></li>
+
<li><s:link view="/chart.xhtml"
value="JFreeChart" />
[<s:link view="/chartimage.xhtml" value="HTML" />]
</li>
Added: branches/Seam_2_0/examples/itext/view/swing.xhtml
===================================================================
--- branches/Seam_2_0/examples/itext/view/swing.xhtml (rev 0)
+++ branches/Seam_2_0/examples/itext/view/swing.xhtml 2008-01-25 23:28:30 UTC (rev 7242)
@@ -0,0 +1,12 @@
+<p:document
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+
+
+ <p:paragraph>A JLabel, from Java: </p:paragraph>
+ <p:swing width="310" height="120"
component="#{swing.button}" />
+
+ <p:paragraph>A JButton, defined in components.xml: </p:paragraph>
+ <p:swing width="310" height="120"
component="#{sampleButton}" />
+
+</p:document>