Updated Branches: refs/heads/master c673ebbe1 -> b5e4574b1
WICKET-5410 Remove setting interfaces Remove IDebugSettings interface Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b5e4574b Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b5e4574b Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b5e4574b Branch: refs/heads/master Commit: b5e4574b1b135249dee7860e1f52b2a2af34b641 Parents: c673ebb Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Tue Nov 12 11:18:39 2013 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Tue Nov 12 11:18:39 2013 +0200 ---------------------------------------------------------------------- .../java/org/apache/wicket/Application.java | 7 +- .../main/java/org/apache/wicket/Component.java | 4 +- .../java/org/apache/wicket/MarkupContainer.java | 4 +- .../src/main/java/org/apache/wicket/Page.java | 4 +- .../resource/CoreLibrariesContributor.java | 4 +- .../apache/wicket/settings/IDebugSettings.java | 143 ------------------- .../wicket/settings/def/DebugSettings.java | 102 ++++++++----- .../apache/wicket/jmx/DebugSettingsMBean.java | 6 +- 8 files changed, 80 insertions(+), 194 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/b5e4574b/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 cca97d1..a2b5947 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -84,7 +84,6 @@ import org.apache.wicket.response.filter.EmptySrcAttributeCheckFilter; import org.apache.wicket.session.DefaultPageFactory; import org.apache.wicket.session.ISessionStore; import org.apache.wicket.session.ISessionStore.UnboundListener; -import org.apache.wicket.settings.IDebugSettings; import org.apache.wicket.settings.IExceptionSettings; import org.apache.wicket.settings.IFrameworkSettings; import org.apache.wicket.settings.IJavaScriptLibrarySettings; @@ -1027,7 +1026,7 @@ public abstract class Application implements UnboundListener, IEventSink private IJavaScriptLibrarySettings javaScriptLibrarySettings; /** Debug Settings */ - private IDebugSettings debugSettings; + private DebugSettings debugSettings; /** Exception Settings */ private IExceptionSettings exceptionSettings; @@ -1109,7 +1108,7 @@ public abstract class Application implements UnboundListener, IEventSink /** * @return Application's debug related settings */ - public final IDebugSettings getDebugSettings() + public final DebugSettings getDebugSettings() { checkSettingsAvailable(); if (debugSettings == null) @@ -1123,7 +1122,7 @@ public abstract class Application implements UnboundListener, IEventSink * * @param debugSettings */ - public final void setDebugSettings(final IDebugSettings debugSettings) + public final void setDebugSettings(final DebugSettings debugSettings) { this.debugSettings = debugSettings; } http://git-wip-us.apache.org/repos/asf/wicket/blob/b5e4574b/wicket-core/src/main/java/org/apache/wicket/Component.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java index b78f8bf..413e80c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -78,7 +78,7 @@ import org.apache.wicket.request.cycle.RequestCycle; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.request.resource.ResourceReference; import org.apache.wicket.response.StringResponse; -import org.apache.wicket.settings.IDebugSettings; +import org.apache.wicket.settings.def.DebugSettings; import org.apache.wicket.util.IHierarchical; import org.apache.wicket.util.convert.IConverter; import org.apache.wicket.util.io.IClusterable; @@ -681,7 +681,7 @@ public abstract class Component setId(id); getApplication().getComponentInstantiationListeners().onInstantiation(this); - final IDebugSettings debugSettings = getApplication().getDebugSettings(); + final DebugSettings debugSettings = getApplication().getDebugSettings(); if (debugSettings.isLinePreciseReportingOnNewComponentEnabled() && debugSettings.getComponentUseCheck()) { setMetaData(CONSTRUCTED_AT_KEY, http://git-wip-us.apache.org/repos/asf/wicket/blob/b5e4574b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java index 063fc10..e5a1580 100644 --- a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java +++ b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java @@ -40,7 +40,7 @@ import org.apache.wicket.markup.resolver.ComponentResolvers; import org.apache.wicket.model.IComponentInheritedModel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.IWrapModel; -import org.apache.wicket.settings.IDebugSettings; +import org.apache.wicket.settings.def.DebugSettings; import org.apache.wicket.util.io.IClusterable; import org.apache.wicket.util.iterator.ComponentHierarchyIterator; import org.apache.wicket.util.lang.Args; @@ -912,7 +912,7 @@ public abstract class MarkupContainer extends Component implements Iterable<Comp // Set child's parent child.setParent(this); - final IDebugSettings debugSettings = Application.get().getDebugSettings(); + final DebugSettings debugSettings = Application.get().getDebugSettings(); if (debugSettings.isLinePreciseReportingOnAddComponentEnabled() && debugSettings.getComponentUseCheck()) { http://git-wip-us.apache.org/repos/asf/wicket/blob/b5e4574b/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 10de44f..bd8763c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Page.java +++ b/wicket-core/src/main/java/org/apache/wicket/Page.java @@ -35,8 +35,8 @@ 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.IDebugSettings; 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; import org.apache.wicket.util.string.StringValue; @@ -563,7 +563,7 @@ public abstract class Page extends MarkupContainer implements IRedirectListener, { // If the application wants component uses checked and // the response is not a redirect - final IDebugSettings debugSettings = getApplication().getDebugSettings(); + final DebugSettings debugSettings = getApplication().getDebugSettings(); if (debugSettings.getComponentUseCheck()) { final List<Component> unrenderedComponents = new ArrayList<Component>(); http://git-wip-us.apache.org/repos/asf/wicket/blob/b5e4574b/wicket-core/src/main/java/org/apache/wicket/resource/CoreLibrariesContributor.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/resource/CoreLibrariesContributor.java b/wicket-core/src/main/java/org/apache/wicket/resource/CoreLibrariesContributor.java index faf16b5..666bb3d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/resource/CoreLibrariesContributor.java +++ b/wicket-core/src/main/java/org/apache/wicket/resource/CoreLibrariesContributor.java @@ -20,8 +20,8 @@ import org.apache.wicket.Application; import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.JavaScriptHeaderItem; import org.apache.wicket.request.resource.ResourceReference; -import org.apache.wicket.settings.IDebugSettings; import org.apache.wicket.settings.IJavaScriptLibrarySettings; +import org.apache.wicket.settings.def.DebugSettings; /** * A helper class that contributes all required JavaScript resources needed for Wicket Ajax @@ -59,7 +59,7 @@ public class CoreLibrariesContributor { IJavaScriptLibrarySettings jsLibrarySettings = application.getJavaScriptLibrarySettings(); - final IDebugSettings debugSettings = application.getDebugSettings(); + final DebugSettings debugSettings = application.getDebugSettings(); if (debugSettings.isAjaxDebugModeEnabled()) { response.render(JavaScriptHeaderItem.forReference(jsLibrarySettings.getWicketAjaxDebugReference())); http://git-wip-us.apache.org/repos/asf/wicket/blob/b5e4574b/wicket-core/src/main/java/org/apache/wicket/settings/IDebugSettings.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/IDebugSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/IDebugSettings.java deleted file mode 100644 index 3f9f021..0000000 --- a/wicket-core/src/main/java/org/apache/wicket/settings/IDebugSettings.java +++ /dev/null @@ -1,143 +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; - -/** - * Settings interface for various debug settings - * <p> - * <i>componentUseCheck </i> (defaults to true in development mode) - causes the framework to do a - * check after rendering each page to ensure that each component was used in rendering the markup. - * If components are found that are not referenced in the markup, an appropriate error will be - * displayed - * - * @author Igor Vaynberg (ivaynberg) - */ -public interface IDebugSettings -{ - /** - * If set to <code>true</code> wicket will output component path in a <code>wicketpath</code> - * attribute of the component tag. This can be useful for debugging and automating tests. - * - * @param enabled - */ - void setOutputComponentPath(boolean enabled); - - /** - * @see #setOutputComponentPath(boolean) - * @return <code>true</code> if output component path feature is enabled, <code>false</code> - * otherwise - */ - boolean isOutputComponentPath(); - - /** - * @return true if componentUseCheck is enabled - */ - boolean getComponentUseCheck(); - - /** - * Sets componentUseCheck debug settings - * - * @param check - */ - void setComponentUseCheck(boolean check); - - /** - * Enables or disables ajax debug mode. See {@link org.apache.wicket.settings.IDebugSettings} - * for details - * - * @param enable - * - */ - void setAjaxDebugModeEnabled(boolean enable); - - /** - * Returns status of ajax debug mode. See {@link org.apache.wicket.settings.IDebugSettings} for - * details - * - * @return true if ajax debug mode is enabled, false otherwise - * - */ - boolean isAjaxDebugModeEnabled(); - - /** - * Enables wrapping output of markup container in html comments that contain markup container's - * class name. (Useful for determining which part of page belongs to which markup file). - * - * @param enable - */ - void setOutputMarkupContainerClassName(boolean enable); - - /** - * Returns whether the output of markup container's should be wrapped by comments containing the - * container's class name. - * - * @return true if the markup container's class name should be written to response - */ - public boolean isOutputMarkupContainerClassName(); - - /** - * Returns status of line precise error reporting for added components that are not present in - * the markup: it points to the line where the component was added to the hierarchy in your Java - * classes. This can cause a significant decrease in performance, do not use in customer facing - * applications. - * - * @return true if the line precise error reporting is enabled - */ - public boolean isLinePreciseReportingOnAddComponentEnabled(); - - /** - * Enables line precise error reporting for added components that are not present in the markup: - * it points to the line where the component was added to the hierarchy in your Java classes. - * This can cause a significant decrease in performance, do not use in customer facing - * applications. - * - * @param enable - */ - public void setLinePreciseReportingOnAddComponentEnabled(boolean enable); - - /** - * Returns status of line precise error reporting for new components that are not present in the - * markup: it points to the line where the component was created in your Java classes. This can - * cause a significant decrease in performance, do not use in customer facing applications. - * - * @return true if the line precise error reporting is enabled - */ - public boolean isLinePreciseReportingOnNewComponentEnabled(); - - /** - * Enables line precise error reporting for new components that are not present in the markup: - * it points to the line where the component was created in your Java classes. This can cause a - * significant decrease in performance, do not use in customer facing applications. - * - * @param enable - */ - public void setLinePreciseReportingOnNewComponentEnabled(boolean enable); - - /** - * Enables all of the panels and pages, etc, from wicket-devutils package. - * - * @param enable - */ - public void setDevelopmentUtilitiesEnabled(boolean enable); - - /** - * Are all of the panels and pages, etc, from wicket-devutils package enabled? - * - * @return true if all of the panels and pages, etc, from wicket-devutils package are enabled - */ - public boolean isDevelopmentUtilitiesEnabled(); -} http://git-wip-us.apache.org/repos/asf/wicket/blob/b5e4574b/wicket-core/src/main/java/org/apache/wicket/settings/def/DebugSettings.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/def/DebugSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/def/DebugSettings.java index efe895c..38515f0 100644 --- a/wicket-core/src/main/java/org/apache/wicket/settings/def/DebugSettings.java +++ b/wicket-core/src/main/java/org/apache/wicket/settings/def/DebugSettings.java @@ -16,9 +16,14 @@ */ package org.apache.wicket.settings.def; -import org.apache.wicket.settings.IDebugSettings; - /** + * Settings interface for various debug settings + * <p> + * <i>componentUseCheck </i> (defaults to true in development mode) - causes the framework to do a + * check after rendering each page to ensure that each component was used in rendering the markup. + * If components are found that are not referenced in the markup, an appropriate error will be + * displayed + * * @author Jonathan Locke * @author Chris Turner * @author Eelco Hillenius @@ -28,7 +33,7 @@ import org.apache.wicket.settings.IDebugSettings; * @author Martijn Dashorst * @author James Carman */ -public class DebugSettings implements IDebugSettings +public class DebugSettings { /** ajax debug mode status */ private boolean ajaxDebugModeEnabled = false; @@ -51,129 +56,156 @@ public class DebugSettings implements IDebugSettings */ private boolean outputMarkupContainerClassName = false; - /** @see IDebugSettings#setOutputComponentPath(boolean) */ private boolean outputComponentPath = false; - /** @see IDebugSettings#setDevelopmentUtilitiesEnabled(boolean) */ private boolean developmentUtilitiesEnabled = false; /** - * @see org.apache.wicket.settings.IDebugSettings#getComponentUseCheck() + * @return true if componentUseCheck is enabled */ - @Override public boolean getComponentUseCheck() { return componentUseCheck; } /** - * @see org.apache.wicket.settings.IDebugSettings#isAjaxDebugModeEnabled() + * Returns status of ajax debug mode. + * + * @return true if ajax debug mode is enabled, false otherwise */ - @Override public boolean isAjaxDebugModeEnabled() { return ajaxDebugModeEnabled; } /** - * - * @see org.apache.wicket.settings.IDebugSettings#isLinePreciseReportingOnAddComponentEnabled() + * Returns status of line precise error reporting for added components that are not present in + * the markup: it points to the line where the component was added to the hierarchy in your Java + * classes. This can cause a significant decrease in performance, do not use in customer facing + * applications. + * + * @return true if the line precise error reporting is enabled */ - @Override public boolean isLinePreciseReportingOnAddComponentEnabled() { return linePreciseReportingOnAddComponentEnabled; } /** - * - * @see org.apache.wicket.settings.IDebugSettings#isLinePreciseReportingOnNewComponentEnabled() + * Returns status of line precise error reporting for new components that are not present in the + * markup: it points to the line where the component was created in your Java classes. This can + * cause a significant decrease in performance, do not use in customer facing applications. + * + * @return true if the line precise error reporting is enabled */ - @Override public boolean isLinePreciseReportingOnNewComponentEnabled() { return linePreciseReportingOnNewComponentEnabled; } /** - * @see org.apache.wicket.settings.IDebugSettings#isOutputMarkupContainerClassName() + * Returns whether the output of markup container's should be wrapped by comments containing the + * container's class name. + * + * @return true if the markup container's class name should be written to response */ - @Override public boolean isOutputMarkupContainerClassName() { return outputMarkupContainerClassName; } /** - * @see org.apache.wicket.settings.IDebugSettings#setAjaxDebugModeEnabled(boolean) + * Enables or disables ajax debug mode. + * + * @param enable */ - @Override public void setAjaxDebugModeEnabled(boolean enable) { ajaxDebugModeEnabled = enable; } /** - * @see org.apache.wicket.settings.IDebugSettings#setComponentUseCheck(boolean) + * Sets componentUseCheck debug settings + * + * @param componentUseCheck */ - @Override public void setComponentUseCheck(final boolean componentUseCheck) { this.componentUseCheck = componentUseCheck; } - @Override + /** + * Enables line precise error reporting for added components that are not present in the markup: + * it points to the line where the component was added to the hierarchy in your Java classes. + * This can cause a significant decrease in performance, do not use in customer facing + * applications. + * + * @param enable + */ public void setLinePreciseReportingOnAddComponentEnabled(boolean enable) { linePreciseReportingOnAddComponentEnabled = enable; } /** - * - * @see org.apache.wicket.settings.IDebugSettings#setLinePreciseReportingOnNewComponentEnabled(boolean) + * Enables line precise error reporting for new components that are not present in the markup: + * it points to the line where the component was created in your Java classes. This can cause a + * significant decrease in performance, do not use in customer facing applications. + * + * @param enable */ - @Override public void setLinePreciseReportingOnNewComponentEnabled(boolean enable) { linePreciseReportingOnNewComponentEnabled = enable; } /** - * @see org.apache.wicket.settings.IDebugSettings#setOutputMarkupContainerClassName(boolean) + * Enables wrapping output of markup container in html comments that contain markup container's + * class name. (Useful for determining which part of page belongs to which markup file). + * + * @param enable */ - @Override public void setOutputMarkupContainerClassName(boolean enable) { outputMarkupContainerClassName = enable; } - /** @see IDebugSettings#isOutputComponentPath() */ - @Override + /** + * @see #setOutputComponentPath(boolean) + * @return <code>true</code> if output component path feature is enabled, <code>false</code> + * otherwise + */ public boolean isOutputComponentPath() { return outputComponentPath; } - /** @see IDebugSettings#setOutputComponentPath(boolean) */ - @Override + /** + * If set to <code>true</code> wicket will output component path in a <code>wicketpath</code> + * attribute of the component tag. This can be useful for debugging and automating tests. + * + * @param outputComponentPath + */ public void setOutputComponentPath(boolean outputComponentPath) { this.outputComponentPath = outputComponentPath; } /** - * @see org.apache.wicket.settings.IDebugSettings#setDevelopmentUtilitiesEnabled(boolean) + * Enables all of the panels and pages, etc, from wicket-devutils package. + * + * @param enable */ - @Override public void setDevelopmentUtilitiesEnabled(boolean enable) { developmentUtilitiesEnabled = enable; } /** - * @see org.apache.wicket.settings.IDebugSettings#isDevelopmentUtilitiesEnabled() + * Are all of the panels and pages, etc, from wicket-devutils package enabled? + * + * @return true if all of the panels and pages, etc, from wicket-devutils package are enabled */ - @Override public boolean isDevelopmentUtilitiesEnabled() { return developmentUtilitiesEnabled; http://git-wip-us.apache.org/repos/asf/wicket/blob/b5e4574b/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java ---------------------------------------------------------------------- diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java index 15f5608..a9e21db 100644 --- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java +++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java @@ -16,8 +16,6 @@ */ package org.apache.wicket.jmx; -import org.apache.wicket.settings.IDebugSettings; - /** * Debug settings. * @@ -31,7 +29,7 @@ public interface DebugSettingsMBean boolean getComponentUseCheck(); /** - * Returns status of ajax debug mode. See {@link IDebugSettings} for details + * Returns status of ajax debug mode. * * @return true if ajax debug mode is enabled, false otherwise * @@ -39,7 +37,7 @@ public interface DebugSettingsMBean boolean isAjaxDebugModeEnabled(); /** - * Enables or disables ajax debug mode. See {@link IDebugSettings} for details + * Enables or disables ajax debug mode. * * @param enable *
