Author: Alex.Kolonitsky
Date: 2010-10-29 10:10:56 -0400 (Fri, 29 Oct 2010)
New Revision: 19770
Added:
trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java
trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleListener.java
trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleSource.java
trunk/ui/output/ui/src/main/java/org/richfaces/event/MethodExpressionPanelToggleListener.java
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/PanelToggleListenerHandler.java
Removed:
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandEvent.java
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandListener.java
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandSource.java
trunk/ui/output/ui/src/main/java/org/richfaces/event/MethodExpressionChangeExpandListener.java
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/ChangeExpandListenerHandler.java
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UICollapsiblePanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/CollapsiblePanelTagHandler.java
trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
Log:
RF-9563 collapsiblePanel: refactor server event and listener
Deleted: trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandEvent.java
===================================================================
---
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandEvent.java 2010-10-29
14:05:24 UTC (rev 19769)
+++
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandEvent.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-
-/**
- * @author akolonitsky
- * @since 2010-08-27
- */
-public class ChangeExpandEvent extends FacesEvent {
-
- private final Boolean isExpanded;
-
-
- // ------------------------------------------------------------ Constructors
-
- /**
- * <p>Construct a new event object from the specified source component,
- * old value, and new value.</p>
- *
- * <p>The default {@link javax.faces.event.PhaseId} for this event is {@link
- * javax.faces.event.PhaseId#ANY_PHASE}.</p>
- *
- * @param component Source {@link UIComponent} for this event
- * @param isExpanded
- *
- * @throws IllegalArgumentException if <code>component</code> is
- * <code>null</code>
- */
- public ChangeExpandEvent(UIComponent component, Boolean isExpanded) {
- super(component);
- this.isExpanded = isExpanded;
- }
-
-
- // -------------------------------------------------------------- Properties
-
- public Boolean getExpanded() {
- return isExpanded;
- }
-
- // ------------------------------------------------- Event Broadcast Methods
-
-
- @Override
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof ChangeExpandListener;
- }
-
- /**
- * @throws javax.faces.event.AbortProcessingException {@inheritDoc}
- */
- @Override
- public void processListener(FacesListener listener) {
- ((ChangeExpandListener) listener).processChangeExpand(this);
- }
-}
-
Deleted: trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandListener.java
===================================================================
---
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandListener.java 2010-10-29
14:05:24 UTC (rev 19769)
+++
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandListener.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.event;
-
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesListener;
-
-/**
- * <p>A listener interface for receiving {@link ChangeExpandEvent}s. A class
- * that is interested in receiving such events implements this interface, and
- * then registers itself with the source {@link javax.faces.component.UIComponent} of
interest, by
- * calling <code>addChangeExpandListener()</code>.</p>
- *
- * @author akolonitsky
- * @version 1.0
- * @since 2010-08-27
- *
- */
-public interface ChangeExpandListener extends FacesListener {
-
-
- /**
- * <p>Invoked when {@link ChangeExpandEvent} occurs.</p>
- *
- * @param event The {@link ChangeExpandEvent} that has occurred
- *
- * @throws AbortProcessingException Signal the JavaServer Faces
- * implementation that no further processing on the current event
- * should be performed
- */
- public void processChangeExpand(ChangeExpandEvent event)
- throws AbortProcessingException;
-
-}
Deleted: trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandSource.java
===================================================================
---
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandSource.java 2010-10-29
14:05:24 UTC (rev 19769)
+++
trunk/ui/output/api/src/main/java/org/richfaces/event/ChangeExpandSource.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.event;
-
-/**
- * @author akolonitsky
- * @since 2010-08-27
- */
-public interface ChangeExpandSource {
-
- /**
- * <p>Add a new {@link org.richfaces.event.ChangeExpandListener} to the set of
listeners
- * interested in being notified when {@link org.richfaces.event.ChangeExpandEvent}s
occur.</p>
- *
- * @param listener The {@link org.richfaces.event.ChangeExpandListener} to be added
- * @throws NullPointerException if <code>listener</code>
- * is <code>null</code>
- */
- void addChangeExpandListener(ChangeExpandListener listener);
-
- /**
- * <p>Return the set of registered {@link
org.richfaces.event.ChangeExpandListener}s for this instance.
- * If there are no registered listeners, a zero-length array is returned.</p>
- */
- ChangeExpandListener[] getChangeExpandListeners();
-
- /**
- * <p>Remove an existing {@link org.richfaces.event.ChangeExpandListener} (if
any) from the
- * set of listeners interested in being notified when
- * {@link org.richfaces.event.ChangeExpandEvent}s occur.</p>
- *
- * @param listener The {@link org.richfaces.event.ChangeExpandListener} to be
removed
- * @throws NullPointerException if <code>listener</code>
- * is <code>null</code>
- */
- void removeChangeExpandListener(ChangeExpandListener listener);
-
-}
Added: trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java
(rev 0)
+++ trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-27
+ */
+public class PanelToggleEvent extends FacesEvent {
+
+ private final Boolean isExpanded;
+
+
+ // ------------------------------------------------------------ Constructors
+
+ /**
+ * <p>Construct a new event object from the specified source component,
+ * old value, and new value.</p>
+ *
+ * <p>The default {@link javax.faces.event.PhaseId} for this event is {@link
+ * javax.faces.event.PhaseId#ANY_PHASE}.</p>
+ *
+ * @param component Source {@link UIComponent} for this event
+ * @param isExpanded
+ *
+ * @throws IllegalArgumentException if <code>component</code> is
+ * <code>null</code>
+ */
+ public PanelToggleEvent(UIComponent component, Boolean isExpanded) {
+ super(component);
+ this.isExpanded = isExpanded;
+ }
+
+
+ // -------------------------------------------------------------- Properties
+
+ public Boolean getExpanded() {
+ return isExpanded;
+ }
+
+ // ------------------------------------------------- Event Broadcast Methods
+
+
+ @Override
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof PanelToggleListener;
+ }
+
+ /**
+ * @throws javax.faces.event.AbortProcessingException {@inheritDoc}
+ */
+ @Override
+ public void processListener(FacesListener listener) {
+ ((PanelToggleListener) listener).processPanelToggle(this);
+ }
+}
+
Added: trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleListener.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleListener.java
(rev 0)
+++
trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleListener.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.event;
+
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesListener;
+
+/**
+ * <p>A listener interface for receiving {@link PanelToggleEvent}s. A class
+ * that is interested in receiving such events implements this interface, and
+ * then registers itself with the source {@link javax.faces.component.UIComponent} of
interest, by
+ * calling <code>addPanelToggleListener()</code>.</p>
+ *
+ * @author akolonitsky
+ * @version 1.0
+ * @since 2010-08-27
+ *
+ */
+public interface PanelToggleListener extends FacesListener {
+
+
+ /**
+ * <p>Invoked when {@link PanelToggleEvent} occurs.</p>
+ *
+ * @param event The {@link PanelToggleEvent} that has occurred
+ *
+ * @throws AbortProcessingException Signal the JavaServer Faces
+ * implementation that no further processing on the current event
+ * should be performed
+ */
+ public void processPanelToggle(PanelToggleEvent event)
+ throws AbortProcessingException;
+
+}
Added: trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleSource.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleSource.java
(rev 0)
+++
trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleSource.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.event;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-27
+ */
+public interface PanelToggleSource {
+
+ /**
+ * <p>Add a new {@link PanelToggleListener} to the set of listeners
+ * interested in being notified when {@link PanelToggleEvent}s occur.</p>
+ *
+ * @param listener The {@link PanelToggleListener} to be added
+ * @throws NullPointerException if <code>listener</code>
+ * is <code>null</code>
+ */
+ void addPanelToggleListener(PanelToggleListener listener);
+
+ /**
+ * <p>Return the set of registered {@link PanelToggleListener}s for this
instance.
+ * If there are no registered listeners, a zero-length array is returned.</p>
+ */
+ PanelToggleListener[] getPanelToggleListeners();
+
+ /**
+ * <p>Remove an existing {@link PanelToggleListener} (if any) from the
+ * set of listeners interested in being notified when
+ * {@link PanelToggleEvent}s occur.</p>
+ *
+ * @param listener The {@link PanelToggleListener} to be removed
+ * @throws NullPointerException if <code>listener</code>
+ * is <code>null</code>
+ */
+ void removePanelToggleListener(PanelToggleListener listener);
+
+}
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java 2010-10-29
14:05:24 UTC (rev 19769)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -22,9 +22,9 @@
package org.richfaces.component;
-import org.richfaces.event.ChangeExpandEvent;
-import org.richfaces.event.ChangeExpandListener;
-import org.richfaces.event.ChangeExpandSource;
+import org.richfaces.event.PanelToggleEvent;
+import org.richfaces.event.PanelToggleListener;
+import org.richfaces.event.PanelToggleSource;
import org.richfaces.event.ItemChangeEvent;
import javax.el.MethodExpression;
@@ -35,7 +35,7 @@
* @author akolonitsky
* @since 2010-08-27
*/
-public abstract class AbstractCollapsiblePanel extends UITogglePanel implements
ChangeExpandSource {
+public abstract class AbstractCollapsiblePanel extends UITogglePanel implements
PanelToggleSource {
public static final String COMPONENT_TYPE =
"org.richfaces.CollapsiblePanel";
@@ -92,13 +92,13 @@
public abstract String getHeader();
- public abstract MethodExpression getChangeExpandListener();
+ public abstract MethodExpression getPanelToggleListener();
@Override
public void queueEvent(FacesEvent facesEvent) {
- ChangeExpandEvent event = null;
+ PanelToggleEvent event = null;
if ((facesEvent instanceof ItemChangeEvent) && (facesEvent.getComponent()
== this)) {
- event = new ChangeExpandEvent(this, Boolean.valueOf(((ItemChangeEvent)
facesEvent).getNewItem()));
+ event = new PanelToggleEvent(this, Boolean.valueOf(((ItemChangeEvent)
facesEvent).getNewItem()));
setEventPhase(event);
}
@@ -108,15 +108,15 @@
// ------------------------------------------------ Event Processing Methods
- public void addChangeExpandListener(ChangeExpandListener listener) {
+ public void addPanelToggleListener(PanelToggleListener listener) {
addFacesListener(listener);
}
- public ChangeExpandListener[] getChangeExpandListeners() {
- return (ChangeExpandListener[]) getFacesListeners(ChangeExpandListener.class);
+ public PanelToggleListener[] getPanelToggleListeners() {
+ return (PanelToggleListener[]) getFacesListeners(PanelToggleListener.class);
}
- public void removeChangeExpandListener(ChangeExpandListener listener) {
+ public void removePanelToggleListener(PanelToggleListener listener) {
removeFacesListener(listener);
}
}
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/UICollapsiblePanel.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/UICollapsiblePanel.java 2010-10-29
14:05:24 UTC (rev 19769)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/UICollapsiblePanel.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -32,7 +32,7 @@
public enum PropertyKeys {
header,
- changeExpandListener
+ toggleListener
}
public String getHeader() {
@@ -43,11 +43,11 @@
getStateHelper().put(PropertyKeys.header, header);
}
- public MethodExpression getChangeExpandListener() {
- return (MethodExpression)
getStateHelper().get(PropertyKeys.changeExpandListener);
+ public MethodExpression getPanelToggleListener() {
+ return (MethodExpression) getStateHelper().get(PropertyKeys.toggleListener);
}
- public void setChangeExpandListener(MethodExpression changeExpandListener) {
- getStateHelper().put(PropertyKeys.changeExpandListener, changeExpandListener);
+ public void setPanelToggleListener(MethodExpression panelToggleListener) {
+ getStateHelper().put(PropertyKeys.toggleListener, panelToggleListener);
}
}
Deleted:
trunk/ui/output/ui/src/main/java/org/richfaces/event/MethodExpressionChangeExpandListener.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/event/MethodExpressionChangeExpandListener.java 2010-10-29
14:05:24 UTC (rev 19769)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/event/MethodExpressionChangeExpandListener.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.event;
-
-import javax.el.MethodExpression;
-import javax.faces.event.AbortProcessingException;
-
-/**
- * <p><strong><span
- *
class="changed_modified_2_0">MethodExpressionChangeExpandListener</span></strong>
- * is a {@link ChangeExpandListener} that wraps a {@link
- * MethodExpression}. When it receives a {@link ChangeExpandEvent}, it
- * executes a method on an object identified by the {@link
- * MethodExpression}.</p>
- *
- * @author akolonitsky
- * @version 1.0
- *
- */
-public class MethodExpressionChangeExpandListener extends MethodExpressionEventListener
implements ChangeExpandListener {
-
- public MethodExpressionChangeExpandListener() {
- super();
- }
-
- public MethodExpressionChangeExpandListener(MethodExpression methodExprOneArg) {
- super(methodExprOneArg);
- }
-
- public MethodExpressionChangeExpandListener(MethodExpression methodExprOneArg,
MethodExpression methodExprZeroArg) {
- super(methodExprOneArg, methodExprZeroArg);
- }
-
- // ------------------------------------------------------- Listener Method
-
- public void processChangeExpand(ChangeExpandEvent changeExpandEvent) throws
AbortProcessingException {
- processEvent(changeExpandEvent);
- }
-}
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/event/MethodExpressionPanelToggleListener.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/event/MethodExpressionPanelToggleListener.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/event/MethodExpressionPanelToggleListener.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.event;
+
+import javax.el.MethodExpression;
+import javax.faces.event.AbortProcessingException;
+
+/**
+ * <p><strong><span
+ *
class="changed_modified_2_0">MethodExpressionPanelToggleListener</span></strong>
+ * is a {@link PanelToggleListener} that wraps a {@link
+ * MethodExpression}. When it receives a {@link PanelToggleEvent}, it
+ * executes a method on an object identified by the {@link
+ * MethodExpression}.</p>
+ *
+ * @author akolonitsky
+ * @version 1.0
+ *
+ */
+public class MethodExpressionPanelToggleListener extends MethodExpressionEventListener
implements PanelToggleListener {
+
+ public MethodExpressionPanelToggleListener() {
+ super();
+ }
+
+ public MethodExpressionPanelToggleListener(MethodExpression methodExprOneArg) {
+ super(methodExprOneArg);
+ }
+
+ public MethodExpressionPanelToggleListener(MethodExpression methodExprOneArg,
MethodExpression methodExprZeroArg) {
+ super(methodExprOneArg, methodExprZeroArg);
+ }
+
+ // ------------------------------------------------------- Listener Method
+
+ public void processPanelToggle(PanelToggleEvent panelToggleEvent) throws
AbortProcessingException {
+ processEvent(panelToggleEvent);
+ }
+}
Deleted:
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/ChangeExpandListenerHandler.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/ChangeExpandListenerHandler.java 2010-10-29
14:05:24 UTC (rev 19769)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/ChangeExpandListenerHandler.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.view.facelets.html;
-
-import javax.el.ValueExpression;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.TagConfig;
-
-import org.richfaces.event.ChangeExpandEvent;
-import org.richfaces.event.ChangeExpandListener;
-import org.richfaces.event.ChangeExpandSource;
-import org.richfaces.view.facelets.EventListenerHandler;
-
-/**
- *
- * @author akolonitsky
- * @version 1.0
- */
-public final class ChangeExpandListenerHandler extends EventListenerHandler {
-
- private static class LazyChangeExpandListener extends
LazyEventListener<ChangeExpandListener> implements ChangeExpandListener {
- private static final long serialVersionUID = -391020876192823200L;
-
- LazyChangeExpandListener(String type, ValueExpression binding) {
- super(type, binding);
- }
-
- public void processChangeExpand(ChangeExpandEvent event) throws
AbortProcessingException {
- processEvent(event);
- }
- }
-
- public ChangeExpandListenerHandler(TagConfig config) {
- super(config);
- }
-
- public void applyAttachedObject(FacesContext context, UIComponent parent) {
- ValueExpression expression = null;
- if (this.binding != null) {
- FaceletContext ctx = (FaceletContext)
context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
- expression = this.binding.getValueExpression(ctx,
ChangeExpandListener.class);
- }
-
- ChangeExpandSource source = (ChangeExpandSource) parent;
- source.addChangeExpandListener(new LazyChangeExpandListener(this.listenerType,
expression));
- }
-
- @Override
- public boolean isEventSource(UIComponent comp) {
- return comp instanceof ChangeExpandSource;
- }
-}
-
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/CollapsiblePanelTagHandler.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/CollapsiblePanelTagHandler.java 2010-10-29
14:05:24 UTC (rev 19769)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/CollapsiblePanelTagHandler.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -24,8 +24,8 @@
import org.richfaces.component.AbstractCollapsiblePanel;
-import org.richfaces.event.MethodExpressionChangeExpandListener;
-import org.richfaces.event.ChangeExpandEvent;
+import org.richfaces.event.MethodExpressionPanelToggleListener;
+import org.richfaces.event.PanelToggleEvent;
import javax.faces.view.facelets.ComponentConfig;
import javax.faces.view.facelets.ComponentHandler;
@@ -61,8 +61,8 @@
@Override
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget
meta) {
if (meta.isTargetInstanceOf(AbstractCollapsiblePanel.class)) {
- if ("changeExpandListener".equals(name)) {
- return new ChangeExpandExpressionMetadata(attribute);
+ if ("toggleListener".equals(name)) {
+ return new PanelToggleExpressionMetadata(attribute);
}
}
@@ -70,18 +70,18 @@
}
}
- private static final class ChangeExpandExpressionMetadata extends Metadata {
- private static final Class<?>[] CHANGE_EXPAND_SIG = new Class[]
{ChangeExpandEvent.class };
+ private static final class PanelToggleExpressionMetadata extends Metadata {
+ private static final Class<?>[] CHANGE_EXPAND_SIG = new Class[]
{PanelToggleEvent.class };
private final TagAttribute attr;
- ChangeExpandExpressionMetadata(TagAttribute attr) {
+ PanelToggleExpressionMetadata(TagAttribute attr) {
this.attr = attr;
}
@Override
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractCollapsiblePanel) instance).addChangeExpandListener(new
MethodExpressionChangeExpandListener(
+ ((AbstractCollapsiblePanel) instance).addPanelToggleListener(new
MethodExpressionPanelToggleListener(
this.attr.getMethodExpression(ctx, null,
CHANGE_EXPAND_SIG)));
}
}
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/PanelToggleListenerHandler.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/PanelToggleListenerHandler.java
(rev 0)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/PanelToggleListenerHandler.java 2010-10-29
14:10:56 UTC (rev 19770)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.view.facelets.html;
+
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagConfig;
+
+import org.richfaces.event.PanelToggleEvent;
+import org.richfaces.event.PanelToggleListener;
+import org.richfaces.event.PanelToggleSource;
+import org.richfaces.view.facelets.EventListenerHandler;
+
+/**
+ *
+ * @author akolonitsky
+ * @version 1.0
+ */
+public final class PanelToggleListenerHandler extends EventListenerHandler {
+
+ private static class LazyPanelToggleListener extends
LazyEventListener<PanelToggleListener> implements PanelToggleListener {
+ private static final long serialVersionUID = -391020876192823200L;
+
+ LazyPanelToggleListener(String type, ValueExpression binding) {
+ super(type, binding);
+ }
+
+ public void processPanelToggle(PanelToggleEvent event) throws
AbortProcessingException {
+ processEvent(event);
+ }
+ }
+
+ public PanelToggleListenerHandler(TagConfig config) {
+ super(config);
+ }
+
+ public void applyAttachedObject(FacesContext context, UIComponent parent) {
+ ValueExpression expression = null;
+ if (this.binding != null) {
+ FaceletContext ctx = (FaceletContext)
context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
+ expression = this.binding.getValueExpression(ctx,
PanelToggleListener.class);
+ }
+
+ PanelToggleSource source = (PanelToggleSource) parent;
+ source.addPanelToggleListener(new LazyPanelToggleListener(this.listenerType,
expression));
+ }
+
+ @Override
+ public boolean isEventSource(UIComponent comp) {
+ return comp instanceof PanelToggleSource;
+ }
+}
+
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-29 14:05:24
UTC (rev 19769)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-29 14:10:56
UTC (rev 19770)
@@ -166,7 +166,7 @@
</property>
<property>
<description></description>
- <property-name>changeExpandListener</property-name>
+ <property-name>toggleListener</property-name>
<property-class>javax.el.MethodExpression</property-class>
</property>
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-29 14:05:24 UTC
(rev 19769)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-29 14:10:56 UTC
(rev 19770)
@@ -320,7 +320,7 @@
</attribute>
<attribute>
<description></description>
- <name>changeExpandListener</name>
+ <name>panelToggleListener</name>
<type>javax.el.MethodExpression</type>
</attribute>
<attribute>
@@ -422,16 +422,16 @@
</tag>
<tag>
<description>
- Register a ChangeExpandListener instance on the UIComponent
+ Register a PanelToggleListener instance on the UIComponent
associated with the closest parent UIComponent custom
action.
</description>
- <tag-name>changeExpandListener</tag-name>
-
<handler-class>org.richfaces.view.facelets.html.ChangeExpandListenerHandler</handler-class>
+ <tag-name>panelToggleListener</tag-name>
+
<handler-class>org.richfaces.view.facelets.html.PanelToggleListenerHandler</handler-class>
<attribute>
<description>
Fully qualified Java class name of a
- ChangeExpandListener to be created and registered.
+ PanelToggleListener to be created and registered.
</description>
<name>type</name>
<type>java.lang.String</type>
@@ -439,11 +439,11 @@
<attribute>
<description>
Value binding expression that evaluates to an object that
- implements org.richfaces.event.ChangeExpandListener.
+ implements org.richfaces.event.PanelToggleListener.
</description>
<name>binding</name>
<required>false</required>
- <type>org.richfaces.event.ChangeExpandListener</type>
+ <type>org.richfaces.event.PanelToggleListener</type>
</attribute>
<attribute>
<description>