fr.ifremer.isisfish.ui.input
Class InputSaveVerifier

java.lang.Object
  extended by fr.ifremer.isisfish.ui.input.InputSaveVerifier
All Implemented Interfaces:
SaveVerifier
Direct Known Subclasses:
SensitivitySaveVerifier

public class InputSaveVerifier
extends Object
implements SaveVerifier

InputSaveVerifier.

Version:
$Revision: 1312 $ Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ by : $Author: sletellier $
Author:
letellier

Field Summary
protected  boolean changed
          Current entity modification state (modifier by PCL).
protected  HashMap<String,org.nuiton.topia.persistence.TopiaEntityContextable> currentEntities
          Map entity key to TopiaEntity.
protected  PropertyChangeListener entityPCL
          Intance unique de PCL pour pouvoir être ajouter et supprimé au bon moment.
protected  InputContentUI<?> inputContentUI
          L'ui en cours d'edition (au plus bas niveau des tabPane).
 
Constructor Summary
InputSaveVerifier()
           
 
Method Summary
 void 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 checkEdit()
          Tell verifier to check for unsaved modification.
 void create(Class<? extends org.nuiton.topia.persistence.TopiaEntityContextable> type)
          Create new type 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
getEntity(Class<E> clazz)
           
<E extends org.nuiton.topia.persistence.TopiaEntityContextable>
E
getEntity(Class<E> clazz, String key)
           
 InputContentUI<?> getInputContentUI()
           
protected  void noModif()
          Called by this class when entity modification state has been reset.
 void removeCurrentEntity(String key)
          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 topiaChanged()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changed

protected boolean changed
Current entity modification state (modifier by PCL).


inputContentUI

protected InputContentUI<?> inputContentUI
L'ui en cours d'edition (au plus bas niveau des tabPane).


currentEntities

protected HashMap<String,org.nuiton.topia.persistence.TopiaEntityContextable> currentEntities
Map entity key to TopiaEntity.


entityPCL

protected PropertyChangeListener entityPCL
Intance unique de PCL pour pouvoir être ajouter et supprimé au bon moment.

Constructor Detail

InputSaveVerifier

public InputSaveVerifier()
Method Detail

getInputContentUI

public InputContentUI<?> getInputContentUI()

setInputContentUI

public void setInputContentUI(InputContentUI<?> inputContentUI)

checkEdit

public int checkEdit()
Tell verifier to check for unsaved modification. Then return user choice (JOptionPane type).

Specified by:
checkEdit in interface SaveVerifier
Returns:
user JOptionPane response
See Also:
JOptionPane.YES_OPTION, JOptionPane.NO_OPTION, JOptionPane.CANCEL_OPTION

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 >.*"


create

public void create(Class<? extends org.nuiton.topia.persistence.TopiaEntityContextable> type)
Create new type 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 - parent
labelMessage - label message
textMessage - text message into area
title -
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 using TopiaEntity.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
key - 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 using TopiaEntity.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

public void removeCurrentEntity(String key)
Remove monitored entities.

Parameters:
key - entity key to remove

reset

public void reset()
Reset state.


getEntity

public <E extends org.nuiton.topia.persistence.TopiaEntityContextable> E getEntity(Class<E> clazz,
                                                                                   String key)

getEntity

public <E extends org.nuiton.topia.persistence.TopiaEntityContextable> E getEntity(Class<E> clazz)


Copyright © 1999-2012 CodeLutin. All Rights Reserved.