You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2011/04/18 15:23:44 UTC

svn commit: r1094562 - /wicket/branches/wicket-1.4.x/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java

Author: mgrigorov
Date: Mon Apr 18 13:23:44 2011
New Revision: 1094562

URL: http://svn.apache.org/viewvc?rev=1094562&view=rev
Log:
WICKET-3607 make ModalWindow CSS contibution more configurable


Modified:
    wicket/branches/wicket-1.4.x/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java

Modified: wicket/branches/wicket-1.4.x/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java?rev=1094562&r1=1094561&r2=1094562&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java (original)
+++ wicket/branches/wicket-1.4.x/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java Mon Apr 18 13:23:44 2011
@@ -264,7 +264,22 @@ public class ModalWindow extends Panel
 		add(new WindowClosedBehavior());
 
 		add(JavascriptPackageResource.getHeaderContribution(JAVASCRIPT));
-		add(CSSPackageResource.getHeaderContribution(CSS));
+		ResourceReference CSS = newCssResource();
+		if (CSS != null)
+		{
+			add(CSSPackageResource.getHeaderContribution(CSS));
+		}
+	}
+
+	/**
+	 * Allows to override CSS contribution. Returning null means the CSS will be contributed via
+	 * other sources, e.g. a global CSS resource.
+	 * 
+	 * @return The CSS resource reference or null if CSS is contributed via other means.
+	 */
+	protected ResourceReference newCssResource()
+	{
+		return CSS;
 	}
 
 	/**