public class InputSaveVerifier extends Object implements SaveVerifier
Modifier and Type | Field and Description |
---|---|
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).
|
CANCEL_OPTION, NO_OPTION, YES_OPTION
Constructor and Description |
---|
InputSaveVerifier() |
Modifier and Type | Method and Description |
---|---|
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> |
getEntity(Class<E> clazz) |
<E extends org.nuiton.topia.persistence.TopiaEntityContextable> |
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() |
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).
|
protected boolean changed
protected InputContentUI<?> inputContentUI
protected HashMap<String,org.nuiton.topia.persistence.TopiaEntityContextable> currentEntities
TopiaEntity
.protected PropertyChangeListener entityPCL
public InputContentUI<?> getInputContentUI()
public void setInputContentUI(InputContentUI<?> inputContentUI)
public int checkEdit()
JOptionPane
type).checkEdit
in interface SaveVerifier
JOptionPane.YES_OPTION
,
JOptionPane.NO_OPTION
,
JOptionPane.CANCEL_OPTION
protected void topiaChanged()
protected void noModif()
public void delete()
Refresh all ui component where name match "input<entity type without package >.*"
protected String toString(org.nuiton.topia.persistence.TopiaEntity e)
e
- entitypublic void create(Class<? extends org.nuiton.topia.persistence.TopiaEntityContextable> type)
type
entity.type
- public void save()
public void cancel()
protected int showTextAreaConfirmationMessage(Component parent, String labelMessage, String textMessage, String title, int option)
parent
- parentlabelMessage
- label messagetextMessage
- text message into areatitle
- option
- public void addCurrentEntity(org.nuiton.topia.persistence.TopiaEntityContextable currentEntity, String key)
TopiaEntity.addPropertyChangeListener(PropertyChangeListener)
.
So modification have to be done on current entity.
To check for embedded entity, add it too.
Remove all entity with keycurrentEntity
- entity to checkkey
- specific key (default to topiaId)public void addCurrentEntity(org.nuiton.topia.persistence.TopiaEntityContextable currentEntity)
TopiaEntity.addPropertyChangeListener(PropertyChangeListener)
.
So modification have to be done on current entity.
To check for embedded entity, add it too.
Remove all entity with keycurrentEntity
- entity to checkpublic void removeCurrentEntity(String key)
key
- entity key to removepublic void reset()
public <E extends org.nuiton.topia.persistence.TopiaEntityContextable> E getEntity(Class<E> clazz, String key)
public <E extends org.nuiton.topia.persistence.TopiaEntityContextable> E getEntity(Class<E> clazz)
Copyright © 1999–2020 CodeLutin. All rights reserved.