Revision 49d3c2dd
Added by Katja Luther over 1 year ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/e4/CdmAuthorityEditorE4.java | ||
---|---|---|
21 | 21 |
import org.eclipse.swt.layout.FillLayout; |
22 | 22 |
import org.eclipse.swt.widgets.Composite; |
23 | 23 |
|
24 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
25 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
|
26 | 24 |
import eu.etaxonomy.cdm.model.permission.Group; |
27 | 25 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
28 | 26 |
import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput; |
... | ... | |
37 | 35 |
* @created Mar 28, 2013 |
38 | 36 |
* |
39 | 37 |
*/ |
40 |
public class CdmAuthorityEditorE4 implements IConversationEnabled, IDirtyMarkable {
|
|
38 |
public class CdmAuthorityEditorE4 implements IDirtyMarkable { |
|
41 | 39 |
|
42 | 40 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.group.authority"; //$NON-NLS-1$ |
43 | 41 |
|
44 | 42 |
@Inject |
45 | 43 |
private MDirtyable dirty; |
46 |
private ConversationHolder conversation; |
|
47 | 44 |
private CdmAuthorityCompositeViewer viewer; |
48 | 45 |
|
49 | 46 |
private CdmAuthorityEditorInput input; |
... | ... | |
80 | 77 |
public void doSave(IProgressMonitor monitor) { |
81 | 78 |
try { |
82 | 79 |
monitor.beginTask(Messages.CdmAuthorityEditor_SAVING_AUTHORITY_EDITOR, 1); |
83 |
getConversationHolder().commit(true); |
|
84 | 80 |
input.merge(); |
85 | 81 |
dirty.setDirty(false); |
86 | 82 |
monitor.worked(1); |
... | ... | |
92 | 88 |
|
93 | 89 |
public void init(CdmAuthorityEditorInput input) { |
94 | 90 |
this.input = input; |
95 |
|
|
96 |
conversation = input.getConversationHolder(); |
|
97 |
|
|
98 | 91 |
this.viewer = new CdmAuthorityCompositeViewer(container, this,input.getGroup()); |
99 | 92 |
|
100 | 93 |
thisPart.setLabel(input.getName()); |
... | ... | |
109 | 102 |
return input; |
110 | 103 |
} |
111 | 104 |
|
112 |
@Override |
|
113 |
public void update(CdmDataChangeMap changeEvents) { |
|
114 |
} |
|
115 |
|
|
116 | 105 |
@Override |
117 | 106 |
public void changed(Object element) { |
118 | 107 |
//FIXME : should be optimised to split changes into adding / removing authorities |
... | ... | |
133 | 122 |
changed(null); |
134 | 123 |
} |
135 | 124 |
|
136 |
@Override |
|
137 |
public ConversationHolder getConversationHolder() { |
|
138 |
return conversation; |
|
139 |
} |
|
140 |
|
|
141 | 125 |
@PreDestroy |
142 | 126 |
public void dispose() { |
143 |
if(conversation!=null){ |
|
144 |
conversation.unregisterForDataStoreChanges(this); |
|
145 |
conversation.close(); |
|
146 |
conversation = null; |
|
147 |
} |
|
127 |
|
|
148 | 128 |
if(input!=null){ |
149 | 129 |
input.getCdmEntitySession().dispose(); |
150 | 130 |
} |
Also available in: Unified diff
ref #10186: remove conversation holder