Updated Branches: refs/heads/master 755539e84 -> 5cdd8624c
WICKET-5410 Remove setting interfaces Remove IPageSettings interface Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/5cdd8624 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5cdd8624 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5cdd8624 Branch: refs/heads/master Commit: 5cdd8624c28814dfb7920bffcadda28eeccb0006 Parents: 755539e Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Tue Nov 12 11:51:24 2013 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Tue Nov 12 11:51:24 2013 +0200 ---------------------------------------------------------------------- .../java/org/apache/wicket/Application.java | 9 +-- .../src/main/java/org/apache/wicket/Page.java | 3 +- .../apache/wicket/settings/IPageSettings.java | 85 -------------------- .../wicket/settings/def/PageSettings.java | 49 ++++++++--- .../markup/html/link/MountedPageLinkTest.java | 4 +- 5 files changed, 44 insertions(+), 106 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/5cdd8624/wicket-core/src/main/java/org/apache/wicket/Application.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index b7cb8d8..946c420 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -85,7 +85,6 @@ import org.apache.wicket.session.DefaultPageFactory; import org.apache.wicket.session.ISessionStore; import org.apache.wicket.session.ISessionStore.UnboundListener; import org.apache.wicket.settings.IMarkupSettings; -import org.apache.wicket.settings.IPageSettings; import org.apache.wicket.settings.IRequestCycleSettings; import org.apache.wicket.settings.IRequestLoggerSettings; import org.apache.wicket.settings.IResourceSettings; @@ -677,7 +676,7 @@ public abstract class Application implements UnboundListener, IEventSink protected void internalInit() { settingsAccessible = true; - IPageSettings pageSettings = getPageSettings(); + PageSettings pageSettings = getPageSettings(); // Install default component resolvers pageSettings.addComponentResolver(new MarkupInheritanceResolver()); @@ -1035,7 +1034,7 @@ public abstract class Application implements UnboundListener, IEventSink private IMarkupSettings markupSettings; /** The Page Settings */ - private IPageSettings pageSettings; + private PageSettings pageSettings; /** The Request Cycle Settings */ private IRequestCycleSettings requestCycleSettings; @@ -1171,7 +1170,7 @@ public abstract class Application implements UnboundListener, IEventSink /** * @return Application's page related settings */ - public final IPageSettings getPageSettings() + public final PageSettings getPageSettings() { checkSettingsAvailable(); if (pageSettings == null) @@ -1185,7 +1184,7 @@ public abstract class Application implements UnboundListener, IEventSink * * @param pageSettings */ - public final void setPageSettings(final IPageSettings pageSettings) + public final void setPageSettings(final PageSettings pageSettings) { this.pageSettings = pageSettings; } http://git-wip-us.apache.org/repos/asf/wicket/blob/5cdd8624/wicket-core/src/main/java/org/apache/wicket/Page.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/Page.java b/wicket-core/src/main/java/org/apache/wicket/Page.java index bd8763c..7fde290 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Page.java +++ b/wicket-core/src/main/java/org/apache/wicket/Page.java @@ -35,7 +35,6 @@ import org.apache.wicket.pageStore.IPageStore; import org.apache.wicket.request.component.IRequestablePage; import org.apache.wicket.request.cycle.RequestCycle; import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.wicket.settings.IPageSettings; import org.apache.wicket.settings.def.DebugSettings; import org.apache.wicket.util.lang.Classes; import org.apache.wicket.util.lang.Generics; @@ -68,7 +67,7 @@ import org.slf4j.LoggerFactory; * with PageParameters will be used.</li> * <li><b>Versioning </b>- Pages support the browser's back button when versioning is enabled via * {@link #setVersioned(boolean)}. By default all pages are versioned if not configured differently - * in {@link IPageSettings#setVersionPagesByDefault(boolean)}</li> + * in {@link org.apache.wicket.settings.def.PageSettings#setVersionPagesByDefault(boolean)}</li> * </ul> * * @see org.apache.wicket.markup.html.WebPage http://git-wip-us.apache.org/repos/asf/wicket/blob/5cdd8624/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java deleted file mode 100644 index e3d8728..0000000 --- a/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.settings; - -import java.util.List; - -import org.apache.wicket.markup.resolver.IComponentResolver; - - -/** - * Interface for page related settings. - * - * @author Igor Vaynberg (ivaynberg) - * @author Eelco Hillenius - */ -public interface IPageSettings -{ - /** - * Adds a component resolver to the list. - * - * @param resolver - * The {@link IComponentResolver} that is added - */ - void addComponentResolver(IComponentResolver resolver); - - /** - * Get the (modifiable) list of IComponentResolvers. - * - * @return List of ComponentResolvers - */ - List<IComponentResolver> getComponentResolvers(); - - /** - * @return whether all pages should should update their page id when their component hierarchy - * changes somehow - */ - boolean getVersionPagesByDefault(); - - /** - * A global setting that tells the pages to update their page id if their component - * hierarchy changes somehow. This way versioned pages can have several versions - * stored in the page stores and the user can go back and forth through the different - * versions. If a page is not versioned then only its last state is keep in the page - * stores and going back will lead the user to the page before the current one, not - * to the previous state of the current one. - * - * @param pagesVersionedByDefault - * a flag that indicates whether pages should increase their page id when - * their component hierarchy changes somehow. - */ - void setVersionPagesByDefault(boolean pagesVersionedByDefault); - - /** - * When enabled (default), urls on mounted pages will contain the full mount path, including - * PageParameters, allowing wicket to reinstantiate the page if got expired. When disabled, urls - * only use the page id. If this setting is enabled, you should take care that names form fields - * on mounted pages do not clash with the page parameters. - * - * @return if urls on mounted pages should be the full mount path - * @see <a href="https://issues.apache.org/jira/browse/WICKET-4014">WICKET-4014</a> - * @see <a href="https://issues.apache.org/jira/browse/WICKET-4290">WICKET-4290</a> - */ - boolean getRecreateMountedPagesAfterExpiry(); - - /** - * Sets the recreateMountedPagesAfterExpiry setting - * - * @param recreateMountedPagesAfterExpiry - */ - void setRecreateMountedPagesAfterExpiry(boolean recreateMountedPagesAfterExpiry); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/5cdd8624/wicket-core/src/main/java/org/apache/wicket/settings/def/PageSettings.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/def/PageSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/def/PageSettings.java index 94a02e5..4d7d92b 100644 --- a/wicket-core/src/main/java/org/apache/wicket/settings/def/PageSettings.java +++ b/wicket-core/src/main/java/org/apache/wicket/settings/def/PageSettings.java @@ -19,10 +19,11 @@ package org.apache.wicket.settings.def; import java.util.List; import org.apache.wicket.markup.resolver.IComponentResolver; -import org.apache.wicket.settings.IPageSettings; import org.apache.wicket.util.lang.Generics; /** + * Interface for page related settings. + * * @author Jonathan Locke * @author Chris Turner * @author Eelco Hillenius @@ -32,7 +33,7 @@ import org.apache.wicket.util.lang.Generics; * @author Martijn Dashorst * @author James Carman */ -public class PageSettings implements IPageSettings +public class PageSettings { /** List of (static) ComponentResolvers */ private final List<IComponentResolver> componentResolvers = Generics.newArrayList(); @@ -44,48 +45,72 @@ public class PageSettings implements IPageSettings private boolean recreateMountedPagesAfterExpiry = true; /** - * @see org.apache.wicket.settings.IPageSettings#addComponentResolver(org.apache.wicket.markup.resolver.IComponentResolver) + * Adds a component resolver to the list. + * + * @param resolver + * The {@link IComponentResolver} that is added */ - @Override public void addComponentResolver(IComponentResolver resolver) { componentResolvers.add(resolver); } /** - * @see org.apache.wicket.settings.IPageSettings#getComponentResolvers() + * Get the (modifiable) list of IComponentResolvers. + * + * @return List of ComponentResolvers */ - @Override public List<IComponentResolver> getComponentResolvers() { return componentResolvers; } /** - * @see org.apache.wicket.settings.IPageSettings#getVersionPagesByDefault() + * @return whether all pages should should update their page id when their component hierarchy + * changes somehow */ - @Override public boolean getVersionPagesByDefault() { return versionPagesByDefault; } /** - * @see org.apache.wicket.settings.IPageSettings#setVersionPagesByDefault(boolean) + * A global setting that tells the pages to update their page id if their component + * hierarchy changes somehow. This way versioned pages can have several versions + * stored in the page stores and the user can go back and forth through the different + * versions. If a page is not versioned then only its last state is keep in the page + * stores and going back will lead the user to the page before the current one, not + * to the previous state of the current one. + * + * @param pagesVersionedByDefault + * a flag that indicates whether pages should increase their page id when + * their component hierarchy changes somehow. */ - @Override public void setVersionPagesByDefault(boolean pagesVersionedByDefault) { versionPagesByDefault = pagesVersionedByDefault; } - @Override + /** + * When enabled (default), urls on mounted pages will contain the full mount path, including + * PageParameters, allowing wicket to reinstantiate the page if got expired. When disabled, urls + * only use the page id. If this setting is enabled, you should take care that names form fields + * on mounted pages do not clash with the page parameters. + * + * @return if urls on mounted pages should be the full mount path + * @see <a href="https://issues.apache.org/jira/browse/WICKET-4014">WICKET-4014</a> + * @see <a href="https://issues.apache.org/jira/browse/WICKET-4290">WICKET-4290</a> + */ public boolean getRecreateMountedPagesAfterExpiry() { return recreateMountedPagesAfterExpiry; } - @Override + /** + * Sets the recreateMountedPagesAfterExpiry setting + * + * @param recreateMountedPagesAfterExpiry + */ public void setRecreateMountedPagesAfterExpiry(boolean recreateMountedPagesAfterExpiry) { this.recreateMountedPagesAfterExpiry = recreateMountedPagesAfterExpiry; http://git-wip-us.apache.org/repos/asf/wicket/blob/5cdd8624/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java index ae35127..c991172 100644 --- a/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java @@ -23,7 +23,6 @@ import org.apache.wicket.WicketTestCase; import org.apache.wicket.core.request.mapper.PageInstanceMapper; import org.apache.wicket.protocol.http.PageExpiredException; import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.wicket.settings.IPageSettings; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -106,7 +105,8 @@ public class MountedPageLinkTest extends WicketTestCase /** * Tests if the {@link PageInstanceMapper} is used if - * {@link IPageSettings#getRecreateMountedPagesAfterExpiry()} is disabled + * {@link org.apache.wicket.settings.def.PageSettings#getRecreateMountedPagesAfterExpiry()} + * is disabled */ @Test public void testLinkOnPageWithRecreationDisabled()
