JBoss Rich Faces SVN: r1817 - trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-24 07:17:55 -0400 (Tue, 24 Jul 2007)
New Revision: 1817
Modified:
trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
Log:
Modified: trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-24 11:17:31 UTC (rev 1816)
+++ trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-24 11:17:55 UTC (rev 1817)
@@ -223,7 +223,7 @@
}
String events = "{event:\"" + event + "\",onshow:\"" + toolTip.getOnshow() +
"\",oncomplete:\"" + toolTip.getOncomplete() + "\",onhide:\"" + toolTip.getOnhide() +
- "\"}";
+ "\",delay:" + toolTip.getDelay() + ",jsVarName:\"" + getJsVarName(context, component) + "\"}";
//script.append("var tooltip1 = ").
script.append(getJsVarName(context, toolTip) + " = ").
17 years, 5 months
JBoss Rich Faces SVN: r1816 - trunk/ui/tooltip/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-24 07:17:31 -0400 (Tue, 24 Jul 2007)
New Revision: 1816
Modified:
trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
Log:
Modified: trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
===================================================================
--- trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java 2007-07-24 11:14:32 UTC (rev 1815)
+++ trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java 2007-07-24 11:17:31 UTC (rev 1816)
@@ -93,6 +93,11 @@
public abstract void setOnmouseover(String onmouseover);
+ public abstract int getDelay();
+
+ public abstract void setDelay(int delay);
+
+
public String getUsedElementType(){
return getLayout().equals("block") ? "div" : "span";
}
17 years, 5 months
JBoss Rich Faces SVN: r1815 - trunk/ui/tooltip/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-24 07:14:32 -0400 (Tue, 24 Jul 2007)
New Revision: 1815
Modified:
trunk/ui/tooltip/src/main/config/component/toolTip.xml
Log:
Modified: trunk/ui/tooltip/src/main/config/component/toolTip.xml
===================================================================
--- trunk/ui/tooltip/src/main/config/component/toolTip.xml 2007-07-24 00:52:42 UTC (rev 1814)
+++ trunk/ui/tooltip/src/main/config/component/toolTip.xml 2007-07-24 11:14:32 UTC (rev 1815)
@@ -41,8 +41,13 @@
<description>Allowed values: "inline" or "block". Block/inline mode flag. Tooltip will contain div/span elements accordingly.</description>
<defaultvalue><![CDATA["inline"]]></defaultvalue>
</property>
-
<property>
+ <name>delay</name>
+ <classname>int</classname>
+ <description>Delay in milliseconds before tooltip will be displayed.</description>
+ <defaultvalue><![CDATA[0]]></defaultvalue>
+ </property>
+ <property>
<name>oncomplete</name>
<classname>java.lang.String</classname>
<description></description>
@@ -91,7 +96,7 @@
<name>direction</name>
<classname>java.lang.String</classname>
<description>Defines direction of the popup list to appear (top-right, top-left bottom-right, bottom-left, auto(default))</description>
- <defaultvalue><![CDATA["bottom-right"]]></defaultvalue>
+ <defaultvalue><![CDATA["top-right"]]></defaultvalue>
</property>
<property>
<name>followmouse</name>
17 years, 5 months
JBoss Rich Faces SVN: r1814 - in trunk/samples/richfaces-demo/src/main: resources/org/richfaces/demo/common and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-07-23 20:52:42 -0400 (Mon, 23 Jul 2007)
New Revision: 1814
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.html
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxsupport/UserBean.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/templates/include/dynamic-css.xhtml
Log:
added: ajax attributes
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxsupport/UserBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxsupport/UserBean.java 2007-07-24 00:40:36 UTC (rev 1813)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxsupport/UserBean.java 2007-07-24 00:52:42 UTC (rev 1814)
@@ -29,11 +29,13 @@
this.screenHeight = screenHeight;
}
- public void nameItJohn() {
+ public String nameItJohn() {
setName("Jonh");
+ return null;
}
- public void nameItMark() {
+ public String nameItMark() {
setName("Mark");
+ return null;
}
public String getJob() {
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-07-24 00:40:36 UTC (rev 1813)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-07-24 00:52:42 UTC (rev 1814)
@@ -33,6 +33,7 @@
menuGroup= richMenu, Menu Group, /images/ico_dropDownMenu.gif, /images/cn_DropDownMenu.gif, http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., /richfaces/dropDownMenu.jsf
menuItem= richMenu, Menu Item, /images/ico_dropDownMenu.gif, /images/cn_DropDownMenu.gif, http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., /richfaces/dropDownMenu.jsf
menuSeparator= richMenu, Menu Separator, /images/ico_dropDownMenu.gif, /images/cn_DropDownMenu.gif, http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., /richfaces/dropDownMenu.jsf
+ajaxattributes= ajaxSupport, Ajax Attributes, /images/ico_ajaxAttributes.gif, /images/cn_ajaxAttributes.gif, http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., /richfaces/ajaxAttributes.jsf
actionparam= ajaxSupport, Action Parameter, /images/ico_actionparam.gif, /images/cn_actionparam.gif, http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., /richfaces/actionparam.jsf
commandButton= ajaxSupport, Command Button, /images/ico_commandButton.gif, /images/cn_commandButton.gif, http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., /richfaces/commandButton.jsf
commandLink= ajaxSupport, Command Link, /images/ico_panel.gif, /images/cn_panel.gif, http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..., /richfaces/panel.jsf
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.html
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.html (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.html 2007-07-24 00:52:42 UTC (rev 1814)
@@ -0,0 +1 @@
+TODO: source should be added
\ No newline at end of file
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.xhtml 2007-07-24 00:52:42 UTC (rev 1814)
@@ -0,0 +1 @@
+x
\ No newline at end of file
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/source/usage.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml 2007-07-24 00:52:42 UTC (rev 1814)
@@ -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.ajax4jsf.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components - Ajax Attributes</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tab label="Usage">
+ <ui:include src="/richfaces/ajaxAttributes/usage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/usage.xhtml 2007-07-24 00:40:36 UTC (rev 1813)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/usage.xhtml 2007-07-24 00:52:42 UTC (rev 1814)
@@ -9,7 +9,7 @@
<ui:define name="sample">
<style>
- input[type="button"] {
+ input[type="button"], input[type="submit"] {
background-color:#{a4jSkin.trimColor};
}
</style>
@@ -33,15 +33,15 @@
....
<-- This code does not work correctly -->
<h:form>
- ....
- <a4j:commandButton value="Update Non-Ajax Link" reRender="panel" />
- ....
- <h:panelGrid id="panel">
- ....
- <h:commandLink value="Non-Ajax Submit" action="foo" />
- ....
- </h:panelGrid>
- ....
+ ....
+ <a4j:commandButton value="Update Non-Ajax Link" reRender="panel" />
+ ....
+ <h:panelGrid id="panel">
+ ....
+ <h:commandLink value="Non-Ajax Submit" action="foo" />
+ ....
+ </h:panelGrid>
+ ....
</h:form>
</pre>
</p>
@@ -80,6 +80,7 @@
<h:outputText id="name" value="Name:#{userBean.name}" />
</h:panelGrid>
</a4j:form>
+
</rich:panel>
</h:panelGrid>
Modified: trunk/samples/richfaces-demo/src/main/webapp/templates/include/dynamic-css.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/templates/include/dynamic-css.xhtml 2007-07-24 00:40:36 UTC (rev 1813)
+++ trunk/samples/richfaces-demo/src/main/webapp/templates/include/dynamic-css.xhtml 2007-07-24 00:52:42 UTC (rev 1814)
@@ -26,6 +26,13 @@
.inactive_tab {
background-image : url(${facesContext.externalContext.requestContextPath}/images/tabpanel_custom/tab_active_bg.gif);
}
+h1.hsample {
+ font-size:14px;
+}
+div.esample {
+ border:1px solid #CCCCCC;
+ padding:0px 8px 0px 8px;
+}
</style>
</ui:composition>
</html>
17 years, 5 months
JBoss Rich Faces SVN: r1813 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo/common and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ishabalov
Date: 2007-07-23 20:40:36 -0400 (Mon, 23 Jul 2007)
New Revision: 1813
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/RandomDataHelper.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/ToolTipData.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/Vehicle.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/use-with-data-table.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/usage.xhtml
Log:
Added tooltip on data table sample
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/RandomDataHelper.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/RandomDataHelper.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/RandomDataHelper.java 2007-07-24 00:40:36 UTC (rev 1813)
@@ -0,0 +1,26 @@
+package org.richfaces.demo.common;
+
+public class RandomDataHelper {
+ public static int random(int min, int max) {
+ assert(min<=max);
+ return min+(int)Math.round(Math.random()*(double)(max-min));
+ }
+ public static Object random(Object values[]) {
+ assert(values!=null);
+ return values[random(0,values.length-1)];
+ }
+ private static char randomChar() {
+ if (Math.random()>0.5) {
+ return (char)((int)'0'+random(0,9));
+ } else {
+ return (char)((int)'A'+random(0,25));
+ }
+ }
+ public static String randomString(int length) {
+ StringBuffer buf = new StringBuffer();
+ for (int counter=0;counter<length;counter++) {
+ buf.append(randomChar());
+ }
+ return buf.toString();
+ }
+}
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/ToolTipData.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/ToolTipData.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/ToolTipData.java 2007-07-24 00:40:36 UTC (rev 1813)
@@ -0,0 +1,42 @@
+package org.richfaces.demo.tooltip;
+
+import java.util.Date;
+import java.util.List;
+
+public class ToolTipData {
+ private int tooltipCounter = 0;
+ private List vehicles = null;
+ private int currentVehicleIndex = -1;
+ public int getTooltipCounter() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ return tooltipCounter++;
+ }
+ public Date getTooltipDate() {
+ return new Date();
+ }
+ public List getVehicles() {
+ if (vehicles==null) {
+ vehicles = Vehicle.allVehicles(100);
+ return vehicles;
+ } else {
+ return vehicles;
+ }
+ }
+ public Vehicle getCurrentVehicle() {
+ if (currentVehicleIndex>0 && currentVehicleIndex<getVehicles().size()) {
+ return (Vehicle) getVehicles().get(currentVehicleIndex);
+ } else {
+ return null;
+ }
+ }
+ public int getCurrentVehicleIndex() {
+ return currentVehicleIndex;
+ }
+ public void setCurrentVehicleIndex(int currentVehicleIndex) {
+ this.currentVehicleIndex = currentVehicleIndex;
+ }
+
+}
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/Vehicle.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/Vehicle.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tooltip/Vehicle.java 2007-07-24 00:40:36 UTC (rev 1813)
@@ -0,0 +1,112 @@
+package org.richfaces.demo.tooltip;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.richfaces.demo.common.RandomDataHelper;
+
+
+
+public class Vehicle {
+ public String make;
+ public String model;
+ public Integer year;
+ public Integer milage;
+ public String vin;
+ public Integer zip;
+ public Date listed;
+ public Vehicle(String make, String model) {
+ this.make = make;
+ this.model = model;
+ this.listed = new Date();
+ }
+
+ public static Vehicle list[] = {
+ new Vehicle("Ford", "Taurus"),
+ new Vehicle("Ford", "Mustang"),
+ new Vehicle("Ford", "Focus"),
+ new Vehicle("Ford", "Thinderbird"),
+ new Vehicle("BMW", "Z3"),
+ new Vehicle("BMW", "323i"),
+ new Vehicle("BMW", "521"),
+ new Vehicle("BMW", "Mustang"),
+ new Vehicle("Audi", "A4"),
+ new Vehicle("Audi", "A6"),
+ new Vehicle("Toyota", "Camry"),
+ new Vehicle("Toyota", "Corolla"),
+ new Vehicle("Toyota", "Matrix"),
+ new Vehicle("Honda", "Accord"),
+ new Vehicle("Honda", "Civic")
+ };
+
+ public static List allVehicles(int size) {
+ List ret = new ArrayList();
+ for (int counter=0;counter<size;counter++) {
+ Vehicle car = (Vehicle)RandomDataHelper.random(list);
+ car.milage = new Integer(RandomDataHelper.random(10000, 100000));
+ car.vin = RandomDataHelper.randomString(32);
+ car.year = new Integer(RandomDataHelper.random(2000, 2005));
+ car.zip = new Integer(RandomDataHelper.random(94500,94600));
+ ret.add(car);
+ }
+ return ret;
+ }
+
+ public Date getListed() {
+ return listed;
+ }
+
+ public void setListed(Date listed) {
+ this.listed = listed;
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+
+ public Integer getMilage() {
+ return milage;
+ }
+
+ public void setMilage(Integer milage) {
+ this.milage = milage;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public String getVin() {
+ return vin;
+ }
+
+ public void setVin(String vin) {
+ this.vin = vin;
+ }
+
+ public Integer getYear() {
+ return year;
+ }
+
+ public void setYear(Integer year) {
+ this.year = year;
+ }
+
+ public Integer getZip() {
+ return zip;
+ }
+
+ public void setZip(Integer zip) {
+ this.zip = zip;
+ }
+
+}
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-07-23 19:09:09 UTC (rev 1812)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-07-24 00:40:36 UTC (rev 1813)
@@ -169,4 +169,9 @@
<value>#{dndBean}</value>
</managed-property>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>toolTipData</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.tooltip.ToolTipData</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/usage.xhtml 2007-07-23 19:09:09 UTC (rev 1812)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/usage.xhtml 2007-07-24 00:40:36 UTC (rev 1813)
@@ -8,54 +8,62 @@
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
<style>
- .barsearch {
- height:14px;
- width:100px;
- }
- .barsearchbutton {
- border-width:1px;
- background-color:#{a4jSkin.generalBackgroundColor};
- }
.tooltip {
background-color:#{a4jSkin.generalBackgroundColor};
border-width:3px;
padding:10px;
}
+ .tooltipData {
+ font-weight: bold;
+ }
</style>
<p>
ToolTip is a little non-modal popup that may be used to display additional infrmation, that normally hidden.
- Rich ToolTip can request it's content from server in separate Ajax request, or it can use pre-rendered content from page.
+
+ Major toolTip features:
+ (1) ToolTip content may be tether pre-rendered to the page, or requested from server in separate Ajax request
+ (2)
</p>
- <h:form>
<div class="sample-container" >
<h:outputText id="tt1" value="Here you can see default client-side tooltip" >
- <rich:toolTip>
- <p>
- This tooltip content was <strong>pre-rendered</strong> to the page.
- </p>
+ <rich:toolTip direction="top-right">
+ <span>
+ This tooltip content was <strong>pre-rendered</strong> to the page.<br/>
+ The look of this tooltip is 100% defined by skin.
+ </span>
</rich:toolTip>
</h:outputText>
</div>
<div class="sample-container" >
<h:outputText id="tt2" value="This tooltip will follow mouse" >
- <rich:toolTip id="tt11" followMouse="true" direction="bottom-left" delay="10000" onshow="alert('onshow');" onactivate="alert('onactivate');" ondeactivate="alert('deactivate');" styleClass="tooltip" style="width:200px" disabled="false" horizontalOffset="50" verticalOffset="50">
+ <rich:toolTip followMouse="true" direction="top-right" delay="1000" styleClass="tooltip" style="width:250px">
<span>
- This tooltip content was <strong>pre-rendered</strong> to the page.
+ This tooltip content also <strong>pre-rendered</strong> to the page.
+ The look of this tooltip defined by styleClass attribute.
</span>
</rich:toolTip>
</h:outputText>
</div>
<div class="sample-container">
- <h:outputText value="Tooltip with followMouse mode" id="tt3">
- <rich:toolTip id="tt4" followMouse="true" direction="top-left" mode="ajax" horizontalOffset="20" verticalOffset="20">
+ <h:form>
+ <h:outputText value="This tooltip rendered on server in separate request" id="tt3">
+ <rich:toolTip direction="top-right" mode="ajax" verticalOffset="5" zorder="200" styleClass="tooltip">
<f:facet name="defaultContent">
- <h:outputText value="Some text will be here soon" />
+ <strong>Wait...</strong>
</f:facet>
- <h:outputText value="Final content" />
+ <span>This tooltip content was <strong>rendered</strong> on server </span>
+ <h:panelGrid columns="2">
+ <h:outputText value="tooltips requested:" />
+ <h:outputText value="#{toolTipData.tooltipCounter}" styleClass="tooltipData" />
+ <h:outputText value="last request:" />
+ <h:outputText value="#{toolTipData.tooltipDate}" styleClass="tooltipData" >
+ <f:convertDateTime pattern="mm:ss.SSS"/>
+ </h:outputText>
+ </h:panelGrid>
</rich:toolTip>
</h:outputText>
+ </h:form>
</div>
- </h:form>
</ui:define>
<ui:define name="sources">
<p>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/use-with-data-table.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/use-with-data-table.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/use-with-data-table.xhtml 2007-07-24 00:40:36 UTC (rev 1813)
@@ -0,0 +1,103 @@
+<!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/ajax"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+ <style>
+ .tooltip {
+ background-color:#{a4jSkin.generalBackgroundColor};
+ border-width:3px;
+ padding:10px;
+ }
+ .tooltipData {
+ font-weight: bold;
+ }
+ </style>
+ <p>
+ This little example show how ToolTip may be used in DataTable
+ </p>
+ <div class="sample-container">
+ <h:form>
+ <h:outputText value="This tooltip rendered on server in separate request" id="tt3">
+ <rich:toolTip direction="top-right" mode="ajax" verticalOffset="5" zorder="200" styleClass="tooltip">
+ <f:facet name="defaultContent">
+ <strong>Wait...</strong>
+ </f:facet>
+ <span>This tooltip content was <strong>rendered</strong> on server </span>
+ <h:panelGrid columns="2">
+ <h:outputText value="tooltips requested:" />
+ <h:outputText value="#{toolTipData.tooltipCounter}" styleClass="tooltipData" />
+ <h:outputText value="last request:" />
+ <h:outputText value="#{toolTipData.tooltipDate}" styleClass="tooltipData" >
+ <f:convertDateTime pattern="mm:ss.SSS"/>
+ </h:outputText>
+ </h:panelGrid>
+ </rich:toolTip>
+ </h:outputText>
+ <rich:dataTable value="#{toolTipData.vehicles}" var="vehicle" rowKeyVar="row">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="##"/>
+ </f:facet>
+ <h:outputText value="#{row+1}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Make"/>
+ </f:facet>
+ <h:outputText id="make" value="#{vehicle.make}" >
+ <rich:toolTip direction="top-right" mode="ajax" styleClass="tooltip">
+ <a4j:actionparam name="key" value="#{row}" assignTo="#{toolTipData.currentVehicleIndex}" />
+ <f:facet name="defaultContent">
+ <strong>Wait...</strong>
+ </f:facet>
+ <span>Vehicle details:</span>
+ <h:panelGrid columns="2">
+ <h:outputText value="make:" />
+ <h:outputText value="#{vehicle.make}" styleClass="tooltipData" />
+ <h:outputText value="model:" />
+ <h:outputText value="#{vehicle.model}" styleClass="tooltipData" />
+ <h:outputText value="year:" />
+ <h:outputText value="#{vehicle.year}" styleClass="tooltipData" />
+ <h:outputText value="milage:" />
+ <h:outputText value="#{vehicle.milage}" styleClass="tooltipData" />
+ <h:outputText value="zip:" />
+ <h:outputText value="#{vehicle.zip}" styleClass="tooltipData" />
+ <h:outputText value="vin:" />
+ <h:outputText value="#{vehicle.vin}" styleClass="tooltipData" />
+ <h:outputText value="listed:" />
+ <h:outputText value="#{vehicle.listed}" styleClass="tooltipData" >
+ <f:convertDateTime dateStyle="short"/>
+ </h:outputText>
+ </h:panelGrid>
+ </rich:toolTip>
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Model"/>
+ </f:facet>
+ <h:outputText value="#{vehicle.model}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Year"/>
+ </f:facet>
+ <h:outputText value="#{vehicle.year}" />
+ </rich:column>
+ </rich:dataTable>
+ </h:form>
+ </div>
+ </ui:define>
+ <ui:define name="sources">
+ <p>
+ Here is fragment of page sources for given example:
+ </p>
+ <iframe src="${facesContext.externalContext.requestContextPath}/richfaces/toolBar/source/usage.html" class="source_frame"/>
+ </ui:define>
+ </ui:composition>
+</html>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml 2007-07-23 19:09:09 UTC (rev 1812)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml 2007-07-24 00:40:36 UTC (rev 1813)
@@ -13,6 +13,9 @@
<rich:tab label="Usage">
<ui:include src="/richfaces/toolTip/usage.xhtml"/>
</rich:tab>
+ <rich:tab label="Use ToolTip with DataTable">
+ <ui:include src="/richfaces/toolTip/use-with-data-table.xhtml"/>
+ </rich:tab>
</rich:tabPanel>
</ui:define>
</ui:composition>
17 years, 5 months
JBoss Rich Faces SVN: r1812 - trunk/sandbox/samples.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-23 15:09:09 -0400 (Mon, 23 Jul 2007)
New Revision: 1812
Modified:
trunk/sandbox/samples/pom.xml
Log:
added sg-demo
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-07-23 19:05:25 UTC (rev 1811)
+++ trunk/sandbox/samples/pom.xml 2007-07-23 19:09:09 UTC (rev 1812)
@@ -14,7 +14,7 @@
<modules>
<module>calendar-sample</module>
- <!--module>scrollable-grid-demo</module-->
+ <module>scrollable-grid-demo</module>
<module>panel2-sample</module>
<module>simpleTogglePanel2-sample</module>
<module>rich-message-demo </module>
17 years, 5 months
JBoss Rich Faces SVN: r1811 - trunk/sandbox/api/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-23 15:05:25 -0400 (Mon, 23 Jul 2007)
New Revision: 1811
Added:
trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java
Removed:
trunk/sandbox/api/src/main/java/org/richfaces/model/DataModelCache.java
Modified:
trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java
Log:
introduced framework/impl-parent and sandbox/impl modules
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/model/DataModelCache.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/DataModelCache.java 2007-07-23 19:04:43 UTC (rev 1810)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/DataModelCache.java 2007-07-23 19:05:25 UTC (rev 1811)
@@ -1,186 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.DataModelListener;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.Range;
-import org.ajax4jsf.model.SerializableDataModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Implementation stores last loaded data, so no additional requests to db will be performed
- * Acts as a proxy between the component and original data model
- * @author Maksim Kaszynski
- *
- */
-public class DataModelCache extends GridDataModel {
-
- private static Log log = LogFactory.getLog(DataModelCache.class);
-
- private static class DataRange {
- private int startRow;
- private int endRow;
- private SortOrder sortOrder;
- private List loadedData;
-
- public DataRange(int startRow, int endRow, SortOrder sortOrder,
- List loadedData) {
- super();
- this.startRow = startRow;
- this.endRow = endRow;
- this.sortOrder = sortOrder;
- this.loadedData = loadedData;
- }
-
- public boolean match(int s, int e, SortOrder sortOrder) {
- return s == startRow
- && e == endRow
- && sortOrdersMatch(sortOrder, this.sortOrder);
- }
-
- private boolean sortOrdersMatch(SortOrder sortOrder1, SortOrder sortOrder2) {
- boolean result = sortOrder1 == sortOrder2;
-
- if (sortOrder1 != null && sortOrder2 != null) {
- result = sortOrder1.equals(sortOrder2);
- }
-
- return result;
- }
-
- }
-
- private Map secondaryMapping = new HashMap();
-
- private DataRange dataRange;
-
- private GridDataModel gridDataModel;
-
- private int rowCount = Integer.MIN_VALUE;
-
- public DataModelCache(GridDataModel gridDataModel) {
- super();
- this.gridDataModel = gridDataModel;
-
- if (log.isTraceEnabled()) {
- log.trace("initializing with " + gridDataModel);
- }
- }
-
- public void addDataModelListener(DataModelListener listener) {
- gridDataModel.addDataModelListener(listener);
- }
-
- public DataModelListener[] getDataModelListeners() {
- return gridDataModel.getDataModelListeners();
- }
-
- public Object getObjectById(Object id) {
-
- if (log.isDebugEnabled()) {
- log.debug("Trying to get object by id" + id);
- }
- //First try to find data in inner cache
- //If not found - get it from original model
- Object cached = secondaryMapping.get(id);
-
- if (cached == null) {
-
- if (log.isDebugEnabled()) {
- log.debug("Cache miss " + id + " falling back to original model");
- }
-
- cached = gridDataModel.getObjectById(id);
- secondaryMapping.put(id, cached);
-
- }
-
- if (log.isDebugEnabled()) {
- log.debug("At last found element " + cached);
- }
-
- return cached;
- }
-
- public int getRowCount() {
- if (rowCount == Integer.MIN_VALUE) {
- rowCount = gridDataModel.getRowCount();
- }
- return rowCount;
- }
-
- public Object getRowData() {
- Object secondaryMapped = secondaryMapping.get(getRowKey());
-
- if (secondaryMapped == null) {
- secondaryMapped = super.getRowData();
- }
- return secondaryMapped;
- }
-
- public int getRowIndex() {
- return gridDataModel.getRowIndex();
- }
-
- public Object getRowKey() {
- return gridDataModel.getRowKey();
- }
-
- public SerializableDataModel getSerializableModel(Range range) {
- return gridDataModel.getSerializableModel(range);
- }
-
- public Object getWrappedData() {
- return gridDataModel.getWrappedData();
- }
-
- public boolean isRowAvailable() {
- return secondaryMapping.containsKey(getRowKey()) || super.isRowAvailable();
- }
-
- public List loadData(int startRow, int endRow, SortOrder sortOrder) {
- if (dataRange == null || !dataRange.match(startRow, endRow, sortOrder)) {
- List data = gridDataModel.loadData(startRow, endRow, sortOrder);
- dataRange = new DataRange(startRow, endRow, sortOrder, data);
- }
- return dataRange.loadedData;
- }
-
- public void removeDataModelListener(DataModelListener listener) {
- gridDataModel.removeDataModelListener(listener);
- }
-
- public void setRowIndex(int arg0) {
- gridDataModel.setRowIndex(arg0);
- }
-
- public void setRowKey(Object key) {
- gridDataModel.setRowKey(key);
- super.setRowKey(key);
- }
-
- public void setWrappedData(Object arg0) {
- gridDataModel.setWrappedData(arg0);
- }
-
- public Object getId(Object o) {
- return gridDataModel.getId(o);
- }
-
- public void walk(FacesContext context, DataVisitor visitor, Range range,
- Object argument) throws IOException {
- // TODO Auto-generated method stub
- super.walk(context, visitor, range, argument);
- }
-
-}
Added: trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/SortField.java 2007-07-23 19:05:25 UTC (rev 1811)
@@ -0,0 +1,89 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SortField implements Serializable{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private String name = null;
+ private int index = -1;
+ private Boolean ascending = null;
+
+
+
+ public SortField(String name, int index, Boolean ascending) {
+ super();
+ this.name = name;
+ this.index = index;
+ this.ascending = ascending;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public Boolean getAscending() {
+ return ascending;
+ }
+
+ public void setAscending(Boolean ascending) {
+ this.ascending = ascending;
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((ascending == null) ? 0 : ascending.hashCode());
+ result = prime * result + index;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final SortField other = (SortField) obj;
+ if (ascending == null) {
+ if (other.ascending != null)
+ return false;
+ } else if (!ascending.equals(other.ascending))
+ return false;
+ if (index != other.index)
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+
+
+}
Modified: trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java 2007-07-23 19:04:43 UTC (rev 1810)
+++ trunk/sandbox/api/src/main/java/org/richfaces/model/SortOrder.java 2007-07-23 19:05:25 UTC (rev 1811)
@@ -1,6 +1,7 @@
package org.richfaces.model;
import java.io.Serializable;
+import java.util.Arrays;
/**
*
* @author Maksim Kaszynski
@@ -9,66 +10,61 @@
*/
public class SortOrder implements Serializable {
+ private static int hashCode(Object[] array) {
+ final int prime = 31;
+ if (array == null)
+ return 0;
+ int result = 1;
+ for (int index = 0; index < array.length; index++) {
+ result = prime * result
+ + (array[index] == null ? 0 : array[index].hashCode());
+ }
+ return result;
+ }
+
private static final long serialVersionUID = 2423450561570551363L;
- private boolean ascending;
-
- private int sortColumn = -1;
+ private SortField [] fields;
+ public SortOrder() {
+
+ }
- public SortOrder( int sortColumn, boolean ascending) {
+ public SortOrder(SortField[] fields) {
super();
- this.sortColumn = sortColumn;
- this.ascending = ascending;
+ this.fields = fields;
}
- public SortOrder() {
- super();
- }
- public boolean isAscending() {
- return ascending;
- }
- public void setAscending(boolean ascending) {
- this.ascending = ascending;
+ public SortField[] getFields() {
+ return fields;
}
- public int getSortColumn() {
- return sortColumn;
+ public void setFields(SortField[] fields) {
+ this.fields = fields;
}
- public void setSortColumn(int sortColumn) {
- this.sortColumn = sortColumn;
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + SortOrder.hashCode(fields);
+ return result;
}
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "SortOrder: {field:" + sortColumn + ", ascending: " + ascending
- + "}";
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
public boolean equals(Object obj) {
-
- if (obj instanceof SortOrder) {
- SortOrder sortOrder = (SortOrder) obj;
- return sortColumn == sortOrder.sortColumn
- && ascending == sortOrder.ascending;
-
- }
- return super.equals(obj);
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final SortOrder other = (SortOrder) obj;
+ if (!Arrays.equals(fields, other.fields))
+ return false;
+ return true;
}
- public int hashCode() {
- int c = (new Integer(sortColumn)).hashCode();
- if (ascending) {
- c = -c;
- }
- return c;
- }
+
+
}
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1810 - in trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces: convert and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-23 15:04:43 -0400 (Mon, 23 Jul 2007)
New Revision: 1810
Added:
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/ClientSelectionConverterTest.java
Removed:
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/model/
Log:
introduced framework/impl-parent and sandbox/impl modules
Added: trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/ClientSelectionConverterTest.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/ClientSelectionConverterTest.java (rev 0)
+++ trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/ClientSelectionConverterTest.java 2007-07-23 19:04:43 UTC (rev 1810)
@@ -0,0 +1,68 @@
+/**
+ *
+ */
+package org.richfaces.convert.selection;
+
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.model.selection.ClientSelection;
+import org.richfaces.model.selection.SelectionRange;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ClientSelectionConverterTest extends AbstractAjax4JsfTestCase {
+
+ private Converter converter;
+
+ /**
+ * @param name
+ */
+ public ClientSelectionConverterTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ converter = application.createConverter(ClientSelection.class);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ converter = null;
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.convert.selection.ClientSelectionConverter#getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)}.
+ */
+ public void testGetAsObject() {
+ //fail("Not yet implemented"); // TODO
+ }
+
+ /**
+ * Test method for {@link org.richfaces.convert.selection.ClientSelectionConverter#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)}.
+ */
+ public void testGetAsString() {
+
+ ClientSelection clientSelection = new ClientSelection();
+ clientSelection.addRange(new SelectionRange(2,3));
+ clientSelection.addRange(new SelectionRange(5,22));
+
+ String value = converter.getAsString(facesContext, null, clientSelection);
+
+ assertNotNull(value);
+ assertTrue(value.length() > 0);
+ assertEquals("2,3;5,22;", value);
+
+
+ }
+
+}
17 years, 5 months
JBoss Rich Faces SVN: r1809 - in trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces: component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-23 15:02:50 -0400 (Mon, 23 Jul 2007)
New Revision: 1809
Added:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/convert/
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/convert/selection/
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/convert/selection/ClientSelectionConverter.java
Removed:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/Selectable.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/Sortable.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/scroll/
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEvent.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/
Log:
introduced framework/impl-parent and sandbox/impl modules
Deleted: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/Selectable.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/Selectable.java 2007-07-23 18:59:03 UTC (rev 1808)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/Selectable.java 2007-07-23 19:02:50 UTC (rev 1809)
@@ -1,15 +0,0 @@
-/**
- *
- */
-package org.richfaces.component;
-
-import org.richfaces.model.selection.Selection;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface Selectable {
- public Selection getSelection();
- public void setSelection (Selection selection);
-}
Deleted: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/Sortable.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/Sortable.java 2007-07-23 18:59:03 UTC (rev 1808)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/Sortable.java 2007-07-23 19:02:50 UTC (rev 1809)
@@ -1,23 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/component/Sortable.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.component;
-
-import org.richfaces.model.SortOrder;
-
-
-/**
- * @author Maksim Kaszynski
- * Base interface for sort capable components
- */
-public interface Sortable {
- public SortOrder getSortOrder();
- public void setSortOrder(SortOrder sortOrder);
-}
Added: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/convert/selection/ClientSelectionConverter.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/convert/selection/ClientSelectionConverter.java (rev 0)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/convert/selection/ClientSelectionConverter.java 2007-07-23 19:02:50 UTC (rev 1809)
@@ -0,0 +1,98 @@
+/**
+ *
+ */
+package org.richfaces.convert.selection;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.model.selection.ClientSelection;
+import org.richfaces.model.selection.SelectionRange;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ClientSelectionConverter implements Converter {
+
+ public static final String CONVERTER_ID =
+ ClientSelectionConverter.class.getName();
+
+ private static final Log log =
+ LogFactory.getLog(ClientSelectionConverter.class);
+
+ public Object getAsObject(FacesContext context, UIComponent component, String value) {
+ return getAsSelection(context, component, value == null ? "" : value);
+ }
+
+ public String getAsString(FacesContext context, UIComponent component, Object value) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Converting to string " + value);
+ }
+
+ StringBuffer buffer = new StringBuffer();
+ Iterator iterator = ((ClientSelection) value).getRanges().iterator();
+
+ while(iterator.hasNext()) {
+
+ SelectionRange selectionRange =
+ (SelectionRange) iterator.next();
+
+ buffer
+ .append(selectionRange.getStartIndex())
+ .append(",")
+ .append(selectionRange.getEndIndex())
+ .append(";");
+ }
+
+ return buffer.toString();
+ }
+
+ private ClientSelection getAsSelection(FacesContext context, UIComponent grid, String stringSelection) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("parsing " + stringSelection);
+ }
+
+ final ClientSelection clientSelection = new ClientSelection();
+
+ String [] selections = stringSelection.split(";");
+ int length = selections.length;
+ if (selections[length-1].length() == 1) {
+ clientSelection.setSelectionFlag(selections[length-1]);
+ length--;
+ }
+ for (int i = 0; i < length; i++) {
+
+ String range = selections[i];
+
+ if (range.length() != 0) {
+ String [] rng = range.split(",");
+
+ try {
+ int fi = Integer.parseInt(rng[0]);
+ int il = Integer.parseInt(rng[1]);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Parsed range " + fi + " " + il);
+ }
+
+ clientSelection.addRange(new SelectionRange(fi, il));
+
+ } catch (NumberFormatException e) {
+ throw new ConverterException(e);
+ }
+ }
+ }
+
+ return clientSelection;
+ }
+
+}
Deleted: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEvent.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEvent.java 2007-07-23 18:59:03 UTC (rev 1808)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEvent.java 2007-07-23 19:02:50 UTC (rev 1809)
@@ -1,95 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortEvent.java,v $
- * $Revision: 1.2 $
- */
-
-package org.richfaces.event.sort;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author Maksim Kaszynski
- * @modified by Anton Belevich
- *
- */
-public class SortEvent extends FacesEvent {
-
- private static final long serialVersionUID = -1453867412542792281L;
-
- private int sortColumn;
-
- private int startRow;
-
- private int dataIndex;
-
- private boolean asc;
-
-
- public SortEvent(
- UIComponent component, int sortColumn, int startRow, int dataIndex, boolean asc) {
-
- super(component);
- this.asc = asc;
- this.sortColumn = sortColumn;
- this.startRow = startRow;
- this.dataIndex = dataIndex;
-
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof SortListener);
- }
-
- public void processListener(FacesListener listener) {
- ((SortListener) listener).processSort(this);
- }
-
- /**
- * @return the sortField
- */
- public int getSortColumn() {
- return sortColumn;
- }
-
- /**
- * @see java.util.EventObject#toString()
- */
- public String toString() {
- return "SortEvent: {sortColumn: " + sortColumn + "}";
- }
-
- public boolean isAsc() {
- return asc;
- }
-
- public void setAsc(boolean asc) {
- this.asc = asc;
- }
-
- public int getDataIndex() {
- return dataIndex;
- }
-
- public void setDataIndex(int dataIndex) {
- this.dataIndex = dataIndex;
- }
-
- public int getStartRow() {
- return startRow;
- }
-
- public void setStartRow(int startRow) {
- this.startRow = startRow;
- }
-
- public void setSortColumn(int sortColumn) {
- this.sortColumn = sortColumn;
- }
-}
Deleted: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java 2007-07-23 18:59:03 UTC (rev 1808)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java 2007-07-23 19:02:50 UTC (rev 1809)
@@ -1,21 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortListener.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.event.sort;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface SortListener extends FacesListener {
- public void processSort(SortEvent e);
-}
Deleted: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java 2007-07-23 18:59:03 UTC (rev 1808)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java 2007-07-23 19:02:50 UTC (rev 1809)
@@ -1,21 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortSource.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.event.sort;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface SortSource {
- public void addSortListener(SortListener listener);
- public void removeSortListener(SortListener listener);
- public SortListener[] getSortListeners();
-}
17 years, 5 months
JBoss Rich Faces SVN: r1808 - in trunk/sandbox/samples/scrollable-grid-demo: src/main/java/org/richfaces/demo/benchmark and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-23 14:59:03 -0400 (Mon, 23 Jul 2007)
New Revision: 1808
Removed:
trunk/sandbox/samples/scrollable-grid-demo/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.2-SNAPSHOT.jar
Modified:
trunk/sandbox/samples/scrollable-grid-demo/pom.xml
trunk/sandbox/samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/CoreRequestBenchmarkFilter.java
trunk/sandbox/samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/PhaseDemarcationNotifier.java
trunk/sandbox/samples/scrollable-grid-demo/src/main/webapp/
Log:
removed unnecessary ajax4jsf-1.1.2-SNAPSHOT.jar binary
Modified: trunk/sandbox/samples/scrollable-grid-demo/pom.xml
===================================================================
--- trunk/sandbox/samples/scrollable-grid-demo/pom.xml 2007-07-23 18:55:48 UTC (rev 1807)
+++ trunk/sandbox/samples/scrollable-grid-demo/pom.xml 2007-07-23 18:59:03 UTC (rev 1808)
@@ -6,6 +6,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>scrollable-grid-demo</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
<packaging>war</packaging>
<name>scrollable-grid-demo Maven Webapp</name>
<dependencies>
Modified: trunk/sandbox/samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/CoreRequestBenchmarkFilter.java
===================================================================
--- trunk/sandbox/samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/CoreRequestBenchmarkFilter.java 2007-07-23 18:55:48 UTC (rev 1807)
+++ trunk/sandbox/samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/CoreRequestBenchmarkFilter.java 2007-07-23 18:59:03 UTC (rev 1808)
@@ -9,7 +9,6 @@
*/
public class CoreRequestBenchmarkFilter extends RequestBenchMarkFilter {
- @Override
protected String requestType() {
// TODO Auto-generated method stub
return "Core request ";
Modified: trunk/sandbox/samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/PhaseDemarcationNotifier.java
===================================================================
--- trunk/sandbox/samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/PhaseDemarcationNotifier.java 2007-07-23 18:55:48 UTC (rev 1807)
+++ trunk/sandbox/samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/PhaseDemarcationNotifier.java 2007-07-23 18:59:03 UTC (rev 1808)
@@ -29,7 +29,7 @@
*/
public void afterPhase(PhaseEvent event) {
- long l = (Long) getRequestMap(event).get(event.getPhaseId().toString());
+ long l = ((Long) getRequestMap(event).get(event.getPhaseId().toString())).longValue();
if (log.isTraceEnabled()) {
log.trace("Phase end " + event.getPhaseId());
}
@@ -46,7 +46,7 @@
if (log.isTraceEnabled()) {
log.trace("Phase start " + event.getPhaseId());
}
- getRequestMap(event).put(event.getPhaseId().toString(), System.currentTimeMillis());
+ getRequestMap(event).put(event.getPhaseId().toString(), new Long(System.currentTimeMillis()));
}
@@ -57,7 +57,7 @@
return PhaseId.ANY_PHASE;
}
- private Map<String, Object> getRequestMap(PhaseEvent event) {
+ private Map getRequestMap(PhaseEvent event) {
return event.getFacesContext().getExternalContext().getRequestMap();
}
Property changes on: trunk/sandbox/samples/scrollable-grid-demo/src/main/webapp
___________________________________________________________________
Name: svn:ignore
+ META-INF
Deleted: trunk/sandbox/samples/scrollable-grid-demo/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.2-SNAPSHOT.jar
===================================================================
(Binary files differ)
17 years, 5 months