本文整理汇总了Java中org.apache.wicket.MarkupContainer.visitChildren方法的典型用法代码示例。如果您正苦于以下问题:Java MarkupContainer.visitChildren方法的具体用法?Java MarkupContainer.visitChildren怎么用?Java MarkupContainer.visitChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.MarkupContainer
的用法示例。
在下文中一共展示了MarkupContainer.visitChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isHiddenByModalContainer
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
protected boolean isHiddenByModalContainer() {
final MarkupContainer markupContainer = getContext().getMarkupContainer();
final ModalContainer parentModalContainer = markupContainer.findParent(ModalContainer.class);
if (parentModalContainer != null && !parentModalContainer.isShowing()) {
//this modal container is not showing this component currently
return true;
}
final Boolean showingChildModalContainerFound = markupContainer.visitChildren(ModalContainer.class,
new IVisitor<ModalContainer, Boolean>() {
@Override
public void component(final ModalContainer object, final IVisit<Boolean> visit) {
if (object.isShowing()) {
//a child modal container is blocking this component currently
visit.stop(true);
}
}
});
return showingChildModalContainerFound != null && showingChildModalContainerFound;
}
示例2: updateAllComponents
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
private void updateAllComponents(final Component component) {
final AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class);
final Form<?> form = Components.findForm(component);
if (target != null && form != null) {
final MarkupContainer root = (MarkupContainer) Components.findRoot(form);
try {
root.visitChildren(new IVisitor<Component, Void>() {
@Override
public void component(final Component object, final IVisit<Void> visit) {
if (object instanceof Form || object instanceof TabbedPanel
|| object instanceof ModalContainer) {
target.add(object);
}
if (!object.isVisible()) {
final List<ModelComponentBehavior> modelComponentBehaviors = object
.getBehaviors(ModelComponentBehavior.class);
for (final ModelComponentBehavior behavior : modelComponentBehaviors) {
//update visibility manually since onConfigure() will be skipped
behavior.onConfigure(object);
}
}
}
});
} catch (final Throwable t) {
if (t.getMessage().contains("longer be added")) {
if (LOG.isDebugEnabled()) {
LOG.warn(FROZEN_COMPONENTS_LOG_MESSAGE, Throwables.getFullStackTrace(t));
} else if (LOG.isWarnEnabled()) {
LOG.warn(FROZEN_COMPONENTS_LOG_MESSAGE, Throwables.concatMessages(t));
}
} else {
throw t;
}
}
}
}
示例3: findChildComponent
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
public static <T extends Component> T findChildComponent(final Class<T> componentType,
final MarkupContainer fromComponent) {
return fromComponent.visitChildren(componentType, new IVisitor<T, T>() {
@Override
public void component(final T object, final IVisit<T> visit) {
visit.stop(object);
}
});
}
示例4: loadChildren
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
public static void loadChildren(MarkupContainer container) {
container.visitChildren(FormComponent.class, new IVisitor<FormComponent, Void>() {
@Override
public void component(FormComponent formComponent, IVisit iVisit) {
if (isPersistent(formComponent)) {
load(formComponent);
}
}
});
}
示例5: saveChildren
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
public static void saveChildren(MarkupContainer container) {
container.visitChildren(FormComponent.class, new IVisitor<FormComponent, Void>() {
@Override
public void component(FormComponent formComponent, IVisit iVisit) {
if (isPersistent(formComponent)) {
save(formComponent);
}
}
});
}
示例6: disableAll
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
private static void disableAll(MarkupContainer container) {
container.setEnabled(false);
container.visitChildren(new SetEnableVisitor(false));
}