You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Juergen Donnerstag (JIRA)" <ji...@apache.org> on 2008/12/29 22:22:44 UTC

[jira] Commented: (WICKET-1917) Automatically Load CSS files based on name matching

    [ https://issues.apache.org/jira/browse/WICKET-1917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659654#action_12659654 ] 

Juergen Donnerstag commented on WICKET-1917:
--------------------------------------------

Can be easily added to any "BasePage" and "BasePanel" like

Constructor:

		String name = this.getClass().getSimpleName();
		if (PackageResource.exists(this.getClass(), name + ".css", getLocale(), getStyle()))
		{
			add(HeaderContributor.forCss(this.getClass(), name + ".css"));
		}

		if (PackageResource.exists(this.getClass(), name + ".js", getLocale(), getStyle()))
		{
			add(HeaderContributor.forJavaScript(this.getClass(), name + ".js"));
		}


> Automatically Load CSS files based on name matching
> ---------------------------------------------------
>
>                 Key: WICKET-1917
>                 URL: https://issues.apache.org/jira/browse/WICKET-1917
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>            Reporter: Christopher J Lyth
>            Priority: Minor
>             Fix For: 1.5-M1
>
>
> I often find myself adding CSS files to wicket with the same name as my pages (i.e. BasePage.css). I then have to add the reference through an html link or a header contributer. I would like to load these automatically in a similar manor as the properties files. 
> I feel this should be expanded to include the ability to skin the application in the following manor.
> BasePage.css
> BasePage_chrome.css
> BasePage_metal.css
> I would also recommend setting this in a similar manor to other patterns in wicket. It would use the closest name match by default (i.e. BasePage.css). I imagine this could also be set by system property (wicket.skin) or programatically. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.