Fix #setPreventDefault and #isPreventDefault's javadoc. Add back #setAllowDefault and #isAllowDefault as deprecated for easier migration to 7.x
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/7c2f79a6 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/7c2f79a6 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/7c2f79a6 Branch: refs/heads/master Commit: 7c2f79a6f2f84ee970729205f5e574c23340c4e1 Parents: c97f577 Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Sun Feb 2 10:17:29 2014 +0100 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Sun Feb 2 10:17:29 2014 +0100 ---------------------------------------------------------------------- .../ajax/attributes/AjaxRequestAttributes.java | 54 ++++++++++++++------ 1 file changed, 37 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/7c2f79a6/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java index b8b4e2e..9eff742 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java @@ -289,14 +289,14 @@ public final class AjaxRequestAttributes } /** - * Only applies for event behaviors. Returns whether the behavior should allow the default event + * Only applies for event behaviors. Returns whether the behavior should prevent the default event * handler to be invoked. For example if the behavior is attached to a link and - * {@link #isPreventDefault()} returns <code>false</code> (which is default value), the link's + * isPreventDefault() returns <code>true</code>, the link's * URL will not be followed. If the Ajax behavior is attached to a checkbox or a radio button * then the default behavior should be allowed to actually check the box or radio button, i.e. - * this method should return <code>true</code>. + * this method should return <code>false</code>. * - * @return {@code true} if the default event handler should be invoked, {@code false} otherwise. + * @return {@code false} if the default event handler should be invoked */ public boolean isPreventDefault() { @@ -304,20 +304,11 @@ public final class AjaxRequestAttributes } /** - * Only applies for event behaviors. Returns whether the behavior should allow the JavaScript - * event to propagate to the parent of its target. - */ - public EventPropagation getEventPropagation() - { - return eventPropagation; - } - - /** - * Only applies for event behaviors. Determines whether the behavior should allow the default + * Only applies for event behaviors. Determines whether the behavior should prevent the default * event handler to be invoked. - * + * * @see #isPreventDefault() - * + * * @param preventDefault * @return {@code this} object for chaining * @see #isPreventDefault() @@ -329,6 +320,35 @@ public final class AjaxRequestAttributes } /** + * @return {@code this} object for chaining + * @deprecated Use #setPreventDefault() instead + */ + @Deprecated + public AjaxRequestAttributes setAllowDefault(boolean allowDefault) + { + this.preventDefault = !allowDefault; + return this; + } + + /** + * @deprecated Use #isPreventDefault() instead + */ + @Deprecated + public boolean isAllowDefault() + { + return !preventDefault; + } + + /** + * Only applies for event behaviors. Returns whether the behavior should allow the JavaScript + * event to propagate to the parent of its target. + */ + public EventPropagation getEventPropagation() + { + return eventPropagation; + } + + /** * Only applies to event behaviors. Determines whether the behavior should allow the JavaScript * event to propagate to the parent of its target. * @@ -502,4 +522,4 @@ public final class AjaxRequestAttributes return this; } -} \ No newline at end of file +}
