it.tidalwave.role.spi
Class DefaultMutableDisplayable

Package class diagram package DefaultMutableDisplayable
java.lang.Object
  extended by it.tidalwave.role.spi.DefaultMutableDisplayable
All Implemented Interfaces:
Displayable, LocalizedDisplayable, MutableDisplayable, MutableLocalizedDisplayable

public class DefaultMutableDisplayable
extends Object
implements MutableLocalizedDisplayable

A default implementation of MutableLocalizedDisplayable starting which a single display name in Locale.ENGLISH language.

Version:
$Id$
Author:
Fabrizio Giudici
Status: stable API

Field Summary
 
Fields inherited from interface it.tidalwave.role.MutableLocalizedDisplayable
MutableLocalizedDisplayable
 
Fields inherited from interface it.tidalwave.role.MutableDisplayable
MutableDisplayable, PROP_DISPLAY_NAME, PROP_DISPLAY_NAMES
 
Fields inherited from interface it.tidalwave.role.LocalizedDisplayable
LocalizedDisplayable
 
Fields inherited from interface it.tidalwave.role.Displayable
DEFAULT, Displayable
 
Constructor Summary
DefaultMutableDisplayable(String displayName)
          Creates an instance with an initial given display name in Locale.ENGLISH.
DefaultMutableDisplayable(String displayName, String toStringName)
          Creates an instance with an initial given display name in Locale.ENGLISH and an explicit identifier for toString().
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Registers a PropertyChangeListener.
 String getDisplayName()
          Returns the display name in the current Locale.
 String getDisplayName(Locale locale)
          Returns the display name in the given Locale.
 Map<Locale,String> getDisplayNames()
          Returns all the display names in Map where they are indexed by Locale.
 SortedSet<Locale> getLocales()
          Returns the supported Locales.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Unregisters a PropertyChangeListener.
 void setDisplayName(String displayName)
          Sets the display name in Locale.ENGLISH.
 void setDisplayName(String displayName, Locale locale)
          Sets the display name in the given Locale.
 void setDisplayNames(Map<Locale,String> displayNames)
          Sets a bag of display names for a number of Locales.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMutableDisplayable

public DefaultMutableDisplayable(@Nonnull
                                 String displayName)
Creates an instance with an initial given display name in Locale.ENGLISH.

Parameters:
displayName - the display name

DefaultMutableDisplayable

public DefaultMutableDisplayable(@Nonnull
                                 String displayName,
                                 @Nonnull
                                 String toStringName)
Creates an instance with an initial given display name in Locale.ENGLISH and an explicit identifier for toString().

Parameters:
displayName - the display name
toStringName - the name to be rendered when toString() is called
Method Detail

getDisplayName

@Nonnull
public String getDisplayName()
Returns the display name in the current Locale.

Specified by:
getDisplayName in interface Displayable

getDisplayName

@Nonnull
public String getDisplayName(@Nonnull
                                     Locale locale)
Returns the display name in the given Locale.

Specified by:
getDisplayName in interface LocalizedDisplayable
Parameters:
locale - the Locale
Returns:
the display name

getLocales

@Nonnull
public SortedSet<Locale> getLocales()
Returns the supported Locales.

Specified by:
getLocales in interface LocalizedDisplayable
Returns:
the available Locales

getDisplayNames

@Nonnull
public Map<Locale,String> getDisplayNames()
Returns all the display names in Map where they are indexed by Locale.

Specified by:
getDisplayNames in interface LocalizedDisplayable
Returns:
the display names

setDisplayName

public void setDisplayName(@Nonnull
                           String displayName)
Sets the display name in Locale.ENGLISH.

Specified by:
setDisplayName in interface MutableDisplayable
Parameters:
displayName - the display name

setDisplayName

public void setDisplayName(@Nonnull
                           String displayName,
                           @Nonnull
                           Locale locale)
Sets the display name in the given Locale.

Specified by:
setDisplayName in interface MutableDisplayable
Parameters:
displayName - the display name
locale - the locale

setDisplayNames

public void setDisplayNames(@Nonnull
                            Map<Locale,String> displayNames)
Sets a bag of display names for a number of Locales.

Specified by:
setDisplayNames in interface MutableDisplayable
Parameters:
displayNames - the display names

addPropertyChangeListener

public void addPropertyChangeListener(@Nonnull
                                      PropertyChangeListener listener)
Registers a PropertyChangeListener.

Specified by:
addPropertyChangeListener in interface MutableDisplayable
Parameters:
listener - the listener

removePropertyChangeListener

public void removePropertyChangeListener(@Nonnull
                                         PropertyChangeListener listener)
Unregisters a PropertyChangeListener.

Specified by:
removePropertyChangeListener in interface MutableDisplayable
Parameters:
listener - the listener

toString

@Nonnull
public String toString()

Overrides:
toString in class Object


Copyright © 2009-2012 Tidalwave s.a.s.. All Rights Reserved.