Author: ivaynberg
Date: Wed Nov 23 21:41:53 2011
New Revision: 1205616
URL: http://svn.apache.org/viewvc?rev=1205616&view=rev
Log:
move setrenderallowed() check into a more intuitive place
Issue: WICKET-4256
Modified:
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Component.java
Modified:
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Component.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Component.java?rev=1205616&r1=1205615&r2=1205616&view=diff
==============================================================================
---
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Component.java
(original)
+++
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Component.java
Wed Nov 23 21:41:53 2011
@@ -971,9 +971,6 @@ public abstract class Component
{
configure();
- // check authorization
- setRenderAllowed();
-
if ((determineVisibility()) && !getFlag(FLAG_RENDERING) &&
!getFlag(FLAG_PREPARED_FOR_RENDER))
{
@@ -1089,6 +1086,10 @@ public abstract class Component
behavior.onConfigure(this);
}
}
+
+ // check authorization
+ setRenderAllowed();
+
setRequestFlag(RFLAG_CONFIGURED, true);
}
}
@@ -4335,8 +4336,8 @@ public abstract class Component
}
- /**
- * TODO WICKET-NG javadoc
+ /**
+ * TODO WICKET-NG javadoc
*
* @deprecated use {@link #canCallListenerInterface(Method)} instead
*/
@@ -4345,20 +4346,32 @@ public abstract class Component
{
return true;
}
-
+
/**
- * Checks whether or not a listener method can be invoked on this
component. Usually components deny these invocations if they are either
invisible or disabled in hierarchy. Components can examine which listener
interface is being invoked by examining the declaring class of the passed in
{@literal method} parameter.
+ * Checks whether or not a listener method can be invoked on this
component. Usually components
+ * deny these invocations if they are either invisible or disabled in
hierarchy. Components can
+ * examine which listener interface is being invoked by examining the
declaring class of the
+ * passed in {@literal method} parameter.
* <p>
- * WARNING: be careful when overriding this method because it may open
security holes - such as allowing a user to click on a link that should be
disabled.
+ * WARNING: be careful when overriding this method because it may open
security holes - such as
+ * allowing a user to click on a link that should be disabled.
* </p>
* <p>
- * Example usecase for overriding: Suppose you are building an
component that displays images. The component generates a callback to itself
using {@link IRequestListener} interface and uses this callback to stream image
data. If such a component is placed inside a disable webmarkupcontainer we
still want to allow the invocation of the request listener callback method so
that image data can be streamed. Such a component would override this method
and return {@literal true} if the listener method belongs to {@link
IRequestListener}.
+ * Example usecase for overriding: Suppose you are building an
component that displays images.
+ * The component generates a callback to itself using {@link
IRequestListener} interface and
+ * uses this callback to stream image data. If such a component is
placed inside a disable
+ * webmarkupcontainer we still want to allow the invocation of the
request listener callback
+ * method so that image data can be streamed. Such a component would
override this method and
+ * return {@literal true} if the listener method belongs to {@link
IRequestListener}.
* </p>
- * @param method listener method about to be invoked on this component
+ *
+ * @param method
+ * listener method about to be invoked on this component
*
* @return {@literal true} iff the listener method can be invoked on
this component
*/
- public boolean canCallListenerInterface(Method method) {
+ public boolean canCallListenerInterface(Method method)
+ {
return isEnabledInHierarchy() && isVisibleInHierarchy();
}