You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mo...@apache.org on 2015/11/08 18:15:14 UTC

[15/50] wicket git commit: WICKET-6004 Wicket 8 cleanup - component path attribute

WICKET-6004 Wicket 8 cleanup - component path attribute


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

Branch: refs/heads/lambdas
Commit: 32f1effce607121fe1bd6ba1e330561ee6ec4644
Parents: af4c62a
Author: Sven Meier <sv...@apache.org>
Authored: Mon Oct 19 13:52:38 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Oct 19 14:45:11 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/wicket/Component.java  |  5 ----
 .../html/form/CheckBoxMultipleChoice.java       |  5 ----
 .../wicket/markup/html/form/RadioChoice.java    |  5 ----
 .../apache/wicket/settings/DebugSettings.java   | 29 --------------------
 .../wicket/settings/DebugSettingsTest.java      | 25 +----------------
 .../apache/wicket/jmx/DebugSettingsMBean.java   | 14 +++++-----
 .../wicket/jmx/wrapper/DebugSettings.java       | 10 +++----
 7 files changed, 13 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/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 2c22cee..f244488 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Component.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Component.java
@@ -3899,11 +3899,6 @@ public abstract class Component
 
 		DebugSettings debugSettings = getApplication().getDebugSettings();
 		String componentPathAttributeName = debugSettings.getComponentPathAttributeName();
-		if (Strings.isEmpty(componentPathAttributeName) && debugSettings.isOutputComponentPath())
-		{
-			// fallback to the old 'wicketpath'
-			componentPathAttributeName = "wicketpath";
-		}
 		if (Strings.isEmpty(componentPathAttributeName) == false)
 		{
 			String path = getPageRelativePath();

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
index c13c40b..73c5e9e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
@@ -474,11 +474,6 @@ public class CheckBoxMultipleChoice<T> extends ListMultipleChoice<T>
 
 			DebugSettings debugSettings = getApplication().getDebugSettings();
 			String componentPathAttributeName = debugSettings.getComponentPathAttributeName();
-			if (Strings.isEmpty(componentPathAttributeName) && debugSettings.isOutputComponentPath())
-			{
-				// fallback to the old 'wicketpath'
-				componentPathAttributeName = "wicketpath";
-			}
 			if (Strings.isEmpty(componentPathAttributeName) == false)
 			{
 				CharSequence path = getPageRelativePath();

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java
index c55f446..2ab3b89 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java
@@ -567,11 +567,6 @@ public class RadioChoice<T> extends AbstractSingleSelectChoice<T> implements IOn
 
 			DebugSettings debugSettings = getApplication().getDebugSettings();
 			String componentPathAttributeName = debugSettings.getComponentPathAttributeName();
-			if (Strings.isEmpty(componentPathAttributeName) && debugSettings.isOutputComponentPath())
-			{
-				// fallback to the old 'wicketpath'
-				componentPathAttributeName = "wicketpath";
-			}
 			if (Strings.isEmpty(componentPathAttributeName) == false)
 			{
 				CharSequence path = getPageRelativePath();

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
index 8aa8782..35b3128 100644
--- a/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
+++ b/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
@@ -56,8 +56,6 @@ public class DebugSettings
 	 */
 	private boolean outputMarkupContainerClassName = false;
 
-	private boolean outputComponentPath = false;
-
 	private String componentPathAttributeName = null;
 
 	private boolean developmentUtilitiesEnabled = false;
@@ -183,33 +181,6 @@ public class DebugSettings
 	}
 
 	/**
-	 * @see #setOutputComponentPath(boolean)
-	 * @return <code>true</code> if output component path feature is enabled, <code>false</code>
-	 *         otherwise
-	 * @deprecated Use #getComponentPathAttributeName() instead
-	 */
-	@Deprecated
-	public boolean isOutputComponentPath()
-	{
-		return outputComponentPath;
-	}
-
-	/**
-	 * 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
-	 * @return {@code this} object for chaining
-	 * @deprecated Use #setComponentPathAttributeName() with a non-empty value
-	 */
-	@Deprecated
-	public DebugSettings setOutputComponentPath(boolean outputComponentPath)
-	{
-		this.outputComponentPath = outputComponentPath;
-		return this;
-	}
-
-	/**
 	 * If the parameter value is non-empty then Wicket will use it as the name of an attribute of the
 	 * component tag to print the {@link org.apache.wicket.Component}'s path.
 	 * This can be useful for debugging and automating tests.

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java b/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
index 2dff670..a81a981 100644
--- a/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
@@ -51,27 +51,4 @@ public class DebugSettingsTest extends WicketTestCase
 		String wicketPath = tagTester.getAttribute(attributeName);
 		assertEquals(link.getPageRelativePath(), wicketPath);
 	}
-
-	/**
-	 * https://issues.apache.org/jira/browse/WICKET-5498
-	 */
-	@Test
-	public void setComponentPathAttributeNameDeprected()
-	{
-		tester.getApplication().getDebugSettings().setOutputComponentPath(true);
-		MockPageWithLink page = new MockPageWithLink();
-		Component link = new Link(MockPageWithLink.LINK_ID)
-		{
-			@Override
-			public void onClick()
-			{
-			}
-		}.setMarkupId(MockPageWithLink.LINK_ID);
-		page.add(link);
-		tester.startPage(page);
-
-		TagTester tagTester = tester.getTagById(MockPageWithLink.LINK_ID);
-		String wicketPath = tagTester.getAttribute("wicketpath");
-		assertEquals(link.getPageRelativePath(), wicketPath);
-	}
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/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 a9e21db..b65cafd 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
@@ -53,19 +53,19 @@ public interface DebugSettingsMBean
 
 
 	/**
-	 * If set to <code>true</code> wicket will output component path in a <code>wicket:path</code>
-	 * attribute of the component tag. This can be useful for debugging and automating tests.
+	 * If the parameter value is non-empty then Wicket will use it as the name of an attribute of the
+	 * component tag to print the {@link org.apache.wicket.Component}'s path.
 	 * 
 	 * @param enabled
 	 */
-	public void setOutputComponentPath(boolean enabled);
+	public void setComponentPathAttributeName(String name);
 
 	/**
-	 * @see #setOutputComponentPath(boolean)
-	 * @return <code>true</code> if output component path feature is enabled, <code>false</code>
-	 *         otherwise
+	 * @see #setComponentPathAttributeName(String)
+	 * @return The name of the attribute for the {@link org.apache.wicket.markup.ComponentTag}.
+	 *         If {@code null} or empty then the attribute won't be rendered
 	 */
-	public boolean isOutputComponentPath();
+	public String getComponentPathAttributeName();
 
 	/**
 	 * Enables wrapping output of markup container in html comments that contain markup container's

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java
----------------------------------------------------------------------
diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java
index fcd073a..8f80816 100644
--- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java
+++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java
@@ -75,21 +75,21 @@ public class DebugSettings implements DebugSettingsMBean
 	}
 
 	/**
-	 * @see org.apache.wicket.jmx.DebugSettingsMBean#setOutputComponentPath(boolean)
+	 * @see org.apache.wicket.jmx.DebugSettingsMBean#setComponentPathAttributeName(boolean)
 	 */
 	@Override
-	public void setOutputComponentPath(final boolean enabled)
+	public void setComponentPathAttributeName(final String name)
 	{
-		application.getDebugSettings().setOutputComponentPath(enabled);
+		application.getDebugSettings().setComponentPathAttributeName(name);
 	}
 
 	/**
 	 * @see org.apache.wicket.jmx.DebugSettingsMBean#isOutputComponentPath()
 	 */
 	@Override
-	public boolean isOutputComponentPath()
+	public String getComponentPathAttributeName()
 	{
-		return application.getDebugSettings().isOutputComponentPath();
+		return application.getDebugSettings().getComponentPathAttributeName();
 	}