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.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java
41 41
import org.eclipse.swt.widgets.TreeItem;
42 42
import org.eclipse.ui.IMemento;
43 43

  
44
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
45
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
46 44
import eu.etaxonomy.cdm.api.service.ITermService;
47 45
import eu.etaxonomy.cdm.api.service.IVocabularyService;
48 46
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
......
74 72
 * @since Aug 22, 2017
75 73
 *
76 74
 */
77
public class DefinedTermEditorE4 implements IConversationEnabled, IDirtyMarkable, IPostOperationEnabled,
75
public class DefinedTermEditorE4 implements IDirtyMarkable, IPostOperationEnabled,
78 76
IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContextListener {
79 77

  
80 78
	public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openDefinedTermEditor"; //$NON-NLS-1$
......
82 80

  
83 81
	protected TreeViewer viewer;
84 82

  
85
	protected ConversationHolder conversation;
86

  
87
    @Inject
83
	@Inject
88 84
    private ESelectionService selService;
89 85

  
90 86
    @Inject
......
109 105
	@PostConstruct
110 106
	public void createPartControl(Composite parent, EMenuService menuService,
111 107
	        IEclipseContext context) {
112
	    if (CdmStore.isActive()){
113
            if(conversation == null){
114
                conversation = CdmStore.createConversation();
115
            }
116
        }
117
        else{
118
            return;
119
        }
108
	    
120 109
	    FillLayout layout = new FillLayout();
121 110
	    layout.marginHeight = 0;
122 111
	    layout.marginWidth = 0;
......
197 186
	@Override
198 187
    @Persist
199 188
	public void save(IProgressMonitor monitor) {
200
		getConversationHolder().commit();
201 189
		List<DefinedTermBase> terms = new ArrayList<>();
202 190
		List<TermVocabulary> vocs = new ArrayList<>();
203 191
		for(TermBase term:changedTerms){
......
234 222
	    if(viewer!=null && viewer.getControl() != null && !viewer.getControl().isDisposed()){
235 223
	        viewer.getControl().setFocus();
236 224
	    }
237
	    if(conversation!=null){
238
	        conversation.bind();
239
	    }
240
		if(input!=null){
225
	    if(input!=null){
241 226
		    input.bind();
242 227
		}
243 228

  
......
246 231
		}
247 232
	}
248 233

  
249
	@Override
250
	public void update(CdmDataChangeMap changeEvents) {
251
	}
252

  
253
	@Override
254
	public ConversationHolder getConversationHolder() {
255
		return conversation;
256
	}
257

  
258 234
	@Override
259 235
	public void changed(Object element) {
260 236
	    if(element instanceof DefinedTermBase){
......
295 271

  
296 272
	@PreDestroy
297 273
	public void dispose() {
298
	    if(conversation!=null){
299
	        conversation.unregisterForDataStoreChanges(this);
300
	        conversation.close();
301
	        conversation = null;
302
	    }
303 274
	    if(input!=null){
304 275
	        input.dispose();
305 276
	    }

Also available in: Unified diff