com.alee.managers.language.updaters
Class DefaultLanguageUpdater<E extends java.awt.Component>

java.lang.Object
  extended by com.alee.managers.language.updaters.DefaultLanguageUpdater<E>
All Implemented Interfaces:
LanguageUpdater<E>
Direct Known Subclasses:
AbstractButtonLU, DialogLU, FrameLU, JFileChooserLU, JInternalFrameLU, JLabelLU, JProgressBarLU, JTabbedPaneLU, JTextComponentLU, LanguageExample.MyLabelUpdater, WebCollapsiblePaneLU, WebDockableFrameLU, WebFileDropLU, WebFormattedTextFieldLU, WebLanguageUpdater, WebPasswordFieldLU, WebTextFieldLU

public abstract class DefaultLanguageUpdater<E extends java.awt.Component>
extends java.lang.Object
implements LanguageUpdater<E>

This class prvides an additional set of methods to simplify language updaters usage. Most of default predefined language updaters extend this class.

Author:
Mikle Garin

Field Summary
static java.lang.String DROP_TEXT
           
static java.lang.String INPUT_PROMPT
          Predefined component states.
 
Constructor Summary
DefaultLanguageUpdater()
           
 
Method Summary
 java.lang.Class getComponentClass()
          Returns class which instance should be updated using this LanguageUpdater.
protected  java.lang.String getDefaultText(java.lang.String state, boolean defaultState, Value value, java.lang.Object... data)
          Returns state text taken from value and formatted using specified data.
protected  java.lang.String getDefaultText(java.lang.String state, Value value, java.lang.Object... data)
          Returns state text taken from value and formatted using specified data.
protected  java.lang.String getDefaultText(Value value, java.lang.Object... data)
          Returns default text taken from value and formatted using specified data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.alee.managers.language.updaters.LanguageUpdater
update
 

Field Detail

INPUT_PROMPT

public static final java.lang.String INPUT_PROMPT
Predefined component states.

See Also:
Constant Field Values

DROP_TEXT

public static final java.lang.String DROP_TEXT
See Also:
Constant Field Values
Constructor Detail

DefaultLanguageUpdater

public DefaultLanguageUpdater()
Method Detail

getComponentClass

public java.lang.Class getComponentClass()
Returns class which instance should be updated using this LanguageUpdater.

Specified by:
getComponentClass in interface LanguageUpdater<E extends java.awt.Component>
Returns:
class type to update

getDefaultText

protected java.lang.String getDefaultText(Value value,
                                          java.lang.Object... data)
Returns default text taken from value and formatted using specified data.

Parameters:
value - language value
data - formatting data
Returns:
formatted default text

getDefaultText

protected java.lang.String getDefaultText(java.lang.String state,
                                          Value value,
                                          java.lang.Object... data)
Returns state text taken from value and formatted using specified data.

Parameters:
state - component state
value - language value
data - formatting data
Returns:
formatted state text

getDefaultText

protected java.lang.String getDefaultText(java.lang.String state,
                                          boolean defaultState,
                                          Value value,
                                          java.lang.Object... data)
Returns state text taken from value and formatted using specified data.

Parameters:
state - component state
defaultState - whether default text should be taken if no state text found or not
value - language value
data - formatting data
Returns:
formatted state text