JBoss Rich Faces SVN: r2387 - trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-08-21 19:19:11 -0400 (Tue, 21 Aug 2007)
New Revision: 2387
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
Log:
Modified: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-08-21 23:11:09 UTC (rev 2386)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-08-21 23:19:11 UTC (rev 2387)
@@ -33,7 +33,7 @@
menuGroup= richMenu, Menu Group, /images/ico_dropDownMenu.gif, /images/cn_MenuGroup.gif, RichFacesComponentsLibrary.html#menuGroup, jbossrichfaces/freezone/docs/tlddoc/rich/menuGroup.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMenuGroup.html, /richfaces/dropDownMenu.jsf
menuItem= richMenu, Menu Item, /images/ico_dropDownMenu.gif, /images/cn_MenuItem.gif, RichFacesComponentsLibrary.html#menuItem, jbossrichfaces/freezone/docs/tlddoc/rich/menuItem.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMenuItem.html, /richfaces/dropDownMenu.jsf
menuSeparator= richMenu, Menu Separator, /images/ico_dropDownMenu.gif, /images/cn_MenuSeparator.gif, RichFacesComponentsLibrary.html#menuSeparator, jbossrichfaces/freezone/docs/tlddoc/rich/menuSeparator.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMenuSeparator.html, /richfaces/dropDownMenu.jsf
-calendar= richInputs, Calendar, /images/ico_common.gif, /images/cn_Calendar.gif, RichFacesComponentsLibrary.html#calendar, jbossrichfaces/freezone/docs/tlddoc/rich/calendar.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UICalendar.html, /richfaces/comingSoon.jsf
+calendar= richInputs, Calendar, /images/ico_common.gif, /images/cn_Calendar.gif, RichFacesComponentsLibrary.html#calendar, jbossrichfaces/freezone/docs/tlddoc/rich/calendar.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UICalendar.html, /richfaces/calendar.jsf
message= richMisc, Message, /images/ico_common.gif, /images/cn_Message.gif, RichFacesComponentsLibrary.html#message, jbossrichfaces/freezone/docs/tlddoc/rich/message.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMessage.html, /richfaces/comingSoon.jsf
messages= richMisc, Messages, /images/ico_common.gif, /images/cn_Messages.gif, RichFacesComponentsLibrary.html#messages, jbossrichfaces/freezone/docs/tlddoc/rich/messages.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMessages.html, /richfaces/comingSoon.jsf
virtualEarth= richMisc, Virtual Earth, /images/ico_VirtualEarth.gif, /images/cn_VirtualEarth.gif, RichFacesComponentsLibrary.html#virtualEarth, jbossrichfaces/freezone/docs/tlddoc/rich/virtualEarth.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIVirtualEarth.html, /richfaces/comingSoon.jsf
18 years, 8 months
JBoss Rich Faces SVN: r2386 - in trunk/samples/richfaces-demo/src/main: webapp/WEB-INF/lib and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-08-21 19:11:09 -0400 (Tue, 21 Aug 2007)
New Revision: 2386
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpegSample.xhtml
Removed:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpeg.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaBean.java
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/lib/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml
Log:
demo updates
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaBean.java 2007-08-21 20:53:37 UTC (rev 2385)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaBean.java 2007-08-21 23:11:09 UTC (rev 2386)
@@ -1,53 +1,13 @@
package org.richfaces.demo.media;
-import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.Serializable;
-
import javax.imageio.ImageIO;
public class MediaBean {
- /**
- * Created 21.08.2007
- * @author Nick Belaevski
- * @since 3.1
- */
-
- public static class MediaData implements Serializable {
- private int width;
- private int height;
- private Color background;
- private Color drawColor;
- public int getWidth() {
- return width;
- }
- public void setWidth(int width) {
- this.width = width;
- }
- public int getHeight() {
- return height;
- }
- public void setHeight(int height) {
- this.height = height;
- }
- public Color getBackground() {
- return background;
- }
- public void setBackground(Color background) {
- this.background = background;
- }
- public Color getDrawColor() {
- return drawColor;
- }
- public void setDrawColor(Color drawColor) {
- this.drawColor = drawColor;
- }
- }
-
public void paint(OutputStream out, Object data) throws IOException{
if (data instanceof MediaData) {
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/lib
___________________________________________________________________
Name: svn:ignore
+ phaseTracker.jar
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml 2007-08-21 23:11:09 UTC (rev 2386)
@@ -0,0 +1,12 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form>
+ <rich:calendar inputType="text" datePattern="dd/MM/yyyy" />
+ </h:form>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/usage.xhtml 2007-08-21 23:11:09 UTC (rev 2386)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ </p>
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/calendar/examples/calSample.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/calendar/examples/calSample.xhtml"/>
+ </ui:include>
+
+ </div>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar.xhtml 2007-08-21 23:11:09 UTC (rev 2386)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components - Rich Calendar</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tab label="Usage">
+ <ui:include src="/richfaces/calendar/usage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Deleted: trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpeg.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpeg.xhtml 2007-08-21 20:53:37 UTC (rev 2385)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpeg.xhtml 2007-08-21 23:11:09 UTC (rev 2386)
@@ -1,14 +0,0 @@
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
-
-
- <rich:separator height="1" style="padding:10px"/>
- <a4j:mediaOutput element="img" cacheable="false" session="true"
- createContent="#{mediaBean.paint}" value="#{mediaData}" mimeType="image/jpeg" />
- <rich:separator height="1" style="padding:10px"/>
-
-</ui:composition>
\ No newline at end of file
Copied: trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpegSample.xhtml (from rev 2378, trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpeg.xhtml)
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpegSample.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/examples/jpegSample.xhtml 2007-08-21 23:11:09 UTC (rev 2386)
@@ -0,0 +1,14 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+
+ <rich:separator height="1" style="padding:10px"/>
+ <a4j:mediaOutput element="img" cacheable="false" session="true"
+ createContent="#{mediaBean.paint}" value="#{mediaData}" mimeType="image/jpeg" />
+ <rich:separator height="1" style="padding:10px"/>
+
+</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/usage.xhtml 2007-08-21 20:53:37 UTC (rev 2385)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/mediaOutput/usage.xhtml 2007-08-21 23:11:09 UTC (rev 2386)
@@ -32,9 +32,9 @@
</p>
<div class="sample-container" >
- <ui:include src="/richfaces/mediaOutput/examples/jpeg.xhtml"/>
+ <ui:include src="/richfaces/mediaOutput/examples/jpegSample.xhtml"/>
<ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/mediaOutput/examples/jpeg.xhtml"/>
+ <ui:param name="sourcepath" value="/richfaces/mediaOutput/examples/jpegSample.xhtml"/>
<ui:param name="openlabel" value="View Page Source" />
</ui:include>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml 2007-08-21 20:53:37 UTC (rev 2385)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml 2007-08-21 23:11:09 UTC (rev 2386)
@@ -15,13 +15,6 @@
</p>
<div class="sample-container" >
- <h:outputText value="Ajax Status:"/>
-
- <a4j:status id="commonstatus" startText="In progress..." stopText="Complete"/>
-
- <h:form>
- <a4j:commandButton eventsQueue="foo" value="Ajax request"/>
- </h:form>
<ui:include src="/richfaces/status/examples/simple.xhtml"/>
<ui:include src="/templates/include/sourceview.xhtml">
<ui:param name="sourcepath" value="/richfaces/status/examples/simple.xhtml"/>
@@ -50,21 +43,7 @@
</p>
<div class="sample-container" >
- <a4j:region id="rb">
- <h:panelGrid columns="2">
-
- <h:form>
- <a4j:commandButton eventsQueue="foo2" value="Ajax request 2"/>
- </h:form>
-
- <a4j:status>
- <f:facet name="start">
- <h:graphicImage value="/images/ajax/ajax_process.gif"/>
- </f:facet>
- </a4j:status>
-
- </h:panelGrid>
- </a4j:region>
+
<ui:include src="/richfaces/status/examples/pictured.xhtml"/>
<ui:include src="/templates/include/sourceview.xhtml">
<ui:param name="sourcepath" value="/richfaces/status/examples/pictured.xhtml"/>
18 years, 8 months
JBoss Rich Faces SVN: r2385 - in trunk/ui/insert/src/main: java/org and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-08-21 16:53:37 -0400 (Tue, 21 Aug 2007)
New Revision: 2385
Added:
trunk/ui/insert/src/main/java/org/ajax4jsf/
trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/
trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java
Modified:
trunk/ui/insert/src/main/config/component/insert.xml
trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css
trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx
Log:
display error information on page, instead of exception.
Modified: trunk/ui/insert/src/main/config/component/insert.xml
===================================================================
--- trunk/ui/insert/src/main/config/component/insert.xml 2007-08-21 19:37:43 UTC (rev 2384)
+++ trunk/ui/insert/src/main/config/component/insert.xml 2007-08-21 20:53:37 UTC (rev 2385)
@@ -36,5 +36,29 @@
<defaultvalue>"default"</defaultvalue>
</property>
-->
+ <property>
+ <name>src</name>
+ <classname>java.lang.String</classname>
+ <description><![CDATA[
+ ]]></description>
+ </property>
+ <property>
+ <name>highlight</name>
+ <classname>java.lang.String</classname>
+ <description><![CDATA[
+ ]]></description>
+ </property>
+ <property>
+ <name>encoding</name>
+ <classname>java.lang.String</classname>
+ <description><![CDATA[
+ ]]></description>
+ </property>
+ <property>
+ <name>errorContent</name>
+ <classname>java.lang.String</classname>
+ <description><![CDATA[
+ ]]></description>
+ </property>
</component>
</components>
Added: trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java
===================================================================
--- trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java (rev 0)
+++ trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java 2007-08-21 20:53:37 UTC (rev 2385)
@@ -0,0 +1,112 @@
+/**
+ *
+ */
+package org.ajax4jsf.renderkit;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.ui.component.Highlight;
+import org.richfaces.ui.component.UIInsert;
+
+/**
+ * @author asmirnov
+ *
+ */
+public abstract class AbstractInsertRenderer extends HeaderResourcesRendererBase {
+
+ private static final Object ERROR_MESSAGE_CLASS = "dr-insert-error";
+
+ public void renderContent(FacesContext context, UIInsert component)
+ throws IOException {
+ if (null != component.getSrc()) {
+ ExternalContext externalContext = context.getExternalContext();
+ InputStream inputStream = externalContext
+ .getResourceAsStream(component.getSrc());
+ if (null != inputStream) {
+ renderStream(context, component, inputStream);
+ } else {
+ String errorContent = component.getErrorContent();
+ if( null != errorContent && null != (inputStream = externalContext.getResourceAsStream(errorContent))){
+ // Render default content, if src not found.
+ renderStream(context, component, inputStream);
+ } else {
+ // Render error message for a not found resource.
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, ERROR_MESSAGE_CLASS, null);
+ writer.write(Messages.getMessage("UI_INSERT_RESOURCE_NOT_FOUND", new Object[]{component.getClientId(context),component.getSrc()}));
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+ }
+ } else {
+ throw new FacesException(
+ "Attribute 'scr' for a component <rich:insert > "
+ + component.getClientId(context) + " must be set");
+ }
+
+ }
+
+ /**
+ * @param context
+ * @param component
+ * @param inputStream
+ * @throws UnsupportedEncodingException
+ * @throws FacesException
+ * @throws IOException
+ */
+ private void renderStream(FacesContext context, UIInsert component,
+ InputStream inputStream) throws UnsupportedEncodingException,
+ FacesException, IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ String encoding = component.getEncoding();
+ if (null == component.getHighlight()) {
+ InputStreamReader in;
+ if (null != encoding) {
+ in = new InputStreamReader(inputStream, encoding);
+ } else {
+ in = new InputStreamReader(inputStream);
+ }
+ char[] temp = new char[1024];
+ try {
+ int bytes;
+ while ((bytes = in.read(temp)) > 0) {
+ writer.write(temp, 0, bytes);
+ }
+ } catch (IOException e) {
+ throw new FacesException(e);
+ } finally {
+ in.close();
+ }
+ } else {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ try {
+ Highlight highlighter = new Highlight(component
+ .getHighlight());
+ highlighter.highlight(component.getSrc(), inputStream,
+ out, encoding, true);
+ } catch (IOException e) {
+ throw new FacesException(e);
+ } finally {
+ inputStream.close();
+ }
+ if (null != encoding) {
+ writer.write(out.toString(encoding));
+ } else {
+ writer.write(out.toString());
+ }
+ }
+ }
+
+}
Property changes on: trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
===================================================================
--- trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java 2007-08-21 19:37:43 UTC (rev 2384)
+++ trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java 2007-08-21 20:53:37 UTC (rev 2385)
@@ -22,63 +22,7 @@
private static final String COMPONENT_FAMILY = "org.richfaces.ui.Insert";
- public String getContent() {
- String content = null;
- if (null != getSrc()) {
- InputStream inputStream = getFacesContext().getExternalContext()
- .getResourceAsStream(getSrc());
- if (null != inputStream) {
- if (null == getHighlight()) {
- StringBuffer buff = new StringBuffer(1024);
- InputStreamReader in = new InputStreamReader(inputStream);
- char[] temp = new char[1024];
- try {
- int bytes;
- while ((bytes = in.read(temp)) > 0) {
- buff.append(temp, 0, bytes);
- }
- ;
- } catch (IOException e) {
- throw new FacesException(e);
- } finally {
- try {
- in.close();
- } catch (IOException e) {
- throw new FacesException(e);
- }
- }
- content = buff.toString();
- } else {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- try {
- Highlight highlighter = new Highlight(getHighlight());
- highlighter.highlight(getSrc(), inputStream, out, null,
- true);
- } catch (IOException e) {
- throw new FacesException(e);
- } finally {
- try {
- inputStream.close();
- } catch (IOException e) {
- throw new FacesException(e);
- }
- }
- content = out.toString();
- }
- } else {
- throw new FacesException("Resource '" + getSrc()
- + "' for a component <rich:insert > "
- + getClientId(getFacesContext()) + " not found");
- }
- } else {
- throw new FacesException(
- "Attribute 'scr' for a component <rich:insert > "
- + getClientId(getFacesContext()) + " must be set");
- }
- return content;
- }
-
public abstract String getSrc();
public abstract void setSrc(String src);
@@ -86,5 +30,12 @@
public abstract String getHighlight();
public abstract void setHighlight(String highlight);
+
+ public abstract String getErrorContent();
+
+ public abstract void setErrorContent(String src);
+ public abstract String getEncoding();
+
+ public abstract void setEncoding(String encoding);
}
Modified: trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css
===================================================================
--- trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css 2007-08-21 19:37:43 UTC (rev 2384)
+++ trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css 2007-08-21 20:53:37 UTC (rev 2385)
@@ -132,4 +132,9 @@
.cpp_preproc {
color: purple;
+}
+
+.dr-insert-error {
+ color: red;
+ font-weight: bold;
}
\ No newline at end of file
Modified: trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx
===================================================================
--- trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx 2007-08-21 19:37:43 UTC (rev 2384)
+++ trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx 2007-08-21 20:53:37 UTC (rev 2385)
@@ -6,7 +6,7 @@
xmlns:u=" http://ajax4jsf.org/cdk/u"
xmlns:x=" http://ajax4jsf.org/cdk/x"
class="org.richfaces.ui.renderkit.html.InsertRenderer"
- baseclass="org.ajax4jsf.renderkit.AjaxComponentRendererBase"
+ baseclass="org.ajax4jsf.renderkit.AbstractInsertRenderer"
component="org.richfaces.ui.component.UIInsert"
>
<h:styles>css/highlight.css</h:styles>
@@ -14,8 +14,6 @@
<div id="#{clientId}"
x:passThruWithExclusions="value,name,type,id"
>
- <jsp:scriptlet>
- writer.write(component.getContent());
- </jsp:scriptlet>
+ <f:call name="renderContent"/>
</div>
</f:root>
\ No newline at end of file
18 years, 8 months
JBoss Rich Faces SVN: r2384 - trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-08-21 15:37:43 -0400 (Tue, 21 Aug 2007)
New Revision: 2384
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaData.java
Log:
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaData.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaData.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaData.java 2007-08-21 19:37:43 UTC (rev 2384)
@@ -0,0 +1,39 @@
+package org.richfaces.demo.media;
+
+import java.awt.Color;
+import java.io.Serializable;
+
+public class MediaData implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+ Integer Width=110;
+ Integer Height=50;
+ Color Background=new Color(0,0,0);
+ Color DrawColor=new Color(255,255,255);
+ public MediaData() {
+ }
+ public Color getBackground() {
+ return Background;
+ }
+ public void setBackground(Color background) {
+ Background = background;
+ }
+ public Color getDrawColor() {
+ return DrawColor;
+ }
+ public void setDrawColor(Color drawColor) {
+ DrawColor = drawColor;
+ }
+ public Integer getHeight() {
+ return Height;
+ }
+ public void setHeight(Integer height) {
+ Height = height;
+ }
+ public Integer getWidth() {
+ return Width;
+ }
+ public void setWidth(Integer width) {
+ Width = width;
+ }
+}
\ No newline at end of file
18 years, 8 months
JBoss Rich Faces SVN: r2383 - trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-08-21 14:40:21 -0400 (Tue, 21 Aug 2007)
New Revision: 2383
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
Log:
added scrollableTableDemo
Modified: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-08-21 17:59:45 UTC (rev 2382)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-08-21 18:40:21 UTC (rev 2383)
@@ -38,7 +38,7 @@
messages= richMisc, Messages, /images/ico_common.gif, /images/cn_Messages.gif, RichFacesComponentsLibrary.html#messages, jbossrichfaces/freezone/docs/tlddoc/rich/messages.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMessages.html, /richfaces/comingSoon.jsf
virtualEarth= richMisc, Virtual Earth, /images/ico_VirtualEarth.gif, /images/cn_VirtualEarth.gif, RichFacesComponentsLibrary.html#virtualEarth, jbossrichfaces/freezone/docs/tlddoc/rich/virtualEarth.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIVirtualEarth.html, /richfaces/comingSoon.jsf
insert= richMisc, Insert, /images/ico_common.gif, /images/cn_insert.gif, RichFacesComponentsLibrary.html#insert, jbossrichfaces/freezone/docs/tlddoc/rich/insert.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIInsert.html, /richfaces/insert.jsf
-scrollableDataTable= richDataIterators, Scrollable Data Table, /images/ico_common.gif, /images/cn_ScrollableDataTable.gif, RichFacesComponentsLibrary.html#scrollableDataTable, jbossrichfaces/freezone/docs/tlddoc/rich/scrollableDataTable, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIscrollableDataTable.html, /richfaces/comingSoon.jsf
+scrollableDataTable= richDataIterators, Scrollable Data Table, /images/ico_common.gif, /images/cn_ScrollableDataTable.gif, RichFacesComponentsLibrary.html#scrollableDataTable, jbossrichfaces/freezone/docs/tlddoc/rich/scrollableDataTable, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIscrollableDataTable.html, /richfaces/scrollableDataTable.jsf
ajaxattributes= ajaxSupport, Ajax Attributes, /images/ico_common.gif, /images/cn_ajaxAttributes.gif, ArchitectureOverview.html, jbossajax4jsf/freezone/docs/tlddoc/overview-summary.html, jbossajax4jsf/freezone/docs/apidoc/overview-summary.html, /richfaces/ajaxAttributes.jsf
actionparam= ajaxSupport, Action Parameter, /images/ico_common.gif, /images/cn_actionParameter.gif, RichFacesComponentsLibrary.html#actionparam, jbossajax4jsf/freezone/docs/tlddoc/a4j/actionparam.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIActionParameter.html, /richfaces/actionparam.jsf
commandButton= ajaxSupport, Command Button, /images/ico_common.gif, /images/cn_commandButton.gif, RichFacesComponentsLibrary.html#commandButton, jbossajax4jsf/freezone/docs/tlddoc/a4j/commandButton.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxCommandButton.html, /richfaces/commandButton.jsf
18 years, 8 months
JBoss Rich Faces SVN: r2382 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-08-21 13:59:45 -0400 (Tue, 21 Aug 2007)
New Revision: 2382
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/AUGWADParams.xml
trunk/docs/userguide/en/src/main/docbook/modules/RFCsetwebappl.xml
trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
Log:
http://jira.jboss.com/jira/browse/RF-622
http://jira.jboss.com/jira/browse/RF-621
Modified: trunk/docs/userguide/en/src/main/docbook/modules/AUGWADParams.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/AUGWADParams.xml 2007-08-21 17:00:51 UTC (rev 2381)
+++ trunk/docs/userguide/en/src/main/docbook/modules/AUGWADParams.xml 2007-08-21 17:59:45 UTC (rev 2382)
@@ -5,8 +5,8 @@
<title>Web Application Descriptor Parameters</title>
<para>RichFaces doesn't require any parameters to be defined in your
- web.xml. But the <property>Ajax4jsf</property> parameters listed below may
- help with development and may increase the flexibility of Ajax4jsf
+ web.xml. But the <property>RichFaces</property> parameters listed below may
+ help with development and may increase the flexibility of RichFaces
usage.</para>
<para><table>
@@ -24,7 +24,22 @@
</thead>
<tbody>
+
<row>
+ <entry>org.richfaces.SKIN</entry>
+
+ <entry>DEFAULT</entry>
+
+ <entry>Is a name of a skin used in an application. It can be a
+ literal string with a skin name, or the <emphasis
+ ><property>EL</property></emphasis> expression
+ (#{...}) pointed to a <emphasis
+ ><property>String</property></emphasis> property
+ (skin name) or a property of a org.richfaces.framework.skin type.
+ Skin in last case, this instance is used as a current skin</entry>
+ </row>
+
+ <row>
<entry>org.ajax4jsf.LOGFILE</entry>
<entry>none</entry>
@@ -46,7 +61,7 @@
<entry>Is a comma-separated list of custom <emphasis
><property>ViewHandler</property></emphasis>
instances for inserting in chain. Handlers are inserted BEFORE
- Ajax4jsf viewhandlers in the given order. For example, in facelets
+ RichFaces viewhandlers in the given order. For example, in facelets
application this parameter must contain
com.sun.facelets.FaceletViewHandler, instead of declaration in
faces-config.xml</entry>
@@ -93,22 +108,9 @@
</row>
<row>
- <entry>org.ajax4jsf.SKIN</entry>
-
- <entry>DEFAULT</entry>
-
- <entry>Is a name of a skin used in an application. It can be a
- literal string with a skin name, or the <emphasis
- ><property>EL</property></emphasis> expression
- (#{...}) pointed to a <emphasis
- ><property>String</property></emphasis> property
- (skin name) or a property of a org.ajax4jsf.framework.skin type.
- Skin in last case, this instance is used as a current skin</entry>
- </row>
- <row>
- <entry>org.ajax4jsf.COMPRESS_SCRIPT</entry>
+ <entry>org.ajax4jsf.COMPRESS_SCRIPT</entry>
<entry>true</entry>
- <entry>This parameter could be used to increase the flexibility of Ajax4jsf usage. It doesn't allow A4J to reformat JavaScript files (makes it impossible to debug)
+ <entry>It doesn't allow framework to reformat JavaScript files (makes it impossible to debug)
</entry>
</row>
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCsetwebappl.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCsetwebappl.xml 2007-08-21 17:00:51 UTC (rev 2381)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCsetwebappl.xml 2007-08-21 17:59:45 UTC (rev 2382)
@@ -7,22 +7,22 @@
<keyword>JSF</keyword>
- <keyword>Ajax4jsf</keyword>
- <keyword>AjaxViewHandler</keyword>
+ <keyword>RichFaces</keyword>
+
</keywordset>
</chapterinfo>
<title>Settings for different environments</title>
- <para>Ajax4jsf comes with support for all tags (components) included in the
- JavaServer Faces specification. To add Ajax4jsf capabilities to the existing
- JSF project you should just put the Ajax4jsf libraries into the lib folder of
+ <para>RichFaces comes with support for all tags (components) included in the
+ JavaServer Faces specification. To add RichFaces capabilities to the existing
+ JSF project you should just put the RichFaces libraries into the lib folder of
the project and add filter mapping. The behavior of the existing project
- doesn't change just because of Ajax4jsf.</para>
+ doesn't change just because of RichFaces.</para>
&wadParams;
<section id="SunJSFRI">
<?dbhtml filename="SunJSFRI.html"?>
<title>Sun JSF RI</title>
- <para>Ajax4jsf works with any implementation of <property>JSF</property> (both JSF 1.1 and
+ <para>RichFaces works with any implementation of <property>JSF</property> (both JSF 1.1 and
JSF 1.2) and with most <property>JSF</property> component libraries without any additional settings.
For more information look at:</para>
@@ -36,13 +36,13 @@
<section id="ApacheMyFaces">
<?dbhtml filename="ApacheMyFaces.html"?>
<title>Apache MyFaces</title>
- <para>Ajax4jsf works with all <property>Apache MyFaces</property> versions (1.1.1 - 1.1.5)
+ <para>RichFaces works with all <property>Apache MyFaces</property> versions (1.1.1 - 1.1.5)
including specific libraries like Tomahawk Sandbox and
Trinidad (the previous ADF Faces). However, there are some considerations
to take into account for configuring applications to work with <property>MyFaces</property> and
- Ajax4jsf.</para>
+ RichFaces.</para>
<para>There are some problems with different filters defined in
- the web.xml file clashing. To avoid these problems, the Ajax4jsf filter
+ the web.xml file clashing. To avoid these problems, the RichFaces filter
must be the first one among other filters in the web.xml configuration
file.</para>
<para>For more information look at:<ulink url="http://myfaces.apache.org">http://myfaces.apache.org</ulink></para>
@@ -63,11 +63,11 @@
<?dbhtml filename="FaceletsSupport.html"?>
<title>Facelets Support</title>
<para>A high-level support for <property>Facelets</property> is one of our main support
- features. When working with Ajax4jsf, there is no difference what release
+ features. When working with RichFaces, there is no difference what release
of <property>Facelets</property> is used. </para>
<para>You should also take into account that some JSF frameworks such as <property>Facelets</property> use their own
ViewHandler and need to have it first in the chain of ViewHandlers and the
- Ajax4jsf AjaxViewHandler is not an exception. At first Ajax4jsf installs its ViewHandler in any case, so in case of two frameworks, for example Ajax4jsf + Facelets, no changes in settings are required. Although, when more then one framework (except Ajax4jsf) is used, it's possible to use the VIEW_HANDLERS parameter defining these frameworks view handlers according to its usage order in it.
+ RichFaces AjaxViewHandler is not an exception. At first RichFaces installs its ViewHandler in any case, so in case of two frameworks, for example RichFaces + Facelets, no changes in settings are required. Although, when more then one framework (except RichFaces) is used, it's possible to use the VIEW_HANDLERS parameter defining these frameworks view handlers according to its usage order in it.
For example, the
declaration:</para>
@@ -90,8 +90,8 @@
<section id="JBossSeamSupport">
<?dbhtml filename="JBossSeamSupport.html"?>
<title>JBoss Seam Support</title>
- <para>Ajax4jsf 1.1 now works out-of-the-box with <property>JBoss Seam </property>and Facelets running inside JBoss AS 4.0.4 and higher.
- There is no more shared JAR files needed. You just have to package the Ajax4jsf library with your application.
+ <para>RichFaces now works out-of-the-box with <property>JBoss Seam </property>and Facelets running inside JBoss AS 4.0.4 and higher.
+ There is no more shared JAR files needed. You just have to package the RichFaces library with your application.
</para>
<para>
Your web.xml still must be like this:
@@ -106,14 +106,14 @@
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
- <!-- ajax4jsf -->
+ <!-- richfaces -->
<filter>
- <display-name>Ajax4jsf Filter</display-name>
- <filter-name>ajax4jsf</filter-name>
+ <display-name>RichFaces Filter</display-name>
+ <filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
- <filter-name>ajax4jsf</filter-name>
+ <filter-name>richfaces</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
@@ -169,7 +169,7 @@
<param-value>true</param-value>
</context-param>
<context-param>
- <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-name>org.richfaces.SKIN</param-name>
<param-value>DEFAULT</param-value>
</context-param>
@@ -194,7 +194,8 @@
</section>
<section id="Portlet Support">
<title>Portlet Support</title>
- <para><property>Portlets</property> have support since version Ajax4jsf 1.1.1. Provide your feedback on compatible with Ajax4jsf if you face some problems.</para>
+ <para><property>Portlets</property> have support since version Ajax4jsf 1.1.1. This support is improved in Richfaces 3.1.0.
+ Provide your feedback on compatible with RichFaces if you face some problems.</para>
</section>
<section id="Sybase EAServer">
<title>Sybase EAServer</title>
@@ -227,9 +228,9 @@
</section>
<section id="DownloadingAjax4jsf">
<?dbhtml filename="DownloadingAjax4jsf.html" ?>
- <title>Downloading Ajax4jsf</title>
- <para>The latest release of <property>Ajax4jsf</property> is available for download at:<simplelist><member><ulink url="http://labs.jboss.com/portal/jbossajax4jsf/downloads">http://labs.jboss.com/portal/jbossajax4jsf/downloads</ulink></member></simplelist>
- in the <property>Ajax4jsf</property> project area under JBoss.</para>
+ <title>Downloading RichFaces 3.1.0</title>
+ <para>The latest release of <property>RichFaces</property> is available for download at:<simplelist><member><ulink url="http://labs.jboss.com/jbossrichfaces/downloads">http://labs.jboss.com/jbossrichfaces/downloads</ulink></member></simplelist>
+ in the <property>RichFaces</property> project area under JBoss.</para>
</section>
<section id="Installation">
<?dbhtml filename="Installation.html" ?>
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2007-08-21 17:00:51 UTC (rev 2381)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2007-08-21 17:59:45 UTC (rev 2382)
@@ -10,7 +10,7 @@
<keyword>JavaServer Faces</keyword>
- <keyword>Ajax4jsf</keyword>
+ <keyword>RichFaces</keyword>
<keyword>JSF</keyword>
@@ -52,7 +52,7 @@
to be compatible with the widest possible variety of environments.</para>
<para>This is what you need to start working with
- <property>RichFaces 3.1</property>:</para>
+ <property>RichFaces 3.1.0</property>:</para>
<itemizedlist>
<listitem>Java</listitem>
@@ -63,7 +63,7 @@
<listitem>Browser (on client side)</listitem>
- <listitem>Ajax4jsf framework</listitem>
+ <listitem>Richfaces framework</listitem>
</itemizedlist>
<section id="SupportedJavaVersions">
18 years, 8 months
JBoss Rich Faces SVN: r2381 - in trunk: ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-08-21 13:00:51 -0400 (Tue, 21 Aug 2007)
New Revision: 2381
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
RF-645 fixed
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-08-21 16:27:39 UTC (rev 2380)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-08-21 17:00:51 UTC (rev 2381)
@@ -147,7 +147,7 @@
}
}
-Richfaces.browser={isIE6: /MSIE\s*[6][\d,\.]+;/.test(navigator.userAgent)};
+Richfaces.browser={isIE6: (!window.opera && /MSIE\s*[6][\d,\.]+;/.test(navigator.userAgent))};
Richfaces.eval = function(template, object) {
var value = '';
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-08-21 16:27:39 UTC (rev 2380)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-08-21 17:00:51 UTC (rev 2381)
@@ -14,16 +14,16 @@
// jointPoint: {x:,y:} or ('top-left','top-right','bottom'-left,'bottom-right')
// direction: ('top-left','top-right','bottom'-left,'bottom-right', 'auto')
// offset: {x:,y:}
-
+
var elementDim = Richfaces.Calendar.getOffsetDimensions(element);
-
var baseElementDim;
var baseOffset;
- if (baseElement.left)
+ if (baseElement.left!=undefined)
{
baseElementDim = {width: baseElement.width, height: baseElement.height};
baseOffset = [baseElement.left, baseElement.top];
+
} else
{
baseElementDim = Richfaces.Calendar.getOffsetDimensions(baseElement);
@@ -101,8 +101,15 @@
}
}
- }
+ }
+ if (element.offsetParent && element.offsetParent!=document.body)
+ {
+ var offset=Position.cumulativeOffset(element.offsetParent);
+ ox -= offset[0];
+ oy -= offset[1];
+ }
+
element.style.left = ox + 'px';
element.style.top = oy + 'px';
};
@@ -552,14 +559,22 @@
this.setPopupEvents(base);*/
//rect calculation
- var offsetBase = Position.cumulativeOffset(base);
+ var offsetBase1 = Position.cumulativeOffset(baseInput);
+ var offsetBase2 = Position.cumulativeOffset(baseButton);
+
+ var offsetBase = [offsetBase1[0]<offsetBase2[0] ? offsetBase1[0] : offsetBase2[0],
+ offsetBase1[1]<offsetBase2[1] ? offsetBase1[1] : offsetBase2[1]];
+
var offsetDimBase = Richfaces.Calendar.getOffsetDimensions(base);
var offsetDimButton = Richfaces.Calendar.getOffsetDimensions(baseButton);
var offsetDimInput = Richfaces.Calendar.getOffsetDimensions(baseInput);
- var o = {left: offsetBase[0], top: offsetBase[1],
- width: offsetDimBase.width, height: (offsetDimButton.height>offsetDimInput.height ? offsetDimButton.height : offsetDimInput.height)};
+ var o = {left: offsetBase[0],
+ top: offsetBase[1],
+ width: offsetDimBase.width,
+ height: (offsetDimButton.height>offsetDimInput.height ? offsetDimButton.height : offsetDimInput.height)};
Richfaces.Calendar.setElementPosition(e, o, this.params.jointPoint, this.params.direction);
+
if (Richfaces.browser.isIE6)
{
iframe.style.left = e.style.left;
18 years, 8 months
JBoss Rich Faces SVN: r2380 - trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-08-21 12:27:39 -0400 (Tue, 21 Aug 2007)
New Revision: 2380
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
Log:
added scrollableTableDemo
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2007-08-21 16:25:48 UTC (rev 2379)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2007-08-21 16:27:39 UTC (rev 2380)
@@ -4,6 +4,7 @@
package org.richfaces.datatablescroller;
import java.math.BigDecimal;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -20,12 +21,12 @@
private static int DECIMALS = 1;
private static int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;
- private List allCars = null;
+ private List <DemoInventoryItem> allCars = null;
- public List getAllCars() {
+ public List <DemoInventoryItem> getAllCars() {
synchronized (this) {
if (allCars == null) {
- allCars = new ArrayList();
+ allCars = new ArrayList<DemoInventoryItem>();
for (int k = 0; k <= 5; k++) {
try{
switch (k) {
@@ -55,6 +56,9 @@
case 5:
allCars.addAll(createCar("Infiniti","G35", 6));
break;
+ /*case 6:
+ allCars.addAll(createCar("UAZ","469", 6));
+ break;*/
default:
break;
}
@@ -73,9 +77,9 @@
return rand(1,10000);
}
- public List createCar(String make, String model, int count){
+ public List <DemoInventoryItem> createCar(String make, String model, int count){
- ArrayList iiList = null;
+ ArrayList <DemoInventoryItem> iiList = null;
try{
int arrayCount = count;
@@ -104,7 +108,7 @@
}
- iiList = new ArrayList(Arrays.asList(demoInventoryItemArrays));
+ iiList = new ArrayList<DemoInventoryItem>(Arrays.asList(demoInventoryItemArrays));
}catch(Exception e){
System.out.println("!!!!!!createCategory Error: " + e.getMessage());
@@ -131,6 +135,6 @@
byte b[] = new byte[n];
for (int i = 0; i < n; i++)
b[i] = (byte)rand('A', 'Z');
- return new String(b, 0);
+ return new String(b,Charset.defaultCharset());
}
}
18 years, 8 months
JBoss Rich Faces SVN: r2379 - in trunk: samples/richfaces-demo/src/main/webapp/richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-08-21 12:25:48 -0400 (Tue, 21 Aug 2007)
New Revision: 2379
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/examples/scrollableDataTable.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/usage.xhtml
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/impl/PropertyResolverComparator.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconBasic.java
Log:
added scrollableTableDemo
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/impl/PropertyResolverComparator.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/impl/PropertyResolverComparator.java 2007-08-21 13:39:36 UTC (rev 2378)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/impl/PropertyResolverComparator.java 2007-08-21 16:25:48 UTC (rev 2379)
@@ -28,7 +28,9 @@
*
*/
public class PropertyResolverComparator implements Comparator {
-
+
+ private static SortField [] EMPTY = {};
+
private PropertyResolver resolver;
private SortOrder sortOrder;
@@ -40,48 +42,38 @@
this.sortOrder = sortOrder;
}
- public int compare(Object arg0, Object arg1) {
+ public int compare(Object o1, Object o2) {
int result = 0;
- /*Object prop1 = null;
- SortField [ sortOrder.getFields();
- while (result == 0 && )
+ SortField [] fields = sortOrder == null ? EMPTY : sortOrder.getFields();
- try {
- prop1 = resolver.getValue(arg0, sortOrder.getSortColumn());
- } catch (EvaluationException e) {
- //prop1 remains null
- }
-
- Object prop2 = null;
-
- try {
- prop2 = resolver.getValue(arg1, sortOrder.getSortColumn());
- } catch (EvaluationException e) {
- //prop1 remains null
- }
-
- if (prop1 == null) {
- if (prop2 == null) {
- result = 0;
- } else {
- result = -1;
- }
- } else {
- if (prop2 == null) {
- result = 1;
- } else {
- if (prop1 instanceof Comparable && prop2 instanceof Comparable) {
- result = ((Comparable) prop1).compareTo(prop2);
- } else {
- result = prop1.toString().compareTo(prop2.toString());
+ for(int i = 0; i < fields.length && result == 0; i++) {
+ SortField field = fields[i];
+ String name = field.getName();
+ Boolean asc = field.getAscending();
+
+ if (name != null && asc != null) {
+ Object property1 = null;
+ Object property2 = null;
+
+ property1 = resolver.getValue(o1, name);
+
+ property2 = resolver.getValue(o2, name);
+
+ if (property1 instanceof Comparable && property2 instanceof Comparable) {
+ result = ((Comparable) property1).compareTo(property2);
}
+ if (!asc.booleanValue()) {
+ result = -result;
+ }
+
+
}
+
}
- if (!sortOrder.isAscending()) {
- result = -result;
- }*/
+
+
return result;
}
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/examples/scrollableDataTable.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/examples/scrollableDataTable.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/examples/scrollableDataTable.xhtml 2007-08-21 16:25:48 UTC (rev 2379)
@@ -0,0 +1,58 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <style>
+ </style>
+
+ <h:form>
+ <rich:spacer height="30" />
+ <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="400px" width="700px" id="carList" rows="40" columnClasses="col"
+ value="#{dataTableScrollerBean.allCars}" var="category" sortMode="multi">
+
+ <rich:column id="make" sortable="true">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Make" />
+ </f:facet>
+ <h:outputText value="#{category.make}" />
+ </rich:column>
+ <rich:column id="model" sortable="true">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Model" />
+ </f:facet>
+ <h:outputText value="#{category.model}" />
+ </rich:column>
+ <rich:column id="price" sortable="true">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Price" />
+ </f:facet>
+ <h:outputText value="#{category.price}" />
+ </rich:column>
+ <rich:column id="mileage" sortable="true">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Mileage" />
+ </f:facet>
+ <h:outputText value="#{category.mileage}" />
+ </rich:column>
+ <rich:column width="200px" id="vin" sortable="true">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="VIN" />
+ </f:facet>
+ <h:outputText value="#{category.vin}" />
+ </rich:column>
+ <rich:column id="stock" sortable="true">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Stock" />
+ </f:facet>
+ <h:outputText value="#{category.stock}" />
+ </rich:column>
+
+
+
+ </rich:scrollableDataTable>
+ </h:form>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/usage.xhtml 2007-08-21 16:25:48 UTC (rev 2379)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+
+ <p>Scrollable Data Table</p>
+
+ <div class="sample-container">
+ <ui:include src="/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml"/>
+ <ui:param name="openlabel" value="View Page Source" />
+ </ui:include>
+ </div>
+ </ui:define>
+</ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable.xhtml 2007-08-21 16:25:48 UTC (rev 2379)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components - Scrollable Data Table</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tab label="Usage">
+ <ui:include src="/richfaces/scrollableDataTable/usage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconBasic.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconBasic.java 2007-08-21 13:39:36 UTC (rev 2378)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconBasic.java 2007-08-21 16:25:48 UTC (rev 2379)
@@ -16,20 +16,21 @@
public abstract class ScrollableDataTableIconBasic extends Java2Dresource {
- static final Dimension dimension = new Dimension(16, 16);
-
public ScrollableDataTableIconBasic() {
setRenderer(new GifRenderer());
setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
}
public Dimension getDimensions(FacesContext facesContext, Object data) {
- return dimension;
+ return calculateDimensions();
}
protected Dimension getDimensions(ResourceContext resourceContext) {
- return dimension;
+ return calculateDimensions();
}
+ public abstract Dimension calculateDimensions();
+
+
protected Object getDataToStore(FacesContext context, Object data) {
Skin skin = SkinFactory.getInstance().getSkin(context);
Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
18 years, 8 months
JBoss Rich Faces SVN: r2378 - in trunk/ui/scrollableDataTable/src/main: java/org/richfaces/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-08-21 09:39:36 -0400 (Tue, 21 Aug 2007)
New Revision: 2378
Modified:
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
Log:
RF-644
Modified: trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
--- trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2007-08-21 13:35:33 UTC (rev 2377)
+++ trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2007-08-21 13:39:36 UTC (rev 2378)
@@ -121,6 +121,27 @@
<classname>boolean</classname>
<defaultvalue>false</defaultvalue>
</property>
+
+ <property>
+ <name>onRowClick</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>onRowMouseDown</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>onRowMouseUp</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>onRowDblClick</name>
+ <classname>java.lang.String</classname>
+ </property>
+
&ui_component_attributes;
</component>
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2007-08-21 13:35:33 UTC (rev 2377)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2007-08-21 13:39:36 UTC (rev 2378)
@@ -278,7 +278,7 @@
state.setFrozenColumnCount(ScrollableDataTableUtils.getFrozenColumnsCount(grid));
getUtils().writeAttribute(writer, "id",row_id);
getUtils().writeAttribute(writer, "class","dr-sdt-rb rich-sdt-row" + state.getRowClass(index));
-
+ addRowJavascriptEvents(writer, grid);
if (log.isDebugEnabled()) {
log.debug("rowIndex : " + index);
}
@@ -339,6 +339,7 @@
writer.startElement("tr", grid);
getUtils().writeAttribute(writer, "class","dr-sdt-rb rich-sdt-row" + state.getRowClass(state.getRowIndex()));
getUtils().writeAttribute(writer,"id",row_id);
+ addRowJavascriptEvents(writer, grid);
collection.add(row_id);
}else if(!state.isFrozenColumn() && !normalTRRendered){
@@ -353,6 +354,7 @@
writer.startElement("tr", grid);
getUtils().writeAttribute(writer,"id",row_id);
getUtils().writeAttribute(writer, "class","dr-sdt-rb rich-sdt-row" + state.getRowClass(state.getRowIndex()));
+ addRowJavascriptEvents(writer, grid);
normalTRRendered = true;
collection.add(row_id);
@@ -802,4 +804,38 @@
}
}
+ private void addRowJavascriptEvents(ResponseWriter writer, UIComponent component) {
+ String attribute = (String)component.getAttributes().get("onRowClick");
+ if (attribute != null) {
+ try {
+ getUtils().writeAttribute(writer, "onclick", attribute);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ attribute = (String)component.getAttributes().get("onRowMouseDown");
+ if (attribute != null) {
+ try {
+ getUtils().writeAttribute(writer, "onmousedown", attribute);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ attribute = (String)component.getAttributes().get("onRowMouseUp");
+ if (attribute != null) {
+ try {
+ getUtils().writeAttribute(writer, "onmouseup", attribute);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ attribute = (String)component.getAttributes().get("onRowDblClick");
+ if (attribute != null) {
+ try {
+ getUtils().writeAttribute(writer, "ondblclick", attribute);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
}
18 years, 8 months