Author: manaRH
Date: 2008-10-24 06:49:57 -0400 (Fri, 24 Oct 2008)
New Revision: 9414
Added:
branches/enterprise/JBPAPP_4_3_FP01/examples/ui/src/org/jboss/seam/example/ui/SpanTitle.java
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/component/UISpan.java
Modified:
branches/enterprise/JBPAPP_4_3_FP01/examples/ui/view/template.xhtml
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/config/component/span.xml
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/renderkit/SpanRendererBase.java
Log:
JBPAPP-1322
Added:
branches/enterprise/JBPAPP_4_3_FP01/examples/ui/src/org/jboss/seam/example/ui/SpanTitle.java
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/examples/ui/src/org/jboss/seam/example/ui/SpanTitle.java
(rev 0)
+++
branches/enterprise/JBPAPP_4_3_FP01/examples/ui/src/org/jboss/seam/example/ui/SpanTitle.java 2008-10-24
10:49:57 UTC (rev 9414)
@@ -0,0 +1,13 @@
+package org.jboss.seam.example.ui;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Unwrap;
+@Name("spanTitle")
+public class SpanTitle
+{
+ @Unwrap
+ public String unwrap()
+ {
+ return "A Span title";
+ }
+}
\ No newline at end of file
Property changes on:
branches/enterprise/JBPAPP_4_3_FP01/examples/ui/src/org/jboss/seam/example/ui/SpanTitle.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/ui/view/template.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/ui/view/template.xhtml 2008-10-24
08:41:08 UTC (rev 9413)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/ui/view/template.xhtml 2008-10-24
10:49:57 UTC (rev 9414)
@@ -97,12 +97,18 @@
<code>s:graphicImage</code>
<f:param name="personId" value="1" />
</s:link></li>
+
+ <li><s:span title="#{spanTitle}"
style="font-weight:bold">
+ <code>s:span</code>
+ </s:span>
+ </li>
</ul>
</s:div>
<s:div styleClass="content">
<h1><code><h:outputText value="#{tagName}"
/></code></h1>
<ui:insert name="body" />
<h:messages />
+
</s:div>
</body>
Modified: branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/config/component/span.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/config/component/span.xml 2008-10-24
08:41:08 UTC (rev 9413)
+++ branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/config/component/span.xml 2008-10-24
10:49:57 UTC (rev 9414)
@@ -5,7 +5,7 @@
<name>org.jboss.seam.ui.Span</name>
<family>org.jboss.seam.ui.Span</family>
<classname>org.jboss.seam.ui.component.html.HtmlSpan</classname>
- <superclass>org.jboss.seam.ui.component.UIStyle</superclass>
+ <superclass>org.jboss.seam.ui.component.UISpan</superclass>
<description>
<![CDATA[Render a HTML <span>]]>
</description>
@@ -23,5 +23,10 @@
</tag>
&ui_component_attributes;
&html_style_attributes;
+ <property>
+ <name>title</name>
+ <classname>java.lang.String</classname>
+ <description>Span title attribute</description>
+ </property>
</component>
</components>
Added:
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/component/UISpan.java
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/component/UISpan.java
(rev 0)
+++
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/component/UISpan.java 2008-10-24
10:49:57 UTC (rev 9414)
@@ -0,0 +1,7 @@
+package org.jboss.seam.ui.component;
+
+public abstract class UISpan extends UIStyle
+{
+ public abstract String getTitle();
+ public abstract void setTitle(String title);
+}
Property changes on:
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/component/UISpan.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/renderkit/SpanRendererBase.java
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/renderkit/SpanRendererBase.java 2008-10-24
08:41:08 UTC (rev 9413)
+++
branches/enterprise/JBPAPP_4_3_FP01/ui/src/main/java/org/jboss/seam/ui/renderkit/SpanRendererBase.java 2008-10-24
10:49:57 UTC (rev 9414)
@@ -2,8 +2,11 @@
import java.io.IOException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.jboss.seam.ui.component.UISpan;
import org.jboss.seam.ui.component.UIStyle;
public class SpanRendererBase extends StyleRendererBase
@@ -12,7 +15,7 @@
@Override
protected Class getComponentClass()
{
- return UIStyle.class;
+ return UISpan.class;
}
@Override
@@ -22,6 +25,28 @@
}
@Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException
+ {
+ UISpan span = (UISpan) component;
+
+ startElement(writer, span);
+ writer.writeAttribute("id", component.getClientId(context),
"id");
+
+ if (span.getStyleClass() != null)
+ {
+ writer.writeAttribute("class", span.getStyleClass(),
"styleClass");
+ }
+ if (span.getStyle() != null)
+ {
+ writer.writeAttribute("style", span.getStyle(), "style");
+ }
+ if (span.getTitle() != null)
+ {
+ writer.writeAttribute("title", span.getTitle(), "title");
+ }
+ }
+
+ @Override
public void startElement(ResponseWriter writer, UIStyle style) throws IOException
{
writer.startElement("span", style);
Show replies by date