Revision 9d11084b
Added by Cherian Mathew almost 9 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/session/CdmChangeEvent.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
private final Action action; |
30 | 30 |
private final List<Object> changedObjects; |
31 |
private final Class<? extends Component> sourceType; |
|
31 |
private Class<? extends Component> sourceType; |
|
32 |
private Object source; |
|
32 | 33 |
|
33 | 34 |
public CdmChangeEvent(Action action, List<Object> changedObjects, Class<? extends Component> sourceType) { |
34 | 35 |
this.action = action; |
... | ... | |
42 | 43 |
} |
43 | 44 |
} |
44 | 45 |
|
46 |
public CdmChangeEvent(Action action, List<Object> changedObjects, Component source) { |
|
47 |
this.action = action; |
|
48 |
this.changedObjects = changedObjects; |
|
49 |
if(changedObjects == null || changedObjects.isEmpty()) { |
|
50 |
throw new IllegalArgumentException("Changed objects cannot be empty"); |
|
51 |
} |
|
52 |
this.source= source; |
|
53 |
if(source == null) { |
|
54 |
throw new IllegalArgumentException("Source cannot be null"); |
|
55 |
} |
|
56 |
this.sourceType = source.getClass(); |
|
57 |
} |
|
58 |
|
|
45 | 59 |
/** |
46 | 60 |
* @return the action |
47 | 61 |
*/ |
... | ... | |
63 | 77 |
return sourceType; |
64 | 78 |
} |
65 | 79 |
|
80 |
|
|
81 |
/** |
|
82 |
* @return the source |
|
83 |
*/ |
|
84 |
public Object getSource() { |
|
85 |
return source; |
|
86 |
} |
|
87 |
|
|
66 | 88 |
} |
Also available in: Unified diff
related to #4886
ConceptRelationshipComposite, D3ConceptRelationshipTree, ConceptRelationshipPresenter, IConceptRelationshipComponentListener, d3.conceptrelationshiptree_connector.js : added possibility to clear concept relationship tree
CdmChangeEvent : added new constructor with possibility to add source component
NewTaxonBaseComposite : passing source object and taxon / synonym creation flag to event
StatusComposite :