2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.editor
.key
.e4
;
12 import java
.util
.Vector
;
14 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
15 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeEvent
;
16 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeEvent
.EventType
;
17 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
18 import eu
.etaxonomy
.taxeditor
.editor
.key
.polytomous
.PolytomousKeyEditorInput
;
19 import eu
.etaxonomy
.taxeditor
.editor
.key
.polytomous
.e4
.PolytomousKeyListEditorE4
;
20 import eu
.etaxonomy
.taxeditor
.model
.AbstractDataChangeBehaviour
;
24 * @created May 5, 2011
27 public class KeyEditorDataChangeBehaviourE4
extends AbstractDataChangeBehaviour
{
29 private final PolytomousKeyListEditorE4 source
;
30 private PolytomousKeyEditorInput input
;
32 public KeyEditorDataChangeBehaviourE4(PolytomousKeyListEditorE4 keyEditor
) {
37 public void reactOnDataChange(CdmDataChangeMap changeEvents
) {
38 input
= source
.getEditorInput();
40 if(changeEvents
.sizeByEventType(EventType
.UPDATE
) > 0){
41 reactOnUpdate(changeEvents
.getEvents(EventType
.UPDATE
));
47 public void reactOnUpdate(Vector
<CdmDataChangeEvent
> events
){
49 for(CdmDataChangeEvent event
: events
){
51 // update editor title
52 if(event
.getEntity() instanceof PolytomousKey
){
53 if(input
.getKey().equals(event
.getEntity())){
54 // set the name of the editor window