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, enabled
Fields 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
ConstructorDescriptionBuilds aAutoLocalizedAction
object with a default description string and default icon.AutoLocalizedAction(String name)
Builds aAutoLocalizedAction
object with the specified description string and a default icon.AutoLocalizedAction(String name, Icon icon)
Builds aAutoLocalizedAction
object with the specified description string and a the specified icon. -
Method Summary
Modifier and TypeMethodDescription(package private) void
This package method allows to set some operation after callingILocalized.setLanguage()
.(package private) void
This package method allows to set some operation before callingILocalized.setLanguage()
.protected void
This method is called in the constructor after theILocalized.setLanguage()
methodprotected void
init()
void
Override this to improve performances if you have a collection ofAutoLocalizedAction
objects, to load only once the resource bundle and update all theAutoLocalizedAction
objects.Methods inherited from class be.gaudry.swing.action.LocalizableAction
doOnCreate
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
Methods inherited from interface be.gaudry.model.locale.ILocalized
setLanguage
-
Constructor Details
-
AutoLocalizedAction
public AutoLocalizedAction()Builds aAutoLocalizedAction
object with a default description string and default icon. -
AutoLocalizedAction
Builds aAutoLocalizedAction
object with the specified description string and a default icon.- Parameters:
name
- description of the action
-
AutoLocalizedAction
Builds aAutoLocalizedAction
object 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:
init
in 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 ofAutoLocalizedAction
objects, to load only once the resource bundle and update all theAutoLocalizedAction
objects. \nOverride this also to observe more than theLanguageHelper
. \nThis method is called whenever the observedLanguageHelper
is changed. An application calls an Observable object'snotifyObservers
method 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:
propertyChange
in 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.NAME
to get the name of the action after having set the language. \nThis is only called after an update due to aLanguageHelper
notification, 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 aLanguageHelper
notification, not before an explicitILocalized.setLanguage()
call. \nDefault implementation does nothing.
-