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 java.lang.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(java.lang.String displayName)
          Creates an instance with an initial given display name in Locale.ENGLISH.
DefaultMutableDisplayable(java.lang.String displayName, java.lang.String toStringName)
          Creates an instance with an initial given display name in Locale.ENGLISH and an explicit identifier for toString().
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Registers a PropertyChangeListener.
 java.lang.String getDisplayName()
          Returns the display name in the current Locale.
 java.lang.String getDisplayName(java.util.Locale locale)
          Returns the display name in the given Locale.
 java.util.Map<java.util.Locale,java.lang.String> getDisplayNames()
          Returns all the display names in Map where they are indexed by Locale.
 java.util.SortedSet<java.util.Locale> getLocales()
          Returns the supported Locales.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Unregisters a PropertyChangeListener.
 void setDisplayName(java.lang.String displayName)
          Sets the display name in Locale.ENGLISH.
 void setDisplayName(java.lang.String displayName, java.util.Locale locale)
          Sets the display name in the given Locale.
 void setDisplayNames(java.util.Map<java.util.Locale,java.lang.String> displayNames)
          Sets a bag of display names for a number of Locales.
 java.lang.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
                                 java.lang.String displayName)
Creates an instance with an initial given display name in Locale.ENGLISH.

Parameters:
displayName - the display name

DefaultMutableDisplayable

public DefaultMutableDisplayable(@Nonnull
                                 java.lang.String displayName,
                                 @Nonnull
                                 java.lang.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 java.lang.String getDisplayName()
Returns the display name in the current Locale.

Specified by:
getDisplayName in interface Displayable

getDisplayName

@Nonnull
public java.lang.String getDisplayName(@Nonnull
                                               java.util.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 java.util.SortedSet<java.util.Locale> getLocales()
Returns the supported Locales.

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

getDisplayNames

@Nonnull
public java.util.Map<java.util.Locale,java.lang.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
                           java.lang.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
                           java.lang.String displayName,
                           @Nonnull
                           java.util.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
                            java.util.Map<java.util.Locale,java.lang.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
                                      java.beans.PropertyChangeListener listener)
Registers a PropertyChangeListener.

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

removePropertyChangeListener

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

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

toString

@Nonnull
public java.lang.String toString()

Overrides:
toString in class java.lang.Object


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