/** * {@inheritDoc} */ @Override public boolean isTemporary(final Component component) { boolean back = true; for (final Behavior behavior : behaviors_) back = back && behavior.isTemporary(component); return back; }
public void remove(Behavior behavior) { Args.notNull(behavior, "behavior"); if (internalRemove(behavior)) { if (!behavior.isTemporary(component)) { component.addStateChange(); } behavior.detach(component); } else { throw new IllegalStateException( "Tried to remove a behavior that was not added to the component. Behavior: " + behavior.toString()); } }
public void remove(Behavior behavior) { Args.notNull(behavior, "behavior"); if (internalRemove(behavior)) { if (!behavior.isTemporary(component)) { component.addStateChange(); } behavior.detach(component); } else { throw new IllegalStateException( "Tried to remove a behavior that was not added to the component. Behavior: " + behavior.toString()); } }
public void add(Behavior... behaviors) { Args.notNull(behaviors, "behaviors"); for (Behavior behavior : behaviors) { Args.notNull(behavior, "behavior"); internalAdd(behavior); if (!behavior.isTemporary(component)) { component.addStateChange(); } // Give handler the opportunity to bind this component behavior.bind(component); } }
public void add(Behavior... behaviors) { Args.notNull(behaviors, "behaviors"); for (Behavior behavior : behaviors) { Args.notNull(behavior, "behavior"); internalAdd(behavior); if (!behavior.isTemporary(component)) { component.addStateChange(); } // Give handler the opportunity to bind this component behavior.bind(component); } }
/** * THIS IS WICKET INTERNAL ONLY. DO NOT USE IT. * * Traverses all behaviors and calls detachModel() on them. This is needed to cleanup behavior * after render. This method is necessary for {@link org.apache.wicket.ajax.AjaxRequestTarget} to be able to cleanup * component's behaviors after header contribution has been done (which is separated from * component render). */ @Override public final void detach() { int len = component.data_length(); for (int i = component.data_start(); i < len; i++) { Object obj = component.data_get(i); if (obj != null && obj instanceof Behavior) { final Behavior behavior = (Behavior)obj; behavior.detach(component); if (behavior.isTemporary(component)) { internalRemove(behavior); i--; len--; } } } }
/** * THIS IS WICKET INTERNAL ONLY. DO NOT USE IT. * * Traverses all behaviors and calls detachModel() on them. This is needed to cleanup behavior * after render. This method is necessary for {@link org.apache.wicket.ajax.AjaxRequestTarget} to be able to cleanup * component's behaviors after header contribution has been done (which is separated from * component render). */ @Override public final void detach() { int len = component.data_length(); for (int i = component.data_start(); i < len; i++) { Object obj = component.data_get(i); if (obj != null && obj instanceof Behavior) { final Behavior behavior = (Behavior)obj; behavior.detach(component); if (behavior.isTemporary(component)) { internalRemove(behavior); i--; len--; } } } }