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
Modifier and TypeFieldDescriptionprotected boolean
Current entity modification state (modifier by PCL).Map entity key toTopiaEntity
.protected PropertyChangeListener
Intance 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCurrentEntity
(org.nuiton.topia.persistence.TopiaEntityContextable currentEntity) Add entity to check for modification.void
addCurrentEntity
(org.nuiton.topia.persistence.TopiaEntityContextable currentEntity, String key) Add entity to check for modification.void
cancel()
Cancel all modification on entity (rollback), and force reload it.int
Tell verifier to check for unsaved modification.void
Create newtype
entity.void
delete()
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 void
noModif()
Called by this class when entity modification state has been reset.void
Remove monitored entities.void
reset()
Reset state.void
save()
Save all non saved entities.void
setInputContentUI
(InputContentUI<?> inputContentUI) protected int
showTextAreaConfirmationMessage
(Component parent, String labelMessage, String textMessage, String title, int option) Display a JOptionPane with a JTextArea as main component.protected void
protected String
toString
(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 (JOptionPane
type).- Specified by:
checkEdit
in 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 newtype
entity.- 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
-