Author: abelevich
Date: 2010-05-26 13:40:27 -0400 (Wed, 26 May 2010)
New Revision: 17287
Added:
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionFilteringListener.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionSortingListener.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionToggleListener.java
Log:
add MethodExpression listeners
Added:
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionFilteringListener.java
===================================================================
---
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionFilteringListener.java
(rev 0)
+++
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionFilteringListener.java 2010-05-26
17:40:27 UTC (rev 17287)
@@ -0,0 +1,26 @@
+package org.richfaces.taglib;
+
+import javax.el.MethodExpression;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.event.FilteringEvent;
+import org.richfaces.event.FilteringListener;
+
+public class MethodExpressionFilteringListener implements FilteringListener {
+
+ private MethodExpression methodExpression;
+
+ public MethodExpressionFilteringListener() {
+ super();
+ }
+
+ MethodExpressionFilteringListener(MethodExpression methodExpression) {
+ super();
+ this.methodExpression = methodExpression;
+ }
+
+ public void processFiltering(FilteringEvent filteringEvent) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ methodExpression.invoke(facesContext.getELContext(), new
Object[]{filteringEvent});
+ }
+}
Added:
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionSortingListener.java
===================================================================
---
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionSortingListener.java
(rev 0)
+++
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionSortingListener.java 2010-05-26
17:40:27 UTC (rev 17287)
@@ -0,0 +1,26 @@
+package org.richfaces.taglib;
+
+import javax.el.MethodExpression;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.event.SortingEvent;
+import org.richfaces.event.SortingListener;
+
+public class MethodExpressionSortingListener implements SortingListener {
+
+ private MethodExpression methodExpression;
+
+ public MethodExpressionSortingListener() {
+ super();
+ }
+
+ MethodExpressionSortingListener(MethodExpression methodExpression) {
+ super();
+ this.methodExpression = methodExpression;
+ }
+
+ public void processSorting(SortingEvent sortingEvent) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ methodExpression.invoke(facesContext.getELContext(), new
Object[]{sortingEvent});
+ }
+}
Added:
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionToggleListener.java
===================================================================
---
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionToggleListener.java
(rev 0)
+++
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/taglib/MethodExpressionToggleListener.java 2010-05-26
17:40:27 UTC (rev 17287)
@@ -0,0 +1,26 @@
+package org.richfaces.taglib;
+
+import javax.el.MethodExpression;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.event.ToggleEvent;
+import org.richfaces.event.ToggleListener;
+
+public class MethodExpressionToggleListener implements ToggleListener {
+
+ private MethodExpression methodExpression;
+
+ public MethodExpressionToggleListener() {
+ super();
+ }
+
+ MethodExpressionToggleListener(MethodExpression methodExpression) {
+ super();
+ this.methodExpression = methodExpression;
+ }
+
+ public void processToggle(ToggleEvent toggleEvent) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ methodExpression.invoke(facesContext.getELContext(), new Object[]{toggleEvent});
+ }
+}