org.wicketstuff.jwicket.ComponentFinder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wicketstuff-jwicket-core Show documentation
Show all versions of wicketstuff-jwicket-core Show documentation
WicketJQuery by Stefan Lindner has been renamed to jWicket, mavenized, and migrated
to WicketStuff. This Wicketstuff version supercedes the original version which was available
at http://subversion.visionet.de/project/WicketJQuery/wiki
package org.wicketstuff.jwicket;
import org.apache.wicket.Component;
import org.apache.wicket.util.visit.IVisit;
import org.apache.wicket.util.visit.IVisitor;
import java.io.Serializable;
/**
* Find a page's child component by it's markup id
*/
public class ComponentFinder implements IVisitor, Serializable {
private static final long serialVersionUID = 1L;
private final String markupId;
public ComponentFinder(String markupId) {
this.markupId = markupId;
}
@Override
public void component(Component component, IVisit visit) {
if (component.getMarkupId().equals(getMarkupId())) {
visit.stop(component);
}
}
private String getMarkupId() {
return this.markupId;
}
}