Repository: wicket Updated Branches: refs/heads/master 1c517a264 -> ea82a6b1c
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/ea82a6b1 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ea82a6b1 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ea82a6b1 Branch: refs/heads/master Commit: ea82a6b1ca8658f44d840ce74eb72252368d25ab Parents: 1c517a2 Author: svenmeier <[email protected]> Authored: Wed Jul 16 21:26:16 2014 +0200 Committer: svenmeier <[email protected]> Committed: Wed Jul 16 21:26:16 2014 +0200 ---------------------------------------------------------------------- .../loader/ComponentStringResourceLoader.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/ea82a6b1/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. *
