Author: andrei_exadel
Date: 2008-05-26 10:15:36 -0400 (Mon, 26 May 2008)
New Revision: 8755
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JCommandTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JKeepAliveTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JRegionTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JStatusTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4jTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Bean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ChildBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ContextMenuTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Data.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataTableBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DropDownMenuTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/EnclosedData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/IndexBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/JSFunctionBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ListAction.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Media.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MessageBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/NavigateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ObjectNotFoundException.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PageDescriptionBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PagesBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PickListTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RepeatData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestListener.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TimerBean.java
Log:
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JCommandTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JCommandTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JCommandTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,65 @@
+package org.ajax4jsf.bean;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.AjaxContextImpl;
+
+import com.sun.faces.context.FacesContextImpl;
+
+public class A4JCommandTestBean {
+
+ private String value;
+
+ private AjaxContext getAjaxContext () {
+ FacesContext context = FacesContextImpl.getCurrentInstance();
+ if (context != null) {
+ return AjaxContextImpl.getCurrentInstance(context);
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void put2ResponseData(String key, Object value) {
+ AjaxContext ajaxContext = getAjaxContext();
+ if (ajaxContext != null) {
+ Map<String, Object> data = (Map<String,
Object>)ajaxContext.getResponseData();
+ if (null == data) {
+ data = new HashMap<String, Object>();
+ ajaxContext.setResponseData(data);
+ }
+ data.put(key, value);
+ }
+ }
+
+ public String action () {
+ put2ResponseData("action", true);
+ return null;
+ }
+
+ public void actionListener (ActionEvent event) {
+ put2ResponseData("actionListener", true);
+ }
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ put2ResponseData("input", true);
+ }
+
+
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JKeepAliveTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JKeepAliveTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JKeepAliveTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,47 @@
+package org.ajax4jsf.bean;
+
+public class A4JKeepAliveTestBean {
+
+ /* result */
+ private Integer sum = 0;
+
+ /* value to be added to result */
+ private Integer augend = 5;
+
+ /**
+ * Gets value of sum field.
+ * @return value of sum field
+ */
+ public Integer getSum() {
+ return sum;
+ }
+
+ /**
+ * Set a new value for sum field.
+ * @param sum a new value for sum field
+ */
+ public void setSum(Integer sum) {
+ this.sum = sum;
+ }
+
+ /**
+ * Gets value of augend field.
+ * @return value of augend field
+ */
+ public Integer getAugend() {
+ return augend;
+ }
+
+ /**
+ * Set a new value for augend field.
+ * @param augend a new value for augend field
+ */
+ public void setAugend(Integer augend) {
+ this.augend = augend;
+ }
+
+ public String doSum() {
+ sum += augend;
+ return null;
+ }
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JPollTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,58 @@
+package org.ajax4jsf.bean;
+
+import javax.faces.event.ActionEvent;
+
+public class A4JPollTestBean {
+
+ private Integer i = 1;
+
+ private static final String POLLING = "Polling";
+
+ private boolean enabled = false;
+
+ public void start(ActionEvent event) {
+ enabled = true;
+ }
+
+ public void listener(ActionEvent event) {
+ i++;
+ if (i == 8) {
+ enabled = false;
+ }
+ }
+
+ public String getText() {
+ return POLLING.substring(0, i);
+ }
+
+ /**
+ * @return the i
+ */
+ public Integer getI() {
+ return i;
+ }
+
+ /**
+ * @param i the i to set
+ */
+ public void setI(Integer i) {
+ this.i = i;
+ }
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JRegionTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JRegionTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JRegionTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JRegionTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,67 @@
+package org.ajax4jsf.bean;
+
+public class A4JRegionTestBean {
+
+ private Integer internal = 0;
+
+ private Integer external = 0;
+
+ private Integer value = 0;
+
+ /**
+ * Gets value of internal field.
+ *
+ * @return value of internal field
+ */
+ public Integer getInternal() {
+ return internal;
+ }
+
+ /**
+ * Set a new value for internal field.
+ *
+ * @param internal
+ * a new value for internal field
+ */
+ public void setInternal(Integer internal) {
+ this.internal = internal;
+ }
+
+ /**
+ * Gets value of external field.
+ *
+ * @return value of external field
+ */
+ public Integer getExternal() {
+ return external;
+ }
+
+ /**
+ * Set a new value for external field.
+ *
+ * @param external
+ * a new value for external field
+ */
+ public void setExternal(Integer external) {
+ this.external = external;
+ }
+
+ /**
+ * Gets value of value field.
+ *
+ * @return value of value field
+ */
+ public Integer getValue() {
+ return value;
+ }
+
+ /**
+ * Set a new value for value field.
+ *
+ * @param value
+ * a new value for value field
+ */
+ public void setValue(Integer value) {
+ this.value = value;
+ }
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JStatusTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JStatusTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JStatusTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,16 @@
+package org.ajax4jsf.bean;
+
+import javax.faces.event.ActionEvent;
+
+public class A4JStatusTestBean {
+
+ public void actionListener(ActionEvent event) {
+ //mega time-consuming operation - sleeping
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4jTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4jTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4jTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,45 @@
+package org.ajax4jsf.bean;
+
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+public class A4jTestBean {
+
+ private String param = "Not set yet";
+ private boolean checked;
+
+ public String getParam() {
+ return param;
+ }
+
+ public void setParam(String param) {
+ this.param = param;
+ }
+
+ private void checkMap() {
+ Map<String, String> params =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ for (String key : params.keySet()) {
+ System.out.println(key + "=" + params.get(key));
+ }
+ }
+
+ public void perform(ActionEvent actionEvent) {
+ System.out.println("A4jTestBean.perform(ActionEvent) = " + param);
+ checkMap();
+ }
+
+ public void perform() {
+ System.out.println("A4jTestBean.perform() = " + param);
+ checkMap();
+ }
+
+ public boolean isChecked() {
+ return checked;
+ }
+
+ public void setChecked(boolean checked) {
+ this.checked = checked;
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Bean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Bean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Bean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,206 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ValueChangeEvent;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+ private java.lang.String text;
+
+ private String text2="<%%%>";
+
+ private String[] array = {"one]","two]]>"};
+
+ private String[][] array2 =
{{"one","two"},{"three","four"}};
+
+ private UIComponent component;
+
+ private HtmlOutputText outputComponent;
+
+ /**
+ * @return the component
+ */
+ public UIComponent getComponent() {
+ return component;
+ }
+
+ /**
+ * @param component the component to set
+ */
+ public void setComponent(UIComponent component) {
+ this.component = component;
+ }
+
+ public java.lang.String getText() {
+ return text;
+ }
+
+ public void setText(java.lang.String text) {
+ this.text = text;
+ }
+
+ public String ok(){
+ System.out.println("Button pressed");
+ setText("testOk");
+ return null;
+ }
+
+ public String setCookie() {
+ ExternalContext externalContext =
FacesContext.getCurrentInstance().getExternalContext();
+ HttpServletResponse response = (HttpServletResponse)
externalContext.getResponse();
+ Cookie cookie = new Cookie("test", "Setted at time
"+System.currentTimeMillis());
+ cookie.setMaxAge(60 * 60 * 24 * 365);
+ response.addCookie(cookie);
+ return "verify_cookie";
+ }
+
+ public String getTestCookie(){
+ ExternalContext externalContext =
FacesContext.getCurrentInstance().getExternalContext();
+ HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
+ Cookie[] cookies = request.getCookies();
+ for (int i = 0; i < cookies.length; i++) {
+ if("test".equals(cookies[i].getName())){
+ return cookies[i].getValue();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return the array
+ */
+ public String[] getArray() {
+ return array;
+ }
+
+ /**
+ * @param array the array to set
+ */
+ public void setArray(String[] array) {
+ this.array = array;
+ }
+
+ /**
+ * @return the array2
+ */
+ public String[][] getArray2() {
+ return array2;
+ }
+
+ /**
+ * @param array2 the array2 to set
+ */
+ public void setArray2(String[][] array2) {
+ this.array2 = array2;
+ }
+
+ /**
+ * @return the text2
+ */
+ public String getText2() {
+ return text2;
+ }
+
+ /**
+ * @param text2 the text2 to set
+ */
+ public void setText2(String test2) {
+ this.text2 = test2;
+ }
+
+ public void validate(FacesContext context, UIComponent input,Object newValue) {
+ FacesMessage msg = new FacesMessage("#{bean.validate} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("validate");
+ }
+
+ public void onChange(ValueChangeEvent event) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIComponent input = event.getComponent();
+ FacesMessage msg = new FacesMessage("#{bean.onChange} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("onChange");
+
+ }
+
+ public void validate2(FacesContext context, UIComponent input,Object newValue) {
+ FacesMessage msg = new FacesMessage("#{bean.validate2} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("validate2");
+
+ }
+
+ public void onChange2(ValueChangeEvent event) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIComponent input = event.getComponent();
+ FacesMessage msg = new FacesMessage("#{bean.onChange2} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("onChange2");
+
+ }
+
+ public String getTime(){
+ return (new Date(System.currentTimeMillis())).toString();
+ }
+
+ public String clearSession(){
+ ExternalContext externalContext =
FacesContext.getCurrentInstance().getExternalContext();
+ HttpSession session = (HttpSession) externalContext.getSession(false);
+ if(null != session){
+ session.setMaxInactiveInterval(5);
+ }
+ return null;
+ }
+
+ /**
+ * @return the outputComponent
+ */
+ public HtmlOutputText getOutputComponent() {
+ outputComponent = new HtmlOutputText();
+ return outputComponent;
+ }
+
+ /**
+ * @param outputComponent the outputComponent to set
+ */
+ public void setOutputComponent(HtmlOutputText outputComponent) {
+ this.outputComponent = outputComponent;
+ }
+
+}
\ No newline at end of file
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,170 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+import java.lang.reflect.Method;
+import java.text.DateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import javax.faces.convert.DateTimeConverter;
+
+public class CalendarTestBean {
+
+ public static final String DATE_PATTERN = "MM/dd/yyyy HH:mm";
+
+ public static final Locale LOCALE = new Locale("US");
+
+ public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("GMT+2");
+
+ public static Date DEFAULT_DATE;
+
+ private static DateTimeConverter DEFAULT_CONVERTER;
+
+ public static DateFormat DATE_FORMAT;
+
+ // constructor for static fields
+ static {
+ setupDefaultConverter();
+ setupDefaultDate();
+ }
+
+ private String datePattern ;
+
+ private Locale locale;
+
+ private TimeZone timeZone;
+
+ private Date selectedDate;
+
+ private String selectedDateString;
+
+ public CalendarTestBean() {
+ selectedDate = DEFAULT_DATE;
+ resetSelectedDateString();
+
+ datePattern = DATE_PATTERN;
+ locale = LOCALE;
+ timeZone = TIME_ZONE;
+ }
+
+ public Date getSelectedDate() {
+ return selectedDate;
+ }
+
+ public void setSelectedDate(Date selectedDate) {
+ this.selectedDate = selectedDate;
+ resetSelectedDateString();
+ }
+
+ public void resetSelectedDateString() {
+ setSelectedDateString(DATE_FORMAT.format(getSelectedDate()));
+ }
+
+ public String getSelectedDateString() {
+ return selectedDateString;
+ }
+
+ public void setSelectedDateString(String selectedDateString) {
+ this.selectedDateString = selectedDateString;
+ }
+
+ public String getDatePattern() {
+ return datePattern;
+ }
+
+ public Locale getLocale() {
+ return locale;
+ }
+
+ public TimeZone getTimeZone() {
+ return timeZone;
+ }
+
+ public void setDatePattern(String datePattern) {
+ this.datePattern = datePattern;
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ public void setTimeZone(TimeZone timeZone) {
+ this.timeZone = timeZone;
+ }
+
+ public static Calendar getCalendar() {
+ return Calendar.getInstance(CalendarTestBean.TIME_ZONE, CalendarTestBean.LOCALE);
+ }
+
+ /**
+ * Setup the default date
+ */
+ private static void setupDefaultDate() {
+ DEFAULT_DATE = getDayInMay(10);
+ }
+
+ public static Date getDayInMay(int dayOfMonth) {
+ Calendar calendar = getCalendar();
+ calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
+ calendar.set(Calendar.MONTH, Calendar.MAY);
+ calendar.set(Calendar.YEAR, 2008);
+ calendar.set(Calendar.HOUR_OF_DAY, 18);
+ calendar.set(Calendar.MINUTE, 25);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ return calendar.getTime();
+ }
+
+ /**
+ * Setup the default converter
+ */
+ private static void setupDefaultConverter() {
+ DEFAULT_CONVERTER = new DateTimeConverter();
+
+ DEFAULT_CONVERTER.setPattern(DATE_PATTERN);
+ DEFAULT_CONVERTER.setLocale(LOCALE);
+ DEFAULT_CONVERTER.setTimeZone(TIME_ZONE);
+
+ try {
+ Method method = null;
+ Method[] declaredMethods = DateTimeConverter.class.getDeclaredMethods();
+ for (int i = 0; i < declaredMethods.length; i++) {
+ if (declaredMethods[i].getName().equals("getDateFormat")) {
+ method = declaredMethods[i];
+ break;
+ }
+ }
+ if (method != null) {
+
+ method.setAccessible(true);
+ DATE_FORMAT = (DateFormat) method.invoke(DEFAULT_CONVERTER,
DEFAULT_CONVERTER.getLocale());
+ DATE_FORMAT.setTimeZone(DEFAULT_CONVERTER.getTimeZone());
+ }
+ } catch (Exception e) {
+ // skip exception
+ }
+ }
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ChildBean.java (from
rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ChildBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ChildBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,62 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+/**
+ * @author shura
+ *
+ */
+public class ChildBean {
+
+ private String name;
+
+ private int qty;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the qty
+ */
+ public int getQty() {
+ return this.qty;
+ }
+
+ /**
+ * @param qty the qty to set
+ */
+ public void setQty(int qty) {
+ this.qty = qty;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ComboBoxTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,38 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class ComboBoxTestBean {
+
+ private List<SelectItem> treeItems;
+ private List<String> treeNames;
+
+ public ComboBoxTestBean() {
+ treeNames = Arrays.asList("Pine", "Birch", "Aspen",
"Spruce", "Oak", "Maple", "Ash",
"Lime");
+ treeItems = new ArrayList<SelectItem>();
+ for (String treeName : treeNames) {
+ treeItems.add(new SelectItem(treeName, treeName));
+ }
+ }
+
+ /**
+ * Gets value of treeItems field.
+ * @return value of treeItems field
+ */
+ public List<SelectItem> getTreeItems() {
+ return treeItems;
+ }
+
+ /**
+ * Gets value of treeNames field.
+ * @return value of treeNames field
+ */
+ public List<String> getTreeNames() {
+ return treeNames;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ContextMenuTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ContextMenuTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ContextMenuTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ContextMenuTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,65 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+import javax.faces.event.ActionEvent;
+
+public class ContextMenuTestBean {
+
+ private String value;
+ private int value2;
+
+ public ContextMenuTestBean() {
+ value = "";
+ value2 = 0;
+ }
+
+ public void actionListener(ActionEvent event) {
+ this.value = event.getComponent().getId();
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String action() {
+ if (4 == value2 ) {
+ value2 = 1;
+ } else {
+ value2++;
+ }
+ return null;
+ }
+
+ public int getValue2() {
+ return value2;
+ }
+
+ public void setValue2(int value2) {
+ this.value2 = value2;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Data.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Data.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Data.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,135 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+public class Data {
+
+ private static final String[]
mnames={"Jan","Feb","Mar","Apr","May"};
+
+ private List mounths = new ArrayList();
+
+ private List numbers = new ArrayList();
+
+ private boolean c3rendered=true;
+
+ private boolean c2rendered=true;
+
+ /**
+ * @return the c3rendered
+ */
+ public boolean isC3rendered() {
+ return this.c3rendered;
+ }
+
+ /**
+ * @param c3rendered the c3rendered to set
+ */
+ public void setC3rendered(boolean c3rendered) {
+ this.c3rendered = c3rendered;
+ }
+
+ public String toggleColumn() {
+ this.c3rendered = !this.c3rendered;
+ return null;
+ }
+ /**
+ * @return the numbers
+ */
+ public List getNumbers() {
+ return this.numbers;
+ }
+
+ /**
+ * @param numbers the numbers to set
+ */
+ public void setNumbers(List numbers) {
+ this.numbers = numbers;
+ }
+
+ public Data() {
+ Properties properties = System.getProperties();
+ Enumeration keys = properties.keys();
+ for(int i=0;i<5;i++){
+ DataBean bean = new DataBean();
+ int l = (int)(Math.random()*5)+1;
+ bean.setTotal(0);
+ bean.setMounth(mnames[i]);
+ mounths.add(bean);
+ for(int j=0;j<l;j++){
+ ChildBean child = new ChildBean();
+ child.setName((String) keys.nextElement());
+ int qty = (int)(Math.random()*10);
+ bean.setTotal(bean.getTotal()+qty);
+ child.setQty(qty);
+ bean.getDetail().add(child);
+ }
+ }
+ for(int i=0;i<16;i++){
+ numbers.add(new Integer(i));
+ }
+ }
+
+ /**
+ * @return the mounths
+ */
+ public List getMounths() {
+ return this.mounths;
+ }
+
+ /**
+ * @param mounths the mounths to set
+ */
+ public void setMounths(List mounths) {
+ this.mounths = mounths;
+ }
+
+ /**
+ * @return the c2rendered
+ */
+ public boolean isC2rendered() {
+ return this.c2rendered;
+ }
+
+ /**
+ * @param c2rendered the c2rendered to set
+ */
+ public void setC2rendered(boolean c2rendered) {
+ this.c2rendered = c2rendered;
+ }
+
+ public int getC2span(){
+ return c3rendered?1:2;
+ }
+
+ public int getC1span(){
+ int i = c2rendered?1:c3rendered?2:3;
+ return i;
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,119 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class DataBean {
+ private List detail = new ArrayList();
+
+ private String mounth;
+
+ private int total;
+
+ private int price;
+
+ private boolean checked=true;
+ /**
+ *
+ */
+ public DataBean() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the detail
+ */
+ public List getDetail() {
+ return this.detail;
+ }
+
+ /**
+ * @param detail the detail to set
+ */
+ public void setDetail(List detail) {
+ this.detail = detail;
+ }
+
+ /**
+ * @return the mounth
+ */
+ public String getMounth() {
+ return this.mounth;
+ }
+
+ /**
+ * @param mounth the mounth to set
+ */
+ public void setMounth(String mounth) {
+ this.mounth = mounth;
+ }
+
+ /**
+ * @return the total
+ */
+ public int getTotal() {
+ return this.total;
+ }
+
+ /**
+ * @param total the total to set
+ */
+ public void setTotal(int total) {
+ this.total = total;
+ }
+
+ /**
+ * @return the checked
+ */
+ public boolean isChecked() {
+ System.out.println("Invoke get checked for mounth "+getMounth()+",
checked:"+checked);
+ return this.checked;
+ }
+
+ /**
+ * @param checked the checked to set
+ */
+ public void setChecked(boolean checked) {
+ System.out.println("Invoke set checked for mounth "+getMounth()+",
checked:"+checked);
+ this.checked = checked;
+ }
+
+ public String check(){
+ checked = !checked;
+ System.out.println("Invoke check action for mounth "+getMounth()+",
checked:"+checked);
+ return null;
+ }
+
+ public String inc(){
+ total++;
+ return null;
+ }
+
+ public void checkChanged(ValueChangeEvent event) {
+ System.out.println("Checked changed for mounth "+getMounth());
+ }
+
+ /**
+ * @return the price
+ */
+ public int getPrice() {
+ return price;
+ }
+
+ /**
+ * @param price the price to set
+ */
+ public void setPrice(int price) {
+ this.price = price;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataTableBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataTableBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataTableBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,159 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.model.Column;
+import org.richfaces.model.Ordering;
+
+@SuppressWarnings("unchecked")
+public class DataTableBean {
+
+ private int rows = 20;
+
+ private int column = 3;
+
+ private int begin = 1;
+
+ private int end = 10;
+
+ private List model;
+
+ private List columns;
+
+ private Ordering ordering;
+
+ public DataTableBean() {
+ init();
+ }
+
+ public void init(ActionEvent event) {
+ init();
+ }
+
+ public String getDate() {
+ return new Date().toLocaleString();
+ }
+
+ private void init() {
+ model = new ArrayList();
+ for (int i = 0; i < rows; i++) {
+ String [] m = new String[column];
+ for (int j = 0; j < column; j++) {
+ m[j] = String.valueOf(i + j);
+ }
+ model.add(m);
+ }
+
+ columns = new ArrayList();
+ for (int i = 0; i < column; i++) {
+ columns.add(new Column("header","footer", i));
+ }
+ }
+
+ /**
+ * @return the columns
+ */
+ public int getColumn() {
+ return column;
+ }
+
+ /**
+ * @param columns
+ * the columns to set
+ */
+ public void setColumn(int column) {
+ this.column = column;
+ }
+
+ /**
+ * @return the rows
+ */
+ public int getRows() {
+ return rows;
+ }
+
+ /**
+ * @param rows
+ * the rows to set
+ */
+ public void setRows(int rows) {
+ this.rows = rows;
+ }
+
+ /**
+ * @return the model
+ */
+ public List getModel() {
+ return model;
+ }
+
+ /**
+ * @param model
+ * the model to set
+ */
+ public void setModel(List model) {
+ this.model = model;
+ }
+
+ /**
+ * @return the columns
+ */
+ public List getColumns() {
+ return columns;
+ }
+
+ /**
+ * @param columns
+ * the columns to set
+ */
+ public void setColumns(List columns) {
+ this.columns = columns;
+ }
+
+ /**
+ * @return the ordering
+ */
+ public Ordering getOrdering() {
+ return ordering;
+ }
+
+ /**
+ * @param ordering the ordering to set
+ */
+ public void setOrdering(Ordering ordering) {
+ this.ordering = ordering;
+ }
+
+ /**
+ * @return the begin
+ */
+ public int getBegin() {
+ return begin;
+ }
+
+ /**
+ * @param begin the begin to set
+ */
+ public void setBegin(int begin) {
+ this.begin = begin;
+ }
+
+ /**
+ * @return the end
+ */
+ public int getEnd() {
+ return end;
+ }
+
+ /**
+ * @param end the end to set
+ */
+ public void setEnd(int end) {
+ this.end = end;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DropDownMenuTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DropDownMenuTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DropDownMenuTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,53 @@
+package org.ajax4jsf.bean;
+
+public class DropDownMenuTestBean {
+
+ private String actionName = "";
+
+ /**
+ * Gets value of actionName field.
+ * @return value of actionName field
+ */
+ public String getActionName() {
+ return actionName;
+ }
+
+ /**
+ * Set a new value for actionName field.
+ * @param actionName a new value for actionName field
+ */
+ public void setActionName(String actionName) {
+ this.actionName = actionName;
+ }
+
+ public String doNew() {
+ setActionName("New");
+ return null;
+ }
+
+ public String doOpen() {
+ setActionName("Open");
+ return null;
+ }
+
+ public String doSave() {
+ setActionName("Save");
+ return null;
+ }
+
+ public String doSaveAll() {
+ setActionName("Save All");
+ return null;
+ }
+
+ public String doClose() {
+ setActionName("Close");
+ return null;
+ }
+
+ public String doExit() {
+ setActionName("Exit");
+ return null;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/EnclosedData.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/EnclosedData.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/EnclosedData.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class EnclosedData {
+
+ private List<RepeatData> repeatData;
+
+ public EnclosedData() {
+ repeatData = new ArrayList<RepeatData>();
+ for(int i=0;i<5;i++){
+ RepeatData data = new RepeatData();
+ data.setText("Top row "+i);
+ repeatData.add(data);
+ }
+ }
+
+ /**
+ * @return the repeatData
+ */
+ public List<RepeatData> getRepeatData() {
+ return repeatData;
+ }
+
+ /**
+ * @param repeatData the repeatData to set
+ */
+ public void setRepeatData(List<RepeatData> repeatData) {
+ this.repeatData = repeatData;
+ }
+
+
+
+}
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/IndexBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/IndexBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/IndexBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,86 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class IndexBean {
+
+ private List<ComponentItem> list = new ArrayList<ComponentItem>();
+
+ public class ComponentItem {
+ String name;
+ String link;
+
+
+ public ComponentItem(String name, String link) {
+ this.name = name;
+ this.link = link;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the link
+ */
+ public String getLink() {
+ return link;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof ComponentItem)) {
+ return false;
+ }
+
+ if (obj == null) {
+ return true;
+ }
+ return name.equals(((ComponentItem)obj).name);
+ }
+
+ };
+
+ public IndexBean() {
+ list.add(new ComponentItem("<a4j:commandButton>",
"ajaxCommandButton/ajaxButtonTest.xhtml"));
+ list.add(new ComponentItem("<a4j:commandLink>",
"ajaxCommandLink/ajaxLinkTest.xhtml"));
+ list.add(new ComponentItem("<a4j:poll>",
"ajaxPoll/ajaxPollTest.xhtml"));
+ list.add(new ComponentItem("<a4j:region>",
"ajaxRegion/ajaxRegionTest.xhtml"));
+ list.add(new ComponentItem("<rich:calendar>",
"ajaxStatus/ajaxStatusTest.xhtml"));
+ list.add(new ComponentItem("<rich:combobox>",
"calendar/calendarTest.xhtml"));
+ list.add(new ComponentItem("<rich:contextMenu>",
"comboBox/comboBoxTest.xhtml"));
+ list.add(new ComponentItem("<rich:dataTable>",
"contextMenu/contextMenu.xhtml"));
+ list.add(new ComponentItem("<rich:dropDownMenu>",
"dataTable/dataTableTest.xhtml"));
+ list.add(new ComponentItem("<rich:inplaceSelect>",
"inplaceSelect/inplaceSelectTest.xhtml"));
+ list.add(new ComponentItem("<rich:inputNumberSpinner>",
"inputNumberSpinner/inputNumberSpinnerTest.xhtml"));
+ list.add(new ComponentItem("<rich:jsFunction>",
"jsFunction/jsFunctionTest.xhtml"));
+ list.add(new ComponentItem("<a4j:keepAlive>",
"keepAlive/keepAliveTest.xhtml"));
+ list.add(new ComponentItem("<a4j:loadScript>",
"loadScript/loadScriptTest.xhtml"));
+ list.add(new ComponentItem("<a4j:loadStyle>",
"loadStyle/loadStyleTest.xhtml"));
+ list.add(new ComponentItem("<rich:orderingList>",
"orderingList/orderingListTest.xhtml"));
+ list.add(new ComponentItem("<rich:panelBar>",
"panelBar/panelBarTest.xhtml"));
+ list.add(new ComponentItem("<rich:panelMenu>",
"panelMenu/panelMenuTest.xhtml"));
+ list.add(new ComponentItem("<rich:pickList>",
"pickList/pickListTest.xhtml"));
+ list.add(new ComponentItem("<rich:progressBar>",
"progressBar/progressBarTest.xhtml"));
+ list.add(new ComponentItem("<rich:simpleTogglePanel>",
"simpleTogglePanel/simpleTogglePanel.xhtml"));
+ list.add(new ComponentItem("<rich:tabPanel>",
"tabPanel/tabPanelTest.xhtml"));
+ list.add(new ComponentItem("<rich:togglePanel>",
"togglePanel/togglePanelTest.xhtml"));
+
+ }
+
+ /**
+ * @return the list
+ */
+ public List<ComponentItem> getList() {
+ return list;
+ }
+
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,51 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class InplaceSelectTestBean {
+
+ private List<SelectItem> treeItems = new ArrayList<SelectItem>();
+
+ private List<String> treeNames = Arrays.asList("Pine",
"Birch", "Aspen", "Spruce", "Oak",
"Maple", "Ash", "Lime");
+
+ private String tree = "";
+
+ /**
+ * Gets value of tree field.
+ *
+ * @return value of tree field
+ */
+ public String getTree() {
+ return tree;
+ }
+
+ /**
+ * Set a new value for tree field.
+ *
+ * @param tree
+ * a new value for tree field
+ */
+ public void setTree(String tree) {
+ this.tree = tree;
+ }
+
+ public InplaceSelectTestBean() {
+ for (String treeName : treeNames) {
+ treeItems.add(new SelectItem(treeName, treeName));
+ }
+ }
+
+ /**
+ * Gets value of treeItems field.
+ *
+ * @return value of treeItems field
+ */
+ public List<SelectItem> getTreeItems() {
+ return treeItems;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/JSFunctionBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/JSFunctionBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/JSFunctionBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,23 @@
+package org.ajax4jsf.bean;
+
+public class JSFunctionBean {
+
+ private String name = "";
+
+ /**
+ * Gets value of name field.
+ * @return value of name field
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set a new value for name field.
+ * @param name a new value for name field
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ListAction.java (from
rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ListAction.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ListAction.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ListAction {
+
+ private List data;
+
+ private Set keys;
+
+ /**
+ * @return the data
+ */
+ public List getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public Set getKeys(){
+ return keys;
+ }
+
+ public String timer(){
+ if(null != data){
+ keys=new HashSet();
+ int random = (int)(Math.random()*10.0);
+ for(int i=0;i<random;i++){
+ Bean bean = (Bean) data.get(i);
+ bean.setText(bean.getText()+" X");
+ keys.add(new Integer(i));
+ }
+ }
+ return null;
+ }
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Media.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Media.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Media.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,17 @@
+package org.ajax4jsf.bean;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+
+public interface Media {
+
+ public void paint(OutputStream out, Object data) throws IOException;
+
+ public void initData();
+
+ public void setData(MediaData data);
+
+ public MediaData getData();
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaBean.java (from
rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,55 @@
+package org.ajax4jsf.bean;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.imageio.ImageIO;
+
+
+public class MediaBean implements Media {
+
+ private MediaData data;
+
+ /**
+ * @return the data
+ */
+ public MediaData getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(MediaData data) {
+ this.data = data;
+ }
+
+ public void initData(){
+ data= new MediaData();
+ data.setWidth(100);
+ data.setHeight(100);
+ data.setBackground(Color.BLUE);
+ data.setDrawColor(Color.RED);
+ }
+
+ public void paint(OutputStream out, Object data) throws IOException{
+ if (data instanceof MediaData) {
+
+ MediaData paintData = (MediaData) data;
+ BufferedImage img = new
BufferedImage(paintData.getWidth(),paintData.getHeight(),BufferedImage.TYPE_INT_RGB);
+ Graphics2D graphics2D = img.createGraphics();
+ graphics2D.setBackground(paintData.getBackground());
+ graphics2D.setColor(paintData.getDrawColor());
+ graphics2D.clearRect(0,0,paintData.getWidth(),paintData.getHeight());
+ graphics2D.drawLine(5,5,paintData.getWidth()-5,paintData.getHeight()-5);
+ graphics2D.drawChars(new String("RichFaces").toCharArray(),0,9,40,15);
+ graphics2D.drawChars(new String("mediaOutput").toCharArray(),0,11,5,45);
+
+ ImageIO.write(img,"jpeg",out);
+
+ }
+ }
+}
\ No newline at end of file
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaData.java (from
rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaData.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaData.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,39 @@
+package org.ajax4jsf.bean;
+
+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
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MessageBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MessageBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MessageBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,103 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.EventListener;
+import java.util.EventObject;
+import java.util.List;
+
+import org.ajax4jsf.event.PushEventListener;
+
+
+public class MessageBean implements Runnable {
+
+ private String result;
+
+ private boolean running = true;
+
+ private PushEventListener listener;
+
+ private List messages = new ArrayList(10);
+
+ private int counter = 0;
+
+ public MessageBean() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the result
+ */
+ public String getResult() {
+ return result;
+ }
+
+ /**
+ * @param result
+ * the result to set
+ */
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public void addListener(EventListener listener) {
+ synchronized (listener) {
+ if (this.listener != listener) {
+ this.listener = (PushEventListener) listener;
+ Thread th = new Thread(this);
+ th.start();
+
+ }
+ }
+ }
+
+ public void run() {
+ try {
+ while (isRunning()) {
+ Thread.sleep(10000);
+ Date current = new Date(System.currentTimeMillis());
+ if(messages.size()>=10){
+ messages.remove(0);
+ }
+ messages.add(messages.size(),String.valueOf(counter++)+" at
"+current.toString());
+ System.out.println("event occurs");
+ synchronized (listener) {
+ listener.onEvent(new EventObject(this));
+ }
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * @return the running
+ */
+ public synchronized boolean isRunning() {
+ return running;
+ }
+
+ /**
+ * @param running
+ * the running to set
+ */
+ public synchronized void setRunning(boolean running) {
+ this.running = running;
+ }
+
+ /**
+ * @return the messages
+ */
+ public List getMessages() {
+ return messages;
+ }
+
+ /**
+ * @param messages the messages to set
+ */
+ public void setMessages(List messages) {
+ this.messages = messages;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/NavigateBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/NavigateBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/NavigateBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,64 @@
+package org.ajax4jsf.bean;
+
+import java.io.Serializable;
+
+import org.ajax4jsf.component.UIInclude;
+
+public class NavigateBean implements Serializable {
+
+ private String viewId="/pages/hello.jsp";
+
+ transient private UIInclude include;
+
+ public String navigateOne() {
+
+ return "sucessOne";
+ }
+
+ public String navigateTwo() {
+
+ return "sucessTwo";
+ }
+
+ public String navigateHello() {
+
+ return "sucessHello";
+ }
+
+ /**
+ * @return the viewId
+ */
+ public String getViewId() {
+ return viewId;
+ }
+
+ /**
+ * @param viewId the viewId to set
+ */
+ public void setViewId(String viewId) {
+ this.viewId = viewId;
+ }
+
+ public String reset(){
+ setViewId("/pages/hello.jsp");
+ if(null != include){
+ include.setViewId("/pages/hello.jsp");
+ }
+ return null;
+ }
+
+ /**
+ * @return the include
+ */
+ public UIInclude getInclude() {
+ return include;
+ }
+
+ /**
+ * @param include the include to set
+ */
+ public void setInclude(UIInclude include) {
+ this.include = include;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ObjectNotFoundException.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ObjectNotFoundException.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ObjectNotFoundException.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ObjectNotFoundException extends Exception {
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,174 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+public class OrderingListTestBean {
+ private Converter converter;
+ private List<Item> items;
+ private Collection<Item> selection;
+ private Object activeItem;
+
+ public OrderingListTestBean() {
+ converter = new ItemConverter();
+ items = new ArrayList<Item>();
+ for (int i = 0; i < 4; i++) {
+ items.add(new Item("item" + i));
+ }
+ selection = new HashSet<Item>();
+ }
+
+ public Object getActionResult() {
+ return
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("actionResult");
+ }
+
+ public Collection<Item> getSelection() {
+ return selection;
+ }
+
+ public void setSelection(Collection<Item> selection) {
+ this.selection = selection;
+ }
+
+ public Object getActiveItem() {
+ return activeItem;
+ }
+
+ public void setActiveItem(Object activeItem) {
+ this.activeItem = activeItem;
+ }
+
+ public Converter getConverter() {
+ return converter;
+ }
+
+ public void setConverter(Converter converter) {
+ this.converter = converter;
+ }
+
+ public List<Item> getItems() {
+ return items;
+ }
+
+ public void setItems(List<Item> items) {
+ this.items = items;
+ }
+
+ public String getSelectionString() {
+ StringBuffer buff = new StringBuffer();
+ for (Iterator<Item> it = selection.iterator(); it.hasNext();) {
+ Item item = it.next();
+ buff.append(item.getName());
+ if (it.hasNext()) {
+ buff.append(',');
+ }
+ }
+ return buff.toString();
+ }
+
+
+ private class ItemConverter implements Converter {
+
+ /* (non-Javadoc)
+ * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext,
javax.faces.component.UIComponent, java.lang.String)
+ */
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+ return new Item(value);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext,
javax.faces.component.UIComponent, java.lang.Object)
+ */
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+ Item optionItem = (Item) value;
+ return optionItem.getName();
+ }
+
+ }
+
+ public class Item implements Serializable {
+
+ private static final long serialVersionUID = 1083694594537030790L;
+
+ private String name;
+
+ public String action() {
+ FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("actionResult",
name);
+ return null;
+ }
+
+ public Item(String name) {
+ super();
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String toString() {
+ return this.getClass().getSimpleName() + " [" + name + "]";
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ 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;
+ Item other = (Item) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+
+ return true;
+ }
+
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PageDescriptionBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PageDescriptionBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PageDescriptionBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PageDescriptionBean {
+
+ private String _path;
+
+ private String _title;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return _title;
+ }
+
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ _title = title;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PagesBean.java (from
rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PagesBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PagesBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,125 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PagesBean {
+
+ private static final Pattern JSP_PATTERN = Pattern.compile(".*\\.jspx?");
+
+ private static final Pattern XHTML_PATTERN = Pattern.compile(".*\\.xhtml");
+
+ private static final Pattern TITLE_PATTERN =
Pattern.compile("<title>(.*)</title>",Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
+
+ private ServletContext _servletContext;
+
+ private List<PageDescriptionBean> _jspPages;
+
+ private String _path;
+
+ private List<PageDescriptionBean> _xhtmlPages;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path
+ * the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the servletContext
+ */
+ public ServletContext getServletContext() {
+ return _servletContext;
+ }
+
+ /**
+ * @param servletContext
+ * the servletContext to set
+ */
+ public void setServletContext(ServletContext servletContext) {
+ _servletContext = servletContext;
+ }
+
+ public List<PageDescriptionBean> getJspPages() {
+ if (_jspPages == null && null != getServletContext()) {
+ _jspPages = getPagesByPattern(JSP_PATTERN);
+ }
+
+ return _jspPages;
+ }
+
+ public List<PageDescriptionBean> getXhtmlPages() {
+ if (_xhtmlPages == null && null != getServletContext()) {
+ _xhtmlPages = getPagesByPattern(XHTML_PATTERN);
+ }
+
+ return _xhtmlPages;
+ }
+
+ /**
+ *
+ */
+ private List<PageDescriptionBean> getPagesByPattern(Pattern pattern) {
+ List<PageDescriptionBean> jspPages = new ArrayList<PageDescriptionBean>();
+ Set resourcePaths = getServletContext().getResourcePaths(getPath());
+ for (Iterator iterator = resourcePaths.iterator(); iterator
+ .hasNext();) {
+ String page = (String) iterator.next();
+ if (pattern.matcher(page).matches()) {
+ PageDescriptionBean pageBean = new PageDescriptionBean();
+ pageBean.setPath(page);
+ InputStream pageInputStream = getServletContext().getResourceAsStream(page);
+ if(null != pageInputStream){
+ byte[] head = new byte[1024];
+ try {
+ int readed = pageInputStream.read(head);
+ String headString = new String(head,0,readed);
+ Matcher titleMatcher = TITLE_PATTERN.matcher(headString);
+ if(titleMatcher.find() && titleMatcher.group(1).length()>0){
+ pageBean.setTitle(titleMatcher.group(1));
+ } else {
+ pageBean.setTitle(page);
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ try {
+ pageInputStream.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ jspPages.add(pageBean);
+ }
+ }
+ return jspPages;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PickListTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PickListTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PickListTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PickListTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,110 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class PickListTestBean {
+
+ private String copyAllLabel = "MOVE ALL";
+
+ private String copyLabel = "MOVE";
+
+ private String removeLabel = "TAKE AWAY";
+
+ private String removeAllLabel = "TAKE ALL AWAY";
+
+ private List<String> items = Arrays.asList("ZHURIK",
"MELESHKO", "LEONTIEV", "KOVAL", "KALYUZHNY",
"DUDIK",
+ "KOSTITSYN", "GRABOVSKI");
+
+ private List<SelectItem> options = new ArrayList<SelectItem>();
+
+ private List<String> result = new ArrayList<String>();
+
+ public PickListTestBean() {
+ for (String player : items) {
+ options.add(new SelectItem(player, player));
+ }
+
+ // preselected items
+ result.add(items.get(0));
+ result.add(items.get(1));
+ }
+
+ /**
+ * Gets value of copyAllLabel field.
+ *
+ * @return value of copyAllLabel field
+ */
+ public String getCopyAllLabel() {
+ return copyAllLabel;
+ }
+
+ /**
+ * Gets value of copyLabel field.
+ *
+ * @return value of copyLabel field
+ */
+ public String getCopyLabel() {
+ return copyLabel;
+ }
+
+ /**
+ * Gets value of removeLabel field.
+ *
+ * @return value of removeLabel field
+ */
+ public String getRemoveLabel() {
+ return removeLabel;
+ }
+
+ /**
+ * Gets value of removeAllLabel field.
+ *
+ * @return value of removeAllLabel field
+ */
+ public String getRemoveAllLabel() {
+ return removeAllLabel;
+ }
+
+ /**
+ * Gets value of options field.
+ *
+ * @return value of options field
+ */
+ public List<SelectItem> getOptions() {
+ return options;
+ }
+
+ /**
+ * Set a new value for options field.
+ *
+ * @param options
+ * a new value for options field
+ */
+ public void setOptions(List<SelectItem> options) {
+ this.options = options;
+ }
+
+ /**
+ * Gets value of result field.
+ *
+ * @return value of result field
+ */
+ public List<String> getResult() {
+ return result;
+ }
+
+ /**
+ * Set a new value for result field.
+ *
+ * @param result
+ * a new value for result field
+ */
+ public void setResult(List<String> result) {
+ this.result = result;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,60 @@
+package org.ajax4jsf.bean;
+
+import java.util.Date;
+
+import javax.faces.event.ActionEvent;
+
+public class ProgressBarTestBean {
+
+ private boolean enabled = false;
+
+ private Long value = -5L;
+
+ public String getDate() {
+ return String.valueOf(new Date().getTime());
+ }
+
+ public String getCompleteDate() {
+ return String.valueOf(new Date().getTime());
+ }
+
+ public void reset(ActionEvent event) {
+ this.value = -5L;
+ }
+
+ public void complete(ActionEvent event) {
+ this.value = 120L;
+ }
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ /**
+ * @return the value
+ */
+ public Long getValue() {
+ value++;
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(Long value) {
+ this.value = value;
+ }
+
+
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RepeatData.java (from
rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RepeatData.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RepeatData.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,62 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class RepeatData {
+
+ private List data;
+
+ private String text;
+
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public RepeatData() {
+ data = new ArrayList(10);
+ for(int i=0;i<10;i++){
+ Bean bean = new Bean();
+ bean.setText("Row "+i);
+ data.add(bean);
+ }
+ }
+
+ public String ok(){
+ System.out.println("Row command pressed");
+ return null;
+ }
+
+ /**
+ * @return the data
+ */
+ public List getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(List data) {
+ this.data = data;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+import javax.faces.event.ActionEvent;
+
+public class RichPanelTestBean {
+ private String value;
+ private int value2;
+
+ public RichPanelTestBean() {
+ value = "";
+ value2 = 0;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void actionListener(ActionEvent event) {
+ this.value = event.getComponent().getId();
+ }
+
+ public String action1() {
+ this.value2 = 1;
+ return null;
+ }
+
+ public String action2() {
+ this.value2 = 2;
+ return null;
+ }
+
+ public String increment() {
+ if (4 == this.value2) {
+ this.value2 = 0;
+ }
+ this.value2++;
+ return null;
+ }
+
+ public int getValue2() {
+ return value2;
+ }
+
+ public void setValue2(int value2) {
+ this.value2 = value2;
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+import org.ajax4jsf.template.Template;
+
+
+public class TemplateBean {
+ public static final String PARAM_NAME = "t";
+
+ private String template = "simple";
+
+ /*public void initTemplate (ActionEvent event) {
+ Map<String, String> reqMap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ String template = reqMap.get(PARAM_NAME);
+ this.template = template != null ? template : "simple";
+ }*/
+
+ public String getTemplateId() {
+ return template;
+ }
+
+ public void setTemplateId(String template) {
+ if (this.template != null && !this.template.equals(template)) {
+ this.template = template;
+ }
+ }
+
+
+ public String getParentId () {
+ if ("dataTable".equals(template)) {
+ return Template.COMPONENT_PREFIX_INSIDE_TABLE;
+ }
+ return Template.COMPONENT_PREFIX_SIMPLE;
+ }
+
+
+ /**
+ * @return the template
+ */
+ public String getTemplate() {
+ return "../../template/" + template + ".xhtml";
+ }
+
+
+ /**
+ * @param template the template to set
+ */
+ public void setTemplate(String template) {
+ this.template = template;
+ }
+
+
+}
\ No newline at end of file
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestBean.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,64 @@
+package org.ajax4jsf.bean;
+
+
+
+import java.util.logging.Logger;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author krasi
+ *
+ */
+public class TestBean {
+ String id = "";
+ static final Logger LOGGER = Logger.getLogger(TestBean.class.getName());
+
+ public TestBean() {
+ }
+
+ public String getId() {
+
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 1.",
+ ""));
+
+ System.out.println("GET 1 ------" + id);
+ if (!id.equals("")) {
+ System.out.println("GET 2 ------" + id);
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 2.",
+ "11"));
+
+ try {
+ System.out.println("GET 3 ------" + id);
+ throw new ObjectNotFoundException();
+
+ } catch (ObjectNotFoundException e) {
+ System.out.println("GET 4 ------" + id);
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 3.",
+ "11"));
+ }
+
+ }
+
+ return id;
+ }
+
+ public void setId(String id) {
+ System.out.println("SET 1-" + id);
+ this.id = id;
+ }
+
+ public String searchByID() {
+ System.out.println("searchByID");
+ return null;
+
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestListener.java
(from rev 8749,
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestListener.java)
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestListener.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestListener.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,34 @@
+package org.ajax4jsf.bean;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.AjaxContextImpl;
+import org.ajax4jsf.event.AjaxEvent;
+import org.ajax4jsf.event.AjaxListener;
+
+public class TestListener implements AjaxListener {
+
+ @SuppressWarnings("unchecked")
+ public void processAjax(AjaxEvent event) {
+ System.out.println("TestListener");
+ FacesContext context = FacesContext.getCurrentInstance();
+ if (context != null) {
+ AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance(context);
+ if (ajaxContext != null) {
+ Map<String, Object> data = (Map<String,
Object>)ajaxContext.getResponseData();
+ if (null == data) {
+ data = new HashMap<String, Object>();
+ ajaxContext.setResponseData(data);
+ }
+ data.put("FListener", true);
+ }
+
+ }
+
+ }
+
+}
Copied:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TimerBean.java (from
rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TimerBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TimerBean.java 2008-05-26
14:15:36 UTC (rev 8755)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.Date;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class TimerBean {
+
+ private boolean _enabled;
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return _enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ _enabled = enabled;
+ }
+
+ public Date getTimer(){
+ return new Date(System.currentTimeMillis());
+ }
+
+ public String go() {
+ setEnabled(true);
+ return null;
+ }
+
+ public String stop() {
+ setEnabled(false);
+ return null;
+ }
+}