Repository: wicket
Updated Branches:
  refs/heads/master e0335bbb5 -> cb78e3fc6


Minor simplifications in ModalWindow:

- remove implicit modifiers for static inner classes and their methods
- remove overrides of #getCallbackScript() method - it is public in the parent 
already
- Appendable - append char instead of String when possible


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/cb78e3fc
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/cb78e3fc
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/cb78e3fc

Branch: refs/heads/master
Commit: cb78e3fc62052f188b48d9eb72874430c18a4e96
Parents: e0335bb
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Sat Dec 12 23:18:36 2015 +0100
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Sat Dec 12 23:18:36 2015 +0100

----------------------------------------------------------------------
 .../ajax/markup/html/modal/ModalWindow.java     | 35 ++++++--------------
 1 file changed, 10 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/cb78e3fc/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
----------------------------------------------------------------------
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
index 6009548..427c83c 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
@@ -173,14 +173,14 @@ public class ModalWindow extends Panel
         * 
         * @author Matej Knopp
         */
-       public static interface PageCreator extends IClusterable
+       public interface PageCreator extends IClusterable
        {
                /**
                 * Creates a new instance of content page.
                 * 
                 * @return new page instance
                 */
-               public Page createPage();
+               Page createPage();
        }
 
        /**
@@ -191,7 +191,7 @@ public class ModalWindow extends Panel
         * 
         * @author Matej Knopp
         */
-       public static interface CloseButtonCallback extends IClusterable
+       public interface CloseButtonCallback extends IClusterable
        {
                /**
                 * Methods invoked after the button has been clicked. The 
invocation is done using an ajax
@@ -204,7 +204,7 @@ public class ModalWindow extends Panel
                 * 
                 * @return True if the window can be closed (will close the 
window), false otherwise
                 */
-               public boolean onCloseButtonClicked(AjaxRequestTarget target);
+               boolean onCloseButtonClicked(AjaxRequestTarget target);
        }
 
        /**
@@ -214,7 +214,7 @@ public class ModalWindow extends Panel
         * 
         * @author Matej Knopp
         */
-       public static interface WindowClosedCallback extends IClusterable
+       public interface WindowClosedCallback extends IClusterable
        {
                /**
                 * Called after the window has been closed.
@@ -223,7 +223,7 @@ public class ModalWindow extends Panel
                 *            <code>{@link 
org.apache.wicket.ajax.AjaxRequestTarget}</code> instance bound
                 *            with the ajax request.
                 */
-               public void onClose(AjaxRequestTarget target);
+               void onClose(AjaxRequestTarget target);
        }
 
        /**
@@ -972,12 +972,6 @@ public class ModalWindow extends Panel
                }
 
                @Override
-               public CharSequence getCallbackScript()
-               {
-                       return super.getCallbackScript();
-               }
-
-               @Override
                protected void updateAjaxAttributes(AjaxRequestAttributes 
attributes)
                {
                        super.updateAjaxAttributes(attributes);
@@ -1003,21 +997,12 @@ public class ModalWindow extends Panel
                protected final void respond(final AjaxRequestTarget target)
                {
                        if ((closeButtonCallback == null) ||
-                               
(closeButtonCallback.onCloseButtonClicked(target) == true))
+                               
(closeButtonCallback.onCloseButtonClicked(target)))
                        {
                                close(target);
                        }
                }
 
-               /**
-                * @see 
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getCallbackScript()
-                */
-               @Override
-               public final CharSequence getCallbackScript()
-               {
-                       return super.getCallbackScript();
-               }
-
                @Override
                protected void updateAjaxAttributes(AjaxRequestAttributes 
attributes)
                {
@@ -1051,7 +1036,7 @@ public class ModalWindow extends Panel
        {
                AppendingStringBuffer buffer = new AppendingStringBuffer(500);
 
-               if (isCustomComponent() == true)
+               if (isCustomComponent())
                {
                        buffer.append("var element = 
document.getElementById(\"");
                        buffer.append(getContentMarkupId());
@@ -1175,7 +1160,7 @@ public class ModalWindow extends Panel
        private void appendAssignment(final AppendingStringBuffer buffer, final 
CharSequence key,
                final int value)
        {
-               buffer.append(key).append("=");
+               buffer.append(key).append('=');
                buffer.append(value);
                buffer.append(";\n");
        }
@@ -1189,7 +1174,7 @@ public class ModalWindow extends Panel
        private void appendAssignment(final AppendingStringBuffer buffer, final 
CharSequence key,
                final boolean value)
        {
-               buffer.append(key).append("=");
+               buffer.append(key).append('=');
                buffer.append(Boolean.toString(value));
                buffer.append(";\n");
        }

Reply via email to