portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/impl LanguageImpl.java
Date Mon, 07 Feb 2005 15:20:14 GMT
weaver      2005/02/07 07:20:14

  Modified:    components/registry/src/java/org/apache/jetspeed/om/impl
                        LanguageImpl.java
  Log:
  Moved setting of localized strings to there respective method as it appeared setting them
in the constructor did not always work.
  
  Revision  Changes    Path
  1.11      +15 -10    jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/impl/LanguageImpl.java
  
  Index: LanguageImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/impl/LanguageImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- LanguageImpl.java	2 Feb 2005 20:59:26 -0000	1.10
  +++ LanguageImpl.java	7 Feb 2005 15:20:14 -0000	1.11
  @@ -81,7 +81,6 @@
       public LanguageImpl( Locale locale, ResourceBundle bundle, String defaultTitle, String
defaultShortTitle,
               String defaultKeyWords )
       {
  -
           HashMap defaults = new HashMap(3);
           defaults.put(JAVAX_PORTLET_TITLE, defaultTitle);
           defaults.put(JAVAX_PORTLET_SHORT_TITLE, defaultShortTitle);
  @@ -89,9 +88,6 @@
           this.resourceBundle = new DefaultsResourceBundle(bundle, defaults);
   
           this.locale = locale;
  -        setTitle(this.resourceBundle.getString(JAVAX_PORTLET_TITLE));
  -        setShortTitle(this.resourceBundle.getString(JAVAX_PORTLET_SHORT_TITLE));
  -        setKeywords(this.resourceBundle.getString(JAVAX_PORTLET_KEYWORDS));
       }
   
       public LanguageImpl( Locale locale, ResourceBundle bundle )
  @@ -113,6 +109,11 @@
        */
       public String getTitle()
       {
  +        if(title == null)
  +        {
  +            title = resourceBundle.getString(JAVAX_PORTLET_TITLE);
  +        }
  +        
           return title;
       }
   
  @@ -121,7 +122,12 @@
        */
       public String getShortTitle()
       {
  -        return shortTitle;
  +        if(shortTitle == null)
  +        {
  +            shortTitle = resourceBundle.getString(JAVAX_PORTLET_SHORT_TITLE);
  +        }
  +        
  +        return shortTitle;        
       }
   
       /**
  @@ -129,13 +135,12 @@
        */
       public Iterator getKeywords()
       {
  -        if (keywords != null)
  +        if (keywords == null)
           {
  -            return keywords.iterator();
  +            setKeywords(resourceBundle.getString(JAVAX_PORTLET_KEYWORDS));
           }
   
  -        return null;
  -
  +        return keywords.iterator();
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message