org.openpermis.editor.policy.gui.binding
Class TranslationConverter

java.lang.Object
  extended by org.jdesktop.beansbinding.Converter<String,String>
      extended by org.openpermis.editor.policy.gui.binding.TranslationConverter

public class TranslationConverter
extends org.jdesktop.beansbinding.Converter<String,String>

Converts string to a translated version using a ResourceMap.

This converter only supports forward translation and converts input strings to a translated version by using the input value (with an optional prefix) as translation keys.

Reverse translation yields the input string.

Since:
0.9.0

Constructor Summary
TranslationConverter(org.jdesktop.application.ResourceMap resourceMap, String prefix)
          Creates a translation converter that operates on the specified resource map and prefix.
 
Method Summary
 String convertForward(String value)
          Translates the specified input value.
 String convertReverse(String value)
          Reverse translation is not supported by this translator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslationConverter

public TranslationConverter(org.jdesktop.application.ResourceMap resourceMap,
                            String prefix)
Creates a translation converter that operates on the specified resource map and prefix.

Parameters:
resourceMap - the resource map where translations are retrieved from.
prefix - prefix prepended to the string to translate, may be null to use the input string without prefix.
Since:
0.9.0
Method Detail

convertForward

public String convertForward(String value)
Translates the specified input value.

Specified by:
convertForward in class org.jdesktop.beansbinding.Converter<String,String>
Parameters:
value - the input strings to be translated.
Returns:
the translated string or the input string if there is no translation available.
Since:
0.9.0

convertReverse

public String convertReverse(String value)
Reverse translation is not supported by this translator.

Specified by:
convertReverse in class org.jdesktop.beansbinding.Converter<String,String>
Parameters:
value - the input string.
Returns:
the unmodified input value.
Since:
0.9.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG