diff --git a/src/main/java/org/olat/core/gui/components/Window.java b/src/main/java/org/olat/core/gui/components/Window.java index 2afff22e991bef71d66516157c16dc7a5002a6c7..26ec7442088a45331c7a4edce791b95d3261e3d4 100644 --- a/src/main/java/org/olat/core/gui/components/Window.java +++ b/src/main/java/org/olat/core/gui/components/Window.java @@ -70,7 +70,6 @@ import org.olat.core.gui.render.ValidationResult; import org.olat.core.gui.render.intercept.InterceptHandler; import org.olat.core.gui.render.intercept.InterceptHandlerInstance; import org.olat.core.gui.themes.Theme; -import org.olat.core.gui.util.ReusableURLHelper; import org.olat.core.helpers.Settings; import org.olat.core.id.context.BusinessControl; import org.olat.core.id.context.BusinessControlFactory; @@ -1126,7 +1125,7 @@ public class Window extends Container { target = cur; } else { String childName = res[0]; // Pre: all paths have at least one entry - List<Component> founds = ReusableURLHelper.findComponentsWithChildName(childName, getContentPane()); + List<Component> founds = findComponentsWithChildName(childName, getContentPane()); int foundsCnt = founds.size(); if (foundsCnt == 1) { // unique -> high probability that the recorded link is still the same @@ -1226,6 +1225,22 @@ public class Window extends Container { } return toDispatch; } + + private List<Component> findComponentsWithChildName(final String childName, Component searchRoot) { + final List<Component> founds = new ArrayList<Component>(); + ComponentTraverser ct = new ComponentTraverser(new ComponentVisitor(){ + public boolean visit(Component comp, UserRequest ureq) { + if(comp.getParent()==null){ + return true; + } + if (comp.getParent().getComponent(childName) == comp) { + founds.add(comp); + } + return true; + }}, searchRoot, true); + ct.visitAll(null); + return founds; + } /** diff --git a/src/main/java/org/olat/core/gui/util/ReusableURLHelper.java b/src/main/java/org/olat/core/gui/util/ReusableURLHelper.java deleted file mode 100644 index 97981e6ab1b5ccf48a9096d5d73f1bda8496c07f..0000000000000000000000000000000000000000 --- a/src/main/java/org/olat/core/gui/util/ReusableURLHelper.java +++ /dev/null @@ -1,62 +0,0 @@ -/** -* OLAT - Online Learning and Training<br> -* http://www.olat.org -* <p> -* Licensed under the Apache License, Version 2.0 (the "License"); <br> -* you may not use this file except in compliance with the License.<br> -* You may obtain a copy of the License at -* <p> -* http://www.apache.org/licenses/LICENSE-2.0 -* <p> -* Unless required by applicable law or agreed to in writing,<br> -* software distributed under the License is distributed on an "AS IS" BASIS, <br> -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> -* See the License for the specific language governing permissions and <br> -* limitations under the License. -* <p> -* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br> -* University of Zurich, Switzerland. -* <hr> -* <a href="http://www.openolat.org"> -* OpenOLAT - Online Learning and Training</a><br> -* This file has been modified by the OpenOLAT community. Changes are licensed -* under the Apache 2.0 license as the original file. -* <p> -*/ -package org.olat.core.gui.util; - -import java.util.ArrayList; -import java.util.List; - -import org.olat.core.gui.UserRequest; -import org.olat.core.gui.components.Component; -import org.olat.core.util.component.ComponentTraverser; -import org.olat.core.util.component.ComponentVisitor; - -/** - * @author Felix Jost, http://www.goodsolutions.ch - * - */ -public class ReusableURLHelper { - /** - * Used only for load-test-mode identification of the correct component when the full path matching failed. - * @param childName - * @param searchRoot - * @return a List of Components which are added in parent using the name childName, that is, where something like container.put(childName,...) has taken place - */ - public static List<Component> findComponentsWithChildName(final String childName, Component searchRoot) { - final List<Component> founds = new ArrayList<Component>(); - ComponentTraverser ct = new ComponentTraverser(new ComponentVisitor(){ - public boolean visit(Component comp, UserRequest ureq) { - if(comp.getParent()==null){ - return true; - } - if (comp.getParent().getComponent(childName) == comp) { - founds.add(comp); - } - return true; - }}, searchRoot, true); - ct.visitAll(null); - return founds; - } -}