Package fr.ifremer.isisfish.ui.input
Class InputSaveVerifier
java.lang.Object
fr.ifremer.isisfish.ui.input.InputSaveVerifier
- All Implemented Interfaces:
SaveVerifier
- Direct Known Subclasses:
SensitivitySaveVerifier
InputSaveVerifier.
- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- letellier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanCurrent entity modification state (modifier by PCL).Map entity key toTopiaEntity.protected PropertyChangeListenerIntance unique de PCL pour pouvoir être ajouter et supprimé au bon moment.protected InputContentUI<?>L'ui en cours d'edition (au plus bas niveau des tabPane).Fields inherited from interface fr.ifremer.isisfish.ui.SaveVerifier
CANCEL_OPTION, NO_OPTION, YES_OPTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCurrentEntity(org.nuiton.topia.persistence.TopiaEntityContextable currentEntity) Add entity to check for modification.voidaddCurrentEntity(org.nuiton.topia.persistence.TopiaEntityContextable currentEntity, String key) Add entity to check for modification.voidcancel()Cancel all modification on entity (rollback), and force reload it.intTell verifier to check for unsaved modification.voidCreate newtypeentity.voiddelete()Delete one entity and commit the change, try to selected intelligently other node in tree.<E extends org.nuiton.topia.persistence.TopiaEntityContextable>
E<E extends org.nuiton.topia.persistence.TopiaEntityContextable>
Eprotected voidnoModif()Called by this class when entity modification state has been reset.voidRemove monitored entities.voidreset()Reset state.voidsave()Save all non saved entities.voidsetInputContentUI(InputContentUI<?> inputContentUI) protected intshowTextAreaConfirmationMessage(Component parent, String labelMessage, String textMessage, String title, int option) Display a JOptionPane with a JTextArea as main component.protected voidprotected StringtoString(org.nuiton.topia.persistence.TopiaEntity e) Try to get toString value from entity using entity name (or toString if name is not defined).
-
Field Details
-
changed
protected boolean changedCurrent entity modification state (modifier by PCL). -
inputContentUI
L'ui en cours d'edition (au plus bas niveau des tabPane). -
currentEntities
Map entity key toTopiaEntity. -
entityPCL
Intance unique de PCL pour pouvoir être ajouter et supprimé au bon moment.
-
-
Constructor Details
-
InputSaveVerifier
public InputSaveVerifier()
-
-
Method Details
-
getInputContentUI
-
setInputContentUI
-
checkEdit
public int checkEdit()Tell verifier to check for unsaved modification. Then return user choice (JOptionPanetype).- Specified by:
checkEditin interfaceSaveVerifier- Returns:
- user JOptionPane response
- See Also:
-
topiaChanged
protected void topiaChanged() -
noModif
protected void noModif()Called by this class when entity modification state has been reset. (cancel, save...) -
delete
public void delete()Delete one entity and commit the change, try to selected intelligently other node in tree.Refresh all ui component where name match "input<entity type without package >.*"
-
toString
Try to get toString value from entity using entity name (or toString if name is not defined).- Parameters:
e- entity- Returns:
-
create
Create newtypeentity.- Parameters:
type-
-
save
public void save()Save all non saved entities. Change registered button states. Commit opened topia context. -
cancel
public void cancel()Cancel all modification on entity (rollback), and force reload it. -
showTextAreaConfirmationMessage
protected int showTextAreaConfirmationMessage(Component parent, String labelMessage, String textMessage, String title, int option) Display a JOptionPane with a JTextArea as main component.- Parameters:
parent- parentlabelMessage- label messagetextMessage- text message into areatitle-option-- Returns:
- user response
-
addCurrentEntity
public void addCurrentEntity(org.nuiton.topia.persistence.TopiaEntityContextable currentEntity, String key) Add entity to check for modification. The verifier register to entity usingTopiaEntity.addPropertyChangeListener(PropertyChangeListener). So modification have to be done on current entity. To check for embedded entity, add it too. Remove all entity with key- Parameters:
currentEntity- entity to checkkey- specific key (default to topiaId)
-
addCurrentEntity
public void addCurrentEntity(org.nuiton.topia.persistence.TopiaEntityContextable currentEntity) Add entity to check for modification. The verifier register to entity usingTopiaEntity.addPropertyChangeListener(PropertyChangeListener). So modification have to be done on current entity. To check for embedded entity, add it too. Remove all entity with key- Parameters:
currentEntity- entity to check
-
removeCurrentEntity
Remove monitored entities.- Parameters:
key- entity key to remove
-
reset
public void reset()Reset state. -
getEntity
-
getEntity
-