001package votorola.a.web.wic; // Copyright 2010, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE. 002 003import org.apache.wicket.*; 004import org.apache.wicket.markup.html.*; 005import org.apache.wicket.markup.html.image.*; 006import org.apache.wicket.markup.html.link.*; 007import org.apache.wicket.markup.html.panel.*; 008import org.apache.wicket.resource.*; 009import org.apache.wicket.request.mapper.parameter.PageParameters; 010import votorola.g.lang.*; 011 012 013/** A logo that mimics the one MediaWiki shows, at top-left of the page. 014 * 015 * @see <a href='../../../../../../a/web/wic/WC_WGLogo.html' 016 * target='_top'>WC_WGLogo.html</a> 017 * @see <a href='http://www.mediawiki.org/wiki/Manual:$wgLogo' 018 * >www.mediawiki.org/wiki/Manual:$wgLogo</a> 019 */ 020public @ThreadRestricted("wicket") final class WC_WGLogo extends Panel 021{ 022 023 024 /** Constructs a WC_WGLogo. 025 */ 026 public WC_WGLogo( String _id, final String imageLocationOrNull, final String linkTarget, 027 final VRequestCycle cycle ) 028 { 029 super( _id ); 030 setRenderBodyOnly( true ); 031 032 final ExternalLink link = new ExternalLink( "a", linkTarget ); 033 if( imageLocationOrNull != null ) 034 { 035 link.add( AttributeModifier.replace( "style", 036 "background-image: url(" + imageLocationOrNull + ")" )); 037 } 038 add( link ); 039 } 040 041 042}