Package be.gaudry.swing.action
Class AutoLocalizedAction
java.lang.Object
javax.swing.AbstractAction
be.gaudry.swing.action.LocalizableAction
be.gaudry.swing.action.AutoLocalizedAction
- All Implemented Interfaces:
ILocalized,ActionListener,PropertyChangeListener,Serializable,Cloneable,EventListener,Action
- Direct Known Subclasses:
AuthenticatedAction,EidActionsFactory.ListenEidAction,LookAndFeelHelper.ToggleListenDarkmodeAction
public abstract class AutoLocalizedAction
extends LocalizableAction
implements PropertyChangeListener
Allows localization by invoking the
ILocalized.setLanguage() method.
Notice: this class listens the LanguageHelper.
Provided by the broldev.core.swing project.- Since:
- 1.0 (Mar 27, 2009), broldev.core.swing 0.0.1-SNAPSHOT dependency
- Version:
- 1.0 (Mar 27, 2009)
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
ConstructorsConstructorDescriptionBuilds aAutoLocalizedActionobject with a default description string and default icon.AutoLocalizedAction(String name)Builds aAutoLocalizedActionobject with the specified description string and a default icon.AutoLocalizedAction(String name, Icon icon)Builds aAutoLocalizedActionobject with the specified description string and a the specified icon. -
Method Summary
Modifier and TypeMethodDescription(package private) voidThis package method allows to set some operation after callingILocalized.setLanguage().(package private) voidThis package method allows to set some operation before callingILocalized.setLanguage().protected voidThis method is called in the constructor after theILocalized.setLanguage()methodprotected voidinit()voidOverride this to improve performances if you have a collection ofAutoLocalizedActionobjects, to load only once the resource bundle and update all theAutoLocalizedActionobjects.Methods inherited from class be.gaudry.swing.action.LocalizableAction
doOnCreateMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.awt.event.ActionListener
actionPerformedMethods inherited from interface be.gaudry.model.locale.ILocalized
setLanguage
-
Constructor Details
-
AutoLocalizedAction
public AutoLocalizedAction()Builds aAutoLocalizedActionobject with a default description string and default icon. -
AutoLocalizedAction
Builds aAutoLocalizedActionobject with the specified description string and a default icon.- Parameters:
name- description of the action
-
AutoLocalizedAction
Builds aAutoLocalizedActionobject with the specified description string and a the specified icon.- Parameters:
name- description of the actionicon- image of the action
-
-
Method Details
-
init
protected final void init()- Overrides:
initin classLocalizableAction
-
doAfterCreate
protected void doAfterCreate()This method is called in the constructor after theILocalized.setLanguage()method -
propertyChange
Override this to improve performances if you have a collection ofAutoLocalizedActionobjects, to load only once the resource bundle and update all theAutoLocalizedActionobjects. \nOverride this also to observe more than theLanguageHelper. \nThis method is called whenever the observedLanguageHelperis changed. An application calls an Observable object'snotifyObserversmethod to have all the object's observers notified of the change. \nDo not forget to call "super.update(o, arg);" in case of overriding.- Specified by:
propertyChangein interfacePropertyChangeListener
-
afterUpdateLanguage
void afterUpdateLanguage()This package method allows to set some operation after callingILocalized.setLanguage(). This may be overrided ie. if theAbstractAction.getValue(String)is used withAction.NAMEto get the name of the action after having set the language. \nThis is only called after an update due to aLanguageHelpernotification, not after an explicitILocalized.setLanguage()call. \nDefault implementation does nothing. -
beforeUpdateLanguage
void beforeUpdateLanguage()This package method allows to set some operation before callingILocalized.setLanguage(). \nThis is only called before an update due to aLanguageHelpernotification, not before an explicitILocalized.setLanguage()call. \nDefault implementation does nothing.
-