Author: jrthomerson
Date: Sun Feb 20 03:57:11 2011
New Revision: 1072487
URL: http://svn.apache.org/viewvc?rev=1072487&view=rev
Log:
WICKET-3457 - add configure listening methods to behavior resolves for trunk
Modified:
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Component.java
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java
Modified:
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Component.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Component.java?rev=1072487&r1=1072486&r2=1072487&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Component.java
(original)
+++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Component.java Sun
Feb 20 03:57:11 2011
@@ -1142,7 +1142,21 @@ public abstract class Component
{
clearEnabledInHierarchyCache();
clearVisibleInHierarchyCache();
+ for (Behavior behavior : getBehaviors())
+ {
+ if (isBehaviorAccepted(behavior))
+ {
+ behavior.preConfigure(this);
+ }
+ }
onConfigure();
+ for (Behavior behavior : getBehaviors())
+ {
+ if (isBehaviorAccepted(behavior))
+ {
+ behavior.postConfigure(this);
+ }
+ }
setRequestFlag(RFLAG_CONFIGURED, true);
}
}
Modified:
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java?rev=1072487&r1=1072486&r2=1072487&view=diff
==============================================================================
---
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java
(original)
+++
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java
Sun Feb 20 03:57:11 2011
@@ -192,4 +192,29 @@ public abstract class Behavior implement
public void renderHead(Component component, IHeaderResponse response)
{
}
+
+ /**
+ * Called immediately before the onConfigure method in a component.
Since this is before the
+ * rendering cycle has begun, the behavior can modify the configuration
of the component (i.e.
+ * setVisible(false))
+ *
+ * @param component
+ * the component being configured
+ */
+ public void preConfigure(Component component)
+ {
+ }
+
+ /**
+ * Called immediately after the onConfigure method in a component.
Since this is before the
+ * rendering cycle has begun, the behavior can modify the configuration
of the component (i.e.
+ * setVisible(false))
+ *
+ * @param component
+ * the component being configured
+ */
+ public void postConfigure(Component component)
+ {
+ }
+
}
\ No newline at end of file