org.wicketstuff.minis.behavior.styleswitcher
Class StyleSwitcher

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.wicketstuff.minis.behavior.styleswitcher.StyleSwitcher
All Implemented Interfaces:
Serializable, IComponentAwareEventSink, IComponentAwareHeaderContributor, IClusterable

public class StyleSwitcher
extends Behavior

StyleSwitcher Adds a set of alternate stylesheet links to the header with title attributes. When used in conjunction with StyleSwitcherLink, it easy to switch active stylesheets with the click of a link. Inspired by Paul Sowden's A List Apart article "Altenative Style" http://alistapart.com/stories/alternate/

Author:
Tauren Mills (tauren), Igor Vaynberg (ivaynberg at apache dot org)
See Also:
Serialized Form

Nested Class Summary
static class StyleSwitcher.Javascript
          JavaScript access methods
 
Constructor Summary
StyleSwitcher()
           
 
Method Summary
 void addStylesheet(String title, ResourceReference reference)
          Adds stylesheet to this stylesheet switcher
 void renderHead(Component c, org.apache.wicket.markup.head.IHeaderResponse response)
          
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, onRemove, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleSwitcher

public StyleSwitcher()
Method Detail

addStylesheet

public void addStylesheet(String title,
                          ResourceReference reference)
Adds stylesheet to this stylesheet switcher

Parameters:
reference - A resource reference to an alternate stylesheet
title - Name of this stylesheet

renderHead

public void renderHead(Component c,
                       org.apache.wicket.markup.head.IHeaderResponse response)

Specified by:
renderHead in interface IComponentAwareHeaderContributor
Overrides:
renderHead in class Behavior


Copyright © 2014. All rights reserved.