Project

General

Profile

« Previous | Next » 

Revision 49d3c2dd

Added by Katja Luther over 1 year ago

ref #10186: remove conversation holder

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/DescriptiveDataSetEditor.java
53 53
import org.eclipse.swt.widgets.Display;
54 54
import org.eclipse.swt.widgets.Shell;
55 55

  
56
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
57
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
58 56
import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
59 57
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
60 58
import eu.etaxonomy.cdm.api.service.ITermService;
......
89 87
 * @since Nov 21, 2017
90 88
 *
91 89
 */
92
public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEnabled, 
90
public class DescriptiveDataSetEditor implements IE4SavablePart, 
93 91
		ICdmEntitySessionEnabled<DescriptiveDataSet>, IPartContentHasDetails, 
94 92
		IPartContentHasSupplementalData, IDirtyMarkable, IDescriptiveDataSetEditor {
95 93

  
96 94
    private DescriptiveDataSetComposite composite;
97 95

  
98
    private ConversationHolder conversation;
99

  
100 96
    private ICdmEntitySession cdmEntitySession;
101 97

  
102 98
    private DescriptiveDataSet descriptiveDataSet;
......
118 114
    public void create(Composite parent, IEclipseContext context, @Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
119 115
            EMenuService menuService){
120 116
        if (CdmStore.isActive()){
121
            if(conversation == null){
122
                conversation = CdmStore.createConversation();
123
            }
124 117
            if(cdmEntitySession == null){
125 118
                cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
126 119
            }
......
292 285
    @Override
293 286
    public void save(IProgressMonitor monitor) {
294 287

  
295
        if (!conversation.isBound()) {
296
            conversation.bind();
297

  
298
        }
299
        conversation.commit(true);
300 288
        Collection<TermDto> areas = composite.getAreas();
301 289
        Object input = composite.getTaxonNodeTree().getInput();
302 290
        if(input!=null){
......
348 336

  
349 337
    @PreDestroy
350 338
    public void dispose() {
351
        if (conversation != null) {
352
            conversation.close();
353
            conversation = null;
354
        }
355 339
        if(cdmEntitySession != null) {
356 340
            cdmEntitySession.dispose();
357 341
            cdmEntitySession = null;
......
365 349
        if(composite!=null){
366 350
            composite.setFocus();
367 351
        }
368
        if (getConversationHolder() != null) {
369
            getConversationHolder().bind();
370
        }
352

  
371 353
        if(cdmEntitySession != null) {
372 354
            cdmEntitySession.bind();
373 355
        }
......
381 363
        return descriptiveDataSet;
382 364
    }
383 365

  
384
    @Override
385
    public void update(CdmDataChangeMap arg0) {
386
    }
366
    
387 367

  
388 368
    @Override
389 369
    public ICdmEntitySession getCdmEntitySession() {
......
400 380
        return null;
401 381
    }
402 382

  
403
    @Override
404
    public ConversationHolder getConversationHolder() {
405
        return conversation;
406
    }
407

  
408 383
    @Override
409 384
    public void changed(Object element) {
410 385
        dirty.setDirty(true);

Also available in: Unified diff