Project

General

Profile

Revision 75c87e6f

ID75c87e6f74e383e139581107e6279ef6420ffd05
Parent fe08ca2d
Child 5ee3fb57

Added by Patrick Plitzner 12 months ago

ref #7887 Refactor IPostOperationEnabled.postOperation() to Object

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java
236 236
    }
237 237

  
238 238
    @Override
239
    public boolean postOperation(CdmBase objectAffectedByOperation) {
239
    public boolean postOperation(Object objectAffectedByOperation) {
240 240
        return false;
241 241
    }
242 242

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/AbstractGraphKeyEditorE4.java
26 26
import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
27 27

  
28 28
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
29
import eu.etaxonomy.cdm.model.common.CdmBase;
30 29
import eu.etaxonomy.cdm.model.description.IIdentificationKey;
31 30
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
32 31
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
......
157 156
	}
158 157

  
159 158
	@Override
160
	public boolean postOperation(CdmBase objectAffectedByOperation) {
159
	public boolean postOperation(Object objectAffectedByOperation) {
161 160
		setDirty(true);
162 161
		refresh();
163 162

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/PolytomousKeyListEditorE4.java
42 42
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
43 43
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
44 44
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
45
import eu.etaxonomy.cdm.model.common.CdmBase;
46 45
import eu.etaxonomy.cdm.model.description.PolytomousKey;
47 46
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
48 47
import eu.etaxonomy.cdm.model.taxon.Taxon;
......
314 313
    }
315 314

  
316 315
	@Override
317
	public boolean postOperation(CdmBase objectAffectedByOperation) {
316
	public boolean postOperation(Object objectAffectedByOperation) {
318 317
		viewer.refresh();
319 318

  
320 319
		if (objectAffectedByOperation != null) {
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonNameEditorE4.java
313 313
	}
314 314

  
315 315
	@Override
316
    public boolean postOperation(CdmBase objectAffectedByOperation) {
316
    public boolean postOperation(Object objectAffectedByOperation) {
317 317

  
318 318
		changed(objectAffectedByOperation);
319 319

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupE4.java
24 24
import org.eclipse.ui.forms.widgets.TableWrapData;
25 25
import org.eclipse.ui.forms.widgets.TableWrapLayout;
26 26

  
27
import eu.etaxonomy.cdm.model.common.CdmBase;
28 27
import eu.etaxonomy.taxeditor.editor.CdmDataTransfer;
29 28
import eu.etaxonomy.taxeditor.editor.name.e4.IDropTargetableE4;
30 29
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
......
150 149

  
151 150
	/** {@inheritDoc} */
152 151
	@Override
153
    public boolean postOperation(CdmBase objectAffectedByOperation) {
152
    public boolean postOperation(Object objectAffectedByOperation) {
154 153
		editor.changed(objectAffectedByOperation);
155 154
		redraw();
156 155
		return true;
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandlerE4.java
26 26
import org.eclipse.jface.viewers.IStructuredSelection;
27 27
import org.eclipse.swt.widgets.Shell;
28 28

  
29
import eu.etaxonomy.cdm.model.common.CdmBase;
30 29
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
31 30
import eu.etaxonomy.cdm.model.name.TaxonName;
32 31
import eu.etaxonomy.cdm.model.taxon.Synonym;
......
108 107

  
109 108
	/** {@inheritDoc} */
110 109
	@Override
111
    public boolean postOperation(CdmBase objectAffectedByOperation) {
110
    public boolean postOperation(Object objectAffectedByOperation) {
112 111

  
113 112
		// Redraw existing editor
114 113
		((IPostOperationEnabled) editor).postOperation(null);
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteTaxonBaseHandlerE4.java
25 25
import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;
26 26
import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
27 27
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
28
import eu.etaxonomy.cdm.model.common.CdmBase;
29 28
import eu.etaxonomy.cdm.model.taxon.Synonym;
30 29
import eu.etaxonomy.cdm.model.taxon.Taxon;
31 30
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
......
167 166
    }
168 167

  
169 168
	@Override
170
	public boolean postOperation(CdmBase objectAffectedByOperation) {
169
	public boolean postOperation(Object objectAffectedByOperation) {
171 170
	    editor.redraw();
172 171
		return true;
173 172
	}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/MoveSynonymToAnotherAcceptedTaxonHandlerE4.java
20 20
import org.eclipse.jface.viewers.IStructuredSelection;
21 21
import org.eclipse.swt.widgets.Shell;
22 22

  
23
import eu.etaxonomy.cdm.model.common.CdmBase;
24 23
import eu.etaxonomy.cdm.model.taxon.Synonym;
25 24
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
26 25
import eu.etaxonomy.taxeditor.editor.EditorUtil;
......
108 107
    }
109 108

  
110 109
	@Override
111
	public boolean postOperation(CdmBase objectAffectedByOperation) {
110
	public boolean postOperation(Object objectAffectedByOperation) {
112 111
	    editor.redraw();
113 112
		return false;
114 113
	}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SwapSynonymAndAcceptedHandlerE4.java
24 24
import org.eclipse.swt.widgets.Display;
25 25
import org.eclipse.swt.widgets.Shell;
26 26

  
27
import eu.etaxonomy.cdm.model.common.CdmBase;
28 27
import eu.etaxonomy.cdm.model.taxon.Synonym;
29 28
import eu.etaxonomy.cdm.model.taxon.Taxon;
30 29
import eu.etaxonomy.taxeditor.editor.EditorUtil;
......
92 91
    }
93 92

  
94 93
    @Override
95
    public boolean postOperation(CdmBase objectAffectedByOperation) {
94
    public boolean postOperation(Object objectAffectedByOperation) {
96 95
        // Redraw existing editor
97 96
        // ((IPostOperationEnabled) editor).postOperation(null);
98 97

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
49 49
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
50 50
import eu.etaxonomy.cdm.api.service.ITaxonService;
51 51
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
52
import eu.etaxonomy.cdm.model.common.CdmBase;
53 52
import eu.etaxonomy.cdm.model.molecular.SingleRead;
54 53
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
55 54
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
......
466 465
    }
467 466

  
468 467
    @Override
469
    public boolean postOperation(CdmBase objectAffectedByOperation) {
468
    public boolean postOperation(Object objectAffectedByOperation) {
470 469
        refreshTree();
471 470
        if(objectAffectedByOperation!=null){
472 471
            changed(objectAffectedByOperation);
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java
37 37

  
38 38
import eu.etaxonomy.cdm.api.service.IDescriptionService;
39 39
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
40
import eu.etaxonomy.cdm.model.common.CdmBase;
41 40
import eu.etaxonomy.cdm.model.description.DescriptionBase;
42 41
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
43 42
import eu.etaxonomy.cdm.model.description.TaxonDescription;
......
187 186

  
188 187
    /** {@inheritDoc} */
189 188
    @Override
190
    public boolean postOperation(CdmBase objectAffectedByOperation) {
189
    public boolean postOperation(Object objectAffectedByOperation) {
191 190

  
192 191
        editor.getConversationHolder().bind();
193 192
        editor.getConversationHolder().commit(true);
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java
28 28
import org.eclipse.swt.widgets.Display;
29 29
import org.eclipse.swt.widgets.Shell;
30 30

  
31
import eu.etaxonomy.cdm.model.common.CdmBase;
32 31
import eu.etaxonomy.cdm.model.description.DescriptionBase;
33 32
import eu.etaxonomy.cdm.model.description.TaxonDescription;
34 33
import eu.etaxonomy.cdm.model.taxon.Classification;
......
154 153

  
155 154
    /** {@inheritDoc} */
156 155
    @Override
157
    public boolean postOperation(CdmBase objectAffectedByOperation) {
156
    public boolean postOperation(Object objectAffectedByOperation) {
158 157
        Display.getDefault().asyncExec(new Runnable(){
159 158

  
160 159
            @Override
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/e4/UsesViewPartE4.java
20 20
import org.eclipse.swt.widgets.Composite;
21 21
import org.eclipse.swt.widgets.Tree;
22 22

  
23
import eu.etaxonomy.cdm.model.common.CdmBase;
24 23
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
25 24
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDragListener;
26 25
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDropAdapter;
......
80 79

  
81 80
    /** {@inheritDoc} */
82 81
    @Override
83
    public boolean postOperation(CdmBase objectAffectedByOperation) {
82
    public boolean postOperation(Object objectAffectedByOperation) {
84 83
        viewer.refresh();
85 84
        return super.postOperation(objectAffectedByOperation);
86 85
    }
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/PolytomousKeyViewPartE4.java
47 47
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
48 48
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
49 49
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
50
import eu.etaxonomy.cdm.model.common.CdmBase;
51 50
import eu.etaxonomy.cdm.model.description.PolytomousKey;
52 51
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
53 52
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
......
262 261
    }
263 262

  
264 263
    @Override
265
    public boolean postOperation(CdmBase objectAffectedByOperation) {
264
    public boolean postOperation(Object objectAffectedByOperation) {
266 265
        getConversationHolder().bind();
267 266
        getConversationHolder().commit(true);
268 267
        viewer.refresh();
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorE4.java
499 499

  
500 500
	/** {@inheritDoc} */
501 501
	@Override
502
	public boolean postOperation(CdmBase objectAffectedByOperation) {
502
	public boolean postOperation(Object objectAffectedByOperation) {
503 503
	    viewer.refresh();
504 504
		return true;
505 505
	}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java
40 40
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
41 41
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
42 42
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
43
import eu.etaxonomy.cdm.model.common.CdmBase;
44 43
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
45 44
import eu.etaxonomy.cdm.model.common.TermVocabulary;
46 45
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
......
138 137
	    menuService.registerContextMenu(viewer.getControl(), "eu.etaxonomy.taxeditor.store.popupmenu.termeditor");
139 138

  
140 139
	}
141
	
140

  
142 141
    public void addOperation(AbstractPostOperation operation){
143 142
        operations.add(operation);
144 143
    }
145
    
144

  
146 145
	@Override
147
	public boolean postOperation(CdmBase objectAffectedByOperation) {
148
	    if(objectAffectedByOperation!=null && objectAffectedByOperation.isInstanceOf(DefinedTermBase.class)){
146
	public boolean postOperation(Object objectAffectedByOperation) {
147
	    if(objectAffectedByOperation!=null && objectAffectedByOperation instanceof DefinedTermBase){
149 148
	        TermVocabulary vocabulary = HibernateProxyHelper.deproxy(objectAffectedByOperation, DefinedTermBase.class).getVocabulary();
150 149
	        viewer.refresh(vocabulary);
151 150
	    }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java
42 42
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
43 43
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
44 44
import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
45
import eu.etaxonomy.cdm.model.common.CdmBase;
46 45
import eu.etaxonomy.cdm.model.description.FeatureNode;
47 46
import eu.etaxonomy.cdm.model.description.FeatureTree;
48 47
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
......
311 310
     * {@inheritDoc}
312 311
     */
313 312
    @Override
314
    public boolean postOperation(CdmBase objectAffectedByOperation) {
313
    public boolean postOperation(Object objectAffectedByOperation) {
315 314
        return false;
316 315
    }
317 316

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IPostOperationEnabled.java
1 1
/**
2 2
 * Copyright (C) 2007 EDIT
3
 * European Distributed Institute of Taxonomy 
3
 * European Distributed Institute of Taxonomy
4 4
 * http://www.e-taxonomy.eu
5
 * 
5
 *
6 6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
 * See LICENSE.TXT at the top of this package for the full license terms.
8 8
 */
......
11 11

  
12 12
import org.eclipse.core.runtime.Status;
13 13

  
14
import eu.etaxonomy.cdm.model.common.CdmBase;
15

  
16 14
/**
17 15
 * Implementors may register to operations. The postOperation method will get
18 16
 * called after any post operation
19
 * 
17
 *
20 18
 * @author n.hoffmann
21 19
 * @created 24.03.2009
22 20
 * @version 1.0
......
29 27
	 * created a new object and the {@link IPostOperationEnabled} has to know
30 28
	 * about the object it should be passed to the {@link IPostOperationEnabled}
31 29
	 * </p>
32
	 * 
30
	 *
33 31
	 * @param objectAffectedByOperation
34 32
	 *            a newly created object for example. May be <code>null</code>
35 33
	 * @return true if the method executed successfully. Returning false will
36 34
	 *         set the operations status to {@link Status.CANCEL_STATUS} which
37 35
	 *         might not be what you want.
38 36
	 */
39
	public boolean postOperation(CdmBase objectAffectedByOperation);
40
	
37
	public boolean postOperation(Object objectAffectedByOperation);
38

  
41 39
	/**
42 40
	 * This method will get called after the execution took place and occasional
43 41
	 * cleanups were performed. This is typically the last thing to happen.
44
	 * 
42
	 *
45 43
	 * @return a boolean.
46 44
	 */
47 45
	public boolean onComplete();
48
	
46

  
49 47
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java
33 33
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
34 34
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
35 35
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
36
import eu.etaxonomy.cdm.model.common.CdmBase;
37 36
import eu.etaxonomy.cdm.model.description.Distribution;
38 37
import eu.etaxonomy.cdm.model.taxon.Taxon;
39 38
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
......
303 302
     * {@inheritDoc}
304 303
     */
305 304
    @Override
306
    public boolean postOperation(CdmBase objectAffectedByOperation) {
305
    public boolean postOperation(Object objectAffectedByOperation) {
307 306
        changed(objectAffectedByOperation);
308 307
        return true;
309 308
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)