com.tensegrity.gui.component
Interface AttributeEditorTranslator


public interface AttributeEditorTranslator

An AttributeEditorTranslator is used to translate the names and values of attributes in an AttributeEditor for the display.

The instance has to be notified of changes in the language by calling the method setLocale(Locale).

Author:
BurkhardWick

Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener that is notified of locale changes.
 java.lang.String getName(java.lang.String name)
          Returns the translation for the given name.
 java.lang.String[] getNameTranslations()
          Returns the base names for the resource bundles this translator is using for names
 java.lang.String getValue(java.lang.String name, java.lang.String value)
          Returns the translation for the given value.
 java.lang.String[] getValueTranslations()
          Returns the base names for the resource bundles this translator is using for value
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a previously added PropertyChangeListener.
 void setLocale(java.util.Locale locale)
          Sets the new locale, the properties files for the new language will be loaded
 

Method Detail

setLocale

public void setLocale(java.util.Locale locale)
Sets the new locale, the properties files for the new language will be loaded

Parameters:
locale - the new locale

getName

public java.lang.String getName(java.lang.String name)
Returns the translation for the given name. The name should be given as complete path name of an attribute. e.g.: RectangleNode:ModelNode:Description

Parameters:
name - The full path name of an attribute
Returns:
the translation of the name, if no translation is found the name parameter is returned

getValue

public java.lang.String getValue(java.lang.String name,
                                 java.lang.String value)
Returns the translation for the given value. The value should be given as concatenation of the complete path name of the corresponding attribute and the value. e.g.: RectangleNode:ModelNode:Custom:Priority:1

Parameters:
name - The full path name of an attribute
value - The value to translate
Returns:
the translation of the value

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener that is notified of locale changes.

Parameters:
listener - The listener to add

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a previously added PropertyChangeListener.

Parameters:
listener - The listener to remove

getNameTranslations

public java.lang.String[] getNameTranslations()
Returns the base names for the resource bundles this translator is using for names

Returns:
the base names for the resource bundles this translator is using for names

getValueTranslations

public java.lang.String[] getValueTranslations()
Returns the base names for the resource bundles this translator is using for value

Returns:
the base names for the resource bundles this translator is using for values


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.