Class AbstractApplicationAction<M extends org.jdesktop.beans.AbstractBean,UI extends ApplicationUI<M,?>,H extends AbstractApplicationUIHandler<M,UI>>
- java.lang.Object
-
- org.jdesktop.beans.AbstractBean
-
- org.nuiton.jaxx.application.swing.action.AbstractApplicationAction<M,UI,H>
-
public abstract class AbstractApplicationAction<M extends org.jdesktop.beans.AbstractBean,UI extends ApplicationUI<M,?>,H extends AbstractApplicationUIHandler<M,UI>> extends org.jdesktop.beans.AbstractBeanTutti base action.- Since:
- 2.8
- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected StringactionDescriptionprotected Hhandlerprotected booleanhideBodyprotected Objectlockstatic StringMESAGE_FORMATstatic StringPROPERTY_DONE
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractApplicationAction(H handler, boolean hideBody)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanaskBeforeDelete(String title, String message)protected booleanaskOverwriteFile(File file)protected FilechooseFile(String title, String buttonLabel, String... filters)Choisir un fichier via un sélecteur graphique de fichiers.protected voidcreateProgressionModelIfRequired(int total)protected Stringdecorate(Object object)protected Stringdecorate(Object object, String context)protected voiddisplayErrorMessage(String title, String message)protected voiddisplayInfoMessage(String title, String message)protected voiddisplayWarningMessage(String title, String message)abstract voiddoAction()StringgetActionDescription()ApplicationActionEnginegetActionEngine()ApplicationActionFactorygetActionFactory()protected ApplicationConfigurationgetConfig()ApplicationUIContextgetContext()protected <O> org.nuiton.decorator.Decorator<O>getDecorator(Class<O> type, String name)protected ComponentgetDialogParentComponent()HgetHandler()MgetModel()protected ApplicationProgressionModelgetProgressionModel()UIgetUI()booleanisHideBody()voidpostFailedAction(Throwable error)voidpostSuccessAction()booleanprepareAction()protected voidreleaseAction()protected FilesaveFile(File defaultFile, String filename, String extension, String title, String buttonLabel, String... filters)Sauver un fichier via un sélecteur graphique de fichiers.protected FilesaveFile(String filename, String extension, String title, String buttonLabel, String... filters)Sauver un fichier via un sélecteur graphique de fichiers.protected FilesaveFileWithStartDirectory(File startDirectory, boolean keepCurrentDirectory, String filename, String extension, String title, String buttonLabel, String... filters)Sauver un fichier via un sélecteur graphique de fichiers, en précisant le répertoire où sauvegarder le fichier.protected abstract voidsendMessage(String message)voidsetActionDescription(String actionDescription)voidsetProgressionModel(ApplicationProgressionModel progressionModel)-
Methods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Field Detail
-
PROPERTY_DONE
public static final String PROPERTY_DONE
- See Also:
- Constant Field Values
-
MESAGE_FORMAT
public static final String MESAGE_FORMAT
- See Also:
- Constant Field Values
-
handler
protected final H extends AbstractApplicationUIHandler<M,UI> handler
-
actionDescription
protected String actionDescription
-
hideBody
protected final boolean hideBody
-
lock
protected final Object lock
-
-
Constructor Detail
-
AbstractApplicationAction
protected AbstractApplicationAction(H handler, boolean hideBody)
-
-
Method Detail
-
releaseAction
protected void releaseAction()
-
postSuccessAction
public void postSuccessAction()
-
postFailedAction
public void postFailedAction(Throwable error)
-
getHandler
public H getHandler()
-
getModel
public M getModel()
-
getUI
public final UI getUI()
-
getContext
public ApplicationUIContext getContext()
-
getActionDescription
public String getActionDescription()
-
setActionDescription
public void setActionDescription(String actionDescription)
-
setProgressionModel
public void setProgressionModel(ApplicationProgressionModel progressionModel)
-
getProgressionModel
protected ApplicationProgressionModel getProgressionModel()
-
isHideBody
public boolean isHideBody()
-
getConfig
protected ApplicationConfiguration getConfig()
-
sendMessage
protected abstract void sendMessage(String message)
-
getDecorator
protected <O> org.nuiton.decorator.Decorator<O> getDecorator(Class<O> type, String name)
-
chooseFile
protected File chooseFile(String title, String buttonLabel, String... filters)
Choisir un fichier via un sélecteur graphique de fichiers.- Parameters:
title- le titre du dialogue de sélectionbuttonLabel- le label du boutton d'acceptationfilters- les filtres + descriptions sur le sélecteur de fichiers- Returns:
- le fichier choisi ou le fichier incoming si l'opération a été annulée
-
saveFile
protected File saveFile(File defaultFile, String filename, String extension, String title, String buttonLabel, String... filters)
Sauver un fichier via un sélecteur graphique de fichiers.- Parameters:
title- le titre du dialogue de sélectionbuttonLabel- le label du boutton d'acceptationfilters- les filtres + descriptions sur le sélecteur de fichiers- Returns:
- le fichier choisi ou
nullsi pas de fichier choisi ou pas voulu écrasé un fichier existant.
-
saveFile
protected File saveFile(String filename, String extension, String title, String buttonLabel, String... filters)
Sauver un fichier via un sélecteur graphique de fichiers.- Parameters:
title- le titre du dialogue de sélectionbuttonLabel- le label du boutton d'acceptationfilters- les filtres + descriptions sur le sélecteur de fichiers- Returns:
- le fichier choisi ou
nullsi pas de fichier choisi ou pas voulu écrasé un fichier existant.
-
saveFileWithStartDirectory
protected File saveFileWithStartDirectory(File startDirectory, boolean keepCurrentDirectory, String filename, String extension, String title, String buttonLabel, String... filters)
Sauver un fichier via un sélecteur graphique de fichiers, en précisant le répertoire où sauvegarder le fichier.- Parameters:
startDirectory- le répertoire à utiliser pour choisir le fichierkeepCurrentDirectory- un drapeau pour dire si on veut ou pas conserver le répertoire choisit comme nouveau répertoire par défauttitle- le titre du dialogue de sélectionbuttonLabel- le label du boutton d'acceptationfilters- les filtres + descriptions sur le sélecteur de fichiers- Returns:
- le fichier choisi ou
nullsi pas de fichier choisi ou pas voulu écrasé un fichier existant. - Since:
- 2.17
-
askOverwriteFile
protected boolean askOverwriteFile(File file)
-
getDialogParentComponent
protected Component getDialogParentComponent()
-
createProgressionModelIfRequired
protected void createProgressionModelIfRequired(int total)
-
getActionFactory
public ApplicationActionFactory getActionFactory()
-
getActionEngine
public ApplicationActionEngine getActionEngine()
-
-