Revision 49d3c2dd
Added by Katja Luther over 1 year ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixPart.java | ||
---|---|---|
38 | 38 |
import org.eclipse.swt.widgets.Composite; |
39 | 39 |
import org.eclipse.swt.widgets.Label; |
40 | 40 |
|
41 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
42 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
|
43 | 41 |
import eu.etaxonomy.cdm.api.service.DeleteResult; |
44 | 42 |
import eu.etaxonomy.cdm.api.service.IDescriptionService; |
45 | 43 |
import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService; |
... | ... | |
73 | 71 |
* @author pplitzner |
74 | 72 |
* @since Nov 26, 2017 |
75 | 73 |
*/ |
76 |
public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled, IDirtyMarkable,
|
|
74 |
public class CharacterMatrixPart implements IE4SavablePart, IDirtyMarkable, |
|
77 | 75 |
ICdmEntitySessionEnabled<DescriptiveDataSet>, IPartContentHasSupplementalData, |
78 | 76 |
IPartContentHasDetails { |
79 | 77 |
|
... | ... | |
103 | 101 |
|
104 | 102 |
private DescriptiveDataSetBaseDto descriptiveDataSet; |
105 | 103 |
|
106 |
private ConversationHolder conversation; |
|
107 |
|
|
108 | 104 |
private ICdmEntitySession cdmEntitySession; |
109 | 105 |
|
110 | 106 |
@Inject |
... | ... | |
127 | 123 |
|
128 | 124 |
@PostConstruct |
129 | 125 |
public void create(Composite parent, IEclipseContext context) { |
130 |
if(CdmStore.isActive() && conversation==null){ |
|
131 |
conversation = CdmStore.createConversation(); |
|
132 |
} |
|
133 |
if(cdmEntitySession == null){ |
|
126 |
if(cdmEntitySession == null){ |
|
134 | 127 |
cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true); |
135 | 128 |
cdmEntitySession.bind(); |
136 | 129 |
} |
... | ... | |
258 | 251 |
|
259 | 252 |
@Focus |
260 | 253 |
public void setFocus(){ |
261 |
if(conversation!=null){ |
|
262 |
conversation.bind(); |
|
263 |
} |
|
264 | 254 |
if(cdmEntitySession != null) { |
265 | 255 |
cdmEntitySession.bind(); |
266 | 256 |
} |
... | ... | |
268 | 258 |
|
269 | 259 |
@PreDestroy |
270 | 260 |
public void dispose(){ |
271 |
if (conversation != null) { |
|
272 |
conversation.close(); |
|
273 |
conversation = null; |
|
274 |
} |
|
275 | 261 |
if(cdmEntitySession != null) { |
276 | 262 |
cdmEntitySession.dispose(); |
277 | 263 |
cdmEntitySession = null; |
... | ... | |
281 | 267 |
dirty.setDirty(false); |
282 | 268 |
} |
283 | 269 |
|
284 |
@Override |
|
285 |
public void update(CdmDataChangeMap arg0) { |
|
286 |
} |
|
287 |
|
|
288 |
@Override |
|
289 |
public ConversationHolder getConversationHolder() { |
|
290 |
return conversation; |
|
291 |
} |
|
292 |
|
|
293 | 270 |
@Override |
294 | 271 |
public void changed(Object element) { |
295 | 272 |
setDirty(); |
Also available in: Unified diff
ref #10186: remove conversation holder