You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2008/09/15 22:12:50 UTC

svn commit: r695605 - in /wicket/trunk/wicket/src/main/java/org/apache/wicket: Component.java settings/IDebugSettings.java settings/IMarkupSettings.java settings/Settings.java

Author: ivaynberg
Date: Mon Sep 15 13:12:50 2008
New Revision: 695605

URL: http://svn.apache.org/viewvc?rev=695605&view=rev
Log:
WICKET-1830

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IDebugSettings.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IMarkupSettings.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/Settings.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java?rev=695605&r1=695604&r2=695605&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java Mon Sep 15 13:12:50 2008
@@ -3830,6 +3830,11 @@
 		{
 			tag.put(MARKUP_ID_ATTR_NAME, getMarkupId());
 		}
+
+		if (getApplication().getDebugSettings().isOutputComponentPath())
+		{
+			tag.put("wicket:path", getPageRelativePath());
+		}
 	}
 
 	/**

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IDebugSettings.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IDebugSettings.java?rev=695605&r1=695604&r2=695605&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IDebugSettings.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IDebugSettings.java Mon Sep 15 13:12:50 2008
@@ -32,6 +32,21 @@
 public interface IDebugSettings
 {
 	/**
+	 * 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.
+	 * 
+	 * @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();

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IMarkupSettings.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IMarkupSettings.java?rev=695605&r1=695604&r2=695605&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IMarkupSettings.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IMarkupSettings.java Mon Sep 15 13:12:50 2008
@@ -27,7 +27,7 @@
  * removed. Whitespace stripping is not HTML or JavaScript savvy and can conceivably break pages,
  * but should provide significant performance improvements.
  * <p>
- * <i>stripComments </i> (defaults to false) - Set to true to strip HTML comments during markup
+ * <i>stripComments</i> (defaults to false) - Set to true to strip HTML comments during markup
  * loading
  * 
  * @author Igor Vaynberg (ivaynberg)

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/Settings.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/Settings.java?rev=695605&r1=695604&r2=695605&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/Settings.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/Settings.java Mon Sep 15 13:12:50 2008
@@ -92,6 +92,8 @@
 		IFrameworkSettings,
 		IRequestLoggerSettings
 {
+	private boolean outputComponentPath = false;
+
 	/** Class of access denied page. */
 	private WeakReference<Class<? extends Page>> accessDeniedPage;
 
@@ -1421,4 +1423,19 @@
 	{
 		parentFolderPlaceholder = sequence;
 	}
+
+
+	/** @see IDebugSettings#isOutputComponentPath() */
+	public boolean isOutputComponentPath()
+	{
+		return outputComponentPath;
+	}
+
+	/** @see IDebugSettings#setOutputComponentPath() */
+	public void setOutputComponentPath(boolean outputComponentPath)
+	{
+		this.outputComponentPath = outputComponentPath;
+	}
+
+
 }