Project

General

Profile

« Previous | Next » 

Revision 8c8ead8a

Added by Cherian Mathew almost 9 years ago

Update ICdmEntitySessionEnabled to no longer extend ICdmChangeListener

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineEditor.java
10 10
package eu.etaxonomy.taxeditor.annotatedlineeditor;
11 11

  
12 12
import java.util.Iterator;
13
import java.util.List;
14 13

  
15 14
import org.eclipse.core.runtime.CoreException;
16 15
import org.eclipse.core.runtime.IProgressMonitor;
......
24 23
import org.eclipse.ui.editors.text.TextEditor;
25 24
import org.eclipse.ui.texteditor.IDocumentProvider;
26 25

  
27
import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
28 26
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
29 27
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
30 28
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
......
33 31
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
34 32
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
35 33
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
36
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
37
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
38 34
import eu.etaxonomy.taxeditor.store.CdmStore;
39 35

  
40 36
/**
......
50 46
 * @created 25.06.2009
51 47
 * @version 1.0
52 48
 */
53
public class AnnotatedLineEditor extends TextEditor implements IConversationEnabled, IPostOperationEnabled, ICdmEntitySessionEnabled {
49
public class AnnotatedLineEditor extends TextEditor implements IConversationEnabled, IPostOperationEnabled {
54 50

  
55 51
    protected ConversationHolder conversation;
56 52

  
57 53
    private IEntityPersistenceService persistenceService;
58 54
    protected ILineDisplayStrategy lineDisplayStrategy;
59
    private final ICdmEntitySession cdmEntitySession;
55

  
60 56

  
61 57
    /**
62 58
     * <p>Constructor for AnnotatedLineEditor.</p>
......
65 61
     */
66 62
    public AnnotatedLineEditor(ConversationHolder conversation) {
67 63
        this.conversation = conversation;
68
        cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
69 64
    }
70 65

  
71 66
    /* (non-Javadoc)
......
265 260
        if (getConversationHolder() != null) {
266 261
            getConversationHolder().bind();
267 262
        }
268
        cdmEntitySession.bind();
263
        ((AbstractBulkEditorInput)getEditorInput()).bind();
269 264
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
270 265
        // TODO pass focus to underlying widgets
271 266
    }
......
327 322
    public void dispose() {
328 323
        super.dispose();
329 324
        conversation.close();
330
        cdmEntitySession.dispose();
325
        ((AbstractBulkEditorInput)getEditorInput()).dispose();
331 326
    }
332 327

  
333 328
    /**
......
341 336
        return false;
342 337
    }
343 338

  
344
    /* (non-Javadoc)
345
     * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
346
     */
347
    @Override
348
    public void onChange(CdmChangeEvent event) {
349
        // TODO Auto-generated method stub
350

  
351
    }
352

  
353
    /* (non-Javadoc)
354
     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
355
     */
356
    @Override
357
    public ICdmEntitySession getCdmEntitySession() {
358
        return cdmEntitySession;
359
    }
360

  
361
    /* (non-Javadoc)
362
     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
363
     */
364
    @Override
365
    public <T extends CdmBase> List<T> getRootEntities() {
366
        AbstractBulkEditorInput input = (AbstractBulkEditorInput)getEditorInput();
367
        return input.getModel();
368
    }
369 339

  
370 340
}

Also available in: Unified diff