Repository: wicket
Updated Branches:
  refs/heads/wicket-6.x c092d05b5 -> 9a123fa34


WICKET-5646 allow stop search at component

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/9a123fa3
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/9a123fa3
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/9a123fa3

Branch: refs/heads/wicket-6.x
Commit: 9a123fa341da10bd2af0f1eede568d968820b26d
Parents: c092d05
Author: svenmeier <[email protected]>
Authored: Wed Jul 16 21:26:07 2014 +0200
Committer: svenmeier <[email protected]>
Committed: Wed Jul 16 21:26:07 2014 +0200

----------------------------------------------------------------------
 .../loader/ComponentStringResourceLoader.java      | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/9a123fa3/wicket-core/src/main/java/org/apache/wicket/resource/loader/ComponentStringResourceLoader.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/resource/loader/ComponentStringResourceLoader.java
 
b/wicket-core/src/main/java/org/apache/wicket/resource/loader/ComponentStringResourceLoader.java
index f549983..834b9a5 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/resource/loader/ComponentStringResourceLoader.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/resource/loader/ComponentStringResourceLoader.java
@@ -309,12 +309,29 @@ public class ComponentStringResourceLoader implements 
IStringResourceLoader
                while (component != null)
                {
                        path.add(0, component);
+                       if (isStopResourceSearch(component))
+                       {
+                               break;
+                       }
                        component = component.getParent();
                }
                return path;
        }
 
        /**
+        * Check the supplied component to see if it is one that we shouldn't 
bother further searches up
+        * the component hierarchy for properties.
+        * 
+        * @param component
+        *            The component to check
+        * @return Whether to stop the search
+        */
+       protected boolean isStopResourceSearch(Component component)
+       {
+               return false;
+       }
+
+       /**
         * Check the supplied class to see if it is one that we shouldn't 
bother further searches up the
         * class hierarchy for properties.
         * 

Reply via email to