Coverage Report - org.trails.component.LocaleLink
 
Classes in this File Line Coverage Branch Coverage Complexity
LocaleLink
0% 
N/A 
1.25
 
 1  
 /*
 2  
  * Created on 30/11/2005
 3  
  *
 4  
  */
 5  
 package org.trails.component;
 6  
 
 7  
 import java.util.Locale;
 8  
 
 9  
 import org.apache.tapestry.BaseComponent;
 10  
 import org.apache.tapestry.IRequestCycle;
 11  
 import org.apache.tapestry.PageRedirectException;
 12  
 import org.trails.servlet.TrailsApplicationServlet;
 13  
 
 14  0
 public abstract class LocaleLink extends BaseComponent
 15  
 {
 16  
 
 17  
         public abstract String getLanguage();
 18  
 
 19  
         public abstract String getLinkText();
 20  
 
 21  
         public abstract String getCountry();
 22  
 
 23  
         public void click(IRequestCycle cycle)
 24  
         {
 25  0
                 Locale locale = new Locale(getLanguage(), getCountry());
 26  0
                 getPage().getEngine().setLocale(locale);
 27  0
                 TrailsApplicationServlet.setCurrentLocale(locale);
 28  0
                 cycle.cleanup();
 29  0
                 throw new PageRedirectException(getPage());
 30  
         }
 31  
 
 32  
 
 33  
 }