Project

General

Profile

Revision 123796a3

ID123796a3cbdc4851fbbb55d5f4dfe5a9a477096c
Parent 2c44794f
Child 899a348b

Added by Katja Luther 9 months ago

ref #7428: move updateViews into AbstractUtility

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java
300 300
        return null;
301 301
    }
302 302

  
303
    /**
304
     * {@inheritDoc}
305
     */
306
    @Override
307
    public void update() {
308
        input.performSearch(lastQuery, getSelection());
309

  
310
    }
311

  
303 312
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
38 38
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
39 39
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
40 40
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
41
import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditorE4;
42
import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
41 43
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.DescriptiveDataSetEditor;
42 44
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
43 45
import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
......
235 237
        return dirtyParts;
236 238
    }
237 239

  
240
    public static Collection<MPart> checkForTaxonChanges(UUID taxonUUID, EPartService partService ){
241
        Collection<MPart> parts = partService.getParts();
242
        Collection<MPart> dirtyParts = new HashSet();
243
        //check if part is already opened
244
        boolean isDirty = false;
245
        for (MPart part : parts) {
246
            if(part.getObject() instanceof TaxonNameEditorE4
247
                    && ((TaxonNameEditorE4) part.getObject()).getTaxon()!=null
248
                    && ((TaxonNameEditorE4) part.getObject()).getTaxon().getUuid().equals(taxonUUID)){
249
                if (part.isDirty()){
250
                    dirtyParts.add(part);
251
                }
252

  
253
                break;
254
            }else if (taxonUUID == null){
255
                if (part.isDirty() && (part.getObject() instanceof TaxonNameEditorE4 || (part.getObject() instanceof BulkEditorE4 && ((BulkEditorE4)part.getObject()).getEditorInput() instanceof TaxonEditorInput))){
256
                    dirtyParts.add(part);
257
                }
258
            }
259
        }
260
        return dirtyParts;
261
    }
262

  
238 263
	/**
239 264
	 * An uninitialized taxon is one that hasn't been saved yet. As such, it
240 265
	 * should appear in neither the list of recent names nor in the taxonomic
......
419 444

  
420 445
        }
421 446
    }
447

  
422 448
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonNameEditorE4.java
31 31
import org.eclipse.e4.ui.di.Persist;
32 32
import org.eclipse.e4.ui.di.UIEventTopic;
33 33
import org.eclipse.e4.ui.di.UISynchronize;
34
import org.eclipse.e4.ui.model.application.MApplication;
34 35
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
35 36
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
36 37
import org.eclipse.e4.ui.services.EMenuService;
38
import org.eclipse.e4.ui.workbench.modeling.EModelService;
39
import org.eclipse.e4.ui.workbench.modeling.EPartService;
37 40
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
38 41
import org.eclipse.jface.dialogs.MessageDialog;
39 42
import org.eclipse.jface.viewers.ISelection;
......
69 72
import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
70 73
import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
71 74
import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
75
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
72 76
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
73 77
import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupE4;
74 78
import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainerE4;
......
139 143
    @Inject
140 144
    private MDirtyable dirty;
141 145

  
146
    @Inject
147
    private MApplication application;
148

  
142 149
    private MPart thisPart;
143 150

  
144 151
    private TaxonEditorInputE4 input;
......
778 785

  
779 786
    }
780 787

  
788
    /**
789
     * {@inheritDoc}
790
     */
791
    @Override
792
    public void update() {
793
        EPartService partService = TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getService(EPartService.class);
794
        EModelService modelService = TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getService(EModelService.class);
795
        EditorUtil.openTaxonBaseE4(this.getTaxon().getUuid(), modelService, partService, application);
796

  
797
    }
798

  
781 799
}
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/Messages.java
182 182
    public static String TaxonNavigatorLabels_SET_PUBLISH_FOR_CHILDREN;
183 183
	public static String TaxonNavigatorLabels_ACCEPTED_TAXA_NEED_TO_BE_FROM_SAME_CLASSIFICATION;
184 184
    public static String TaxonNavigatorLabels_SET_UNPLACED;
185
    public static String NO;
186
    public static String YES;
185 187

  
188
    public static String SetPublishFlagForSubtreeHandlerE4_UnsavedChanges;
189
    public static String SetPublishFlagForSubtreeHandlerE4_UnsavedChangesQuestion;
186 190
    static {
187 191
        // initialize resource bundle
188 192
        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages.properties
158 158
SetPublishForSubtreeOperation_CHANGE_PUBLISH_OP=Change publish flag for all children
159 159
TaxonNavigatorLabels_SET_PUBLISH_FOR_CHILDREN=Change publish flag for all children
160 160
TaxonNavigatorLabels_SET_UNPLACED=Set unplaced flag for taxonnode(s)
161
NO=No
162
YES=Yes
163
SetPublishFlagForSubtreeHandlerE4_UnsavedChanges=There are unsaved changes
164
SetPublishFlagForSubtreeHandlerE4_UnsavedChangesQuestion=There are changes, do you want to save them? \nIf you do not save, the changes may be overwritten.
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages_de.properties
159 159
SetPublishForSubtreeOperation_CHANGE_PUBLISH_OP=Publish Flag f?r alle Kinder ?ndern
160 160
TaxonNavigatorLabels_SET_PUBLISH_FOR_CHILDREN=?ndere Publish Flag f?r alle Kinder
161 161
TaxonNavigatorLabels_SET_UNPLACED=Setze unplaced Flag f?r den/die Taxonknoten
162

  
163
NO=Nein
164
YES=Ja
165

  
166
SetPublishFlagForSubtreeHandlerE4_UnsavedChanges=Es gibt ungespeicherte ?nderungen
167
SetPublishFlagForSubtreeHandlerE4_UnsavedChangesQuestion=Es gibt ?nderungen, wollen Sie diese speichern? \nWenn Sie nicht speichern, k?nnten diese ?nderungen verloren gehen.
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/SetPublishFlagForSubtreeHandlerE4.java
35 35
import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditorE4;
36 36
import eu.etaxonomy.taxeditor.editor.EditorUtil;
37 37
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
38
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
38 39
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
39 40
import eu.etaxonomy.taxeditor.navigation.navigator.operation.SetPublishForSubtreeOperation;
40 41
import eu.etaxonomy.taxeditor.operation.e4.RemotingCdmHandlerE4;
......
54 55
    public SetPublishFlagForSubtreeHandlerE4() {
55 56
        //FIXME add missing l10n property
56 57
//        super(TaxonNavigatorLabels.CHANGE_PUBLISH_FOR_SUBTREE);
57
        super("");
58
        super(""); //$NON-NLS-1$
58 59
    }
59 60

  
60 61

  
61 62
    private TaxonNodeDto taxonNode;
62 63
    private PublishForSubtreeConfigurator configurator;
63

  
64
    private static final String NO = Messages.NO;
65
    private static final String CANCEL = Messages.RemotingMoveTaxonNodeHandler_CANCEL;
66
    private static final String YES = Messages.YES;
64 67

  
65 68
    @Override
66 69
    public IStatus allowOperations(IStructuredSelection selection, Shell shell, MPart activePart,
......
86 89
                    "unknown", //$NON-NLS-1$
87 90
                    TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
88 91
        }
89
        Collection<MPart> dirtyParts = EditorUtil.checkForChanges(null, partService);
92
        Collection<MPart> dirtyParts = EditorUtil.checkForTaxonChanges(null, partService);
90 93

  
91 94
        if (dirtyParts != null && !dirtyParts.isEmpty()){
92
            boolean proceed = MessageDialog.openQuestion(null,
93
                    "There are unsaved changes", "Do you want to save the changes?");
95
            String[] buttonLables = {YES, NO,CANCEL};
96
            MessageDialog dialog = new MessageDialog(null,  Messages.SetPublishFlagForSubtreeHandlerE4_UnsavedChanges, null, Messages.SetPublishFlagForSubtreeHandlerE4_UnsavedChangesQuestion, MessageDialog.QUESTION_WITH_CANCEL, buttonLables, 0);
97
            dialog.open();
98
            int returnCode = dialog.getReturnCode();
99
            boolean proceed = false;
100
            if (returnCode == 0){
101
                proceed = true;
102
            }else if (returnCode == 2){
103
                return Status.CANCEL_STATUS;
104
            }
105

  
94 106
            Iterator<MPart> partIterator = dirtyParts.iterator();
95 107
            while( partIterator.hasNext() ){
96 108
                MPart part = partIterator.next();
97 109
                if (proceed) {
98 110
                    if (part != null){
99
                        if (part.getElementId().equals("eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4")){
111
                        if (part.getElementId().equals("eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4")){ //$NON-NLS-1$
100 112
                            TaxonNameEditorE4 targetEditor = (TaxonNameEditorE4) WorkbenchUtility.getE4WrappedPart(part);
101 113
                            targetEditor.save(new NullProgressMonitor());
102
                        }else if (part.getElementId().equals("bulkeditor.editor")){
114
                        }else if (part.getElementId().equals("bulkeditor.editor")){ //$NON-NLS-1$
103 115
                            BulkEditorE4 targetEditor = (BulkEditorE4) WorkbenchUtility.getE4WrappedPart(part);
104 116
                            targetEditor.save(new NullProgressMonitor());
105 117
                        }
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/SetSecReferenceForSubtreeHandlerE4.java
8 8
 */
9 9
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler;
10 10

  
11
import java.util.Collection;
12
import java.util.Iterator;
13

  
11 14
import javax.inject.Named;
12 15

  
13 16
import org.eclipse.core.commands.operations.AbstractOperation;
14 17
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.NullProgressMonitor;
15 19
import org.eclipse.core.runtime.Status;
16 20
import org.eclipse.e4.core.di.annotations.CanExecute;
17 21
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
18 22
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
19 23
import org.eclipse.e4.ui.services.IServiceConstants;
24
import org.eclipse.jface.dialogs.MessageDialog;
20 25
import org.eclipse.jface.viewers.IStructuredSelection;
21 26
import org.eclipse.jface.viewers.TreeSelection;
22 27
import org.eclipse.jface.window.Window;
......
26 31
import eu.etaxonomy.cdm.api.service.config.SecundumForSubtreeConfigurator;
27 32
import eu.etaxonomy.cdm.model.taxon.Classification;
28 33
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
34
import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditorE4;
35
import eu.etaxonomy.taxeditor.editor.EditorUtil;
36
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
37
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
29 38
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
30 39
import eu.etaxonomy.taxeditor.navigation.navigator.operation.SetSecundumForSubtreeOperation;
31 40
import eu.etaxonomy.taxeditor.operation.e4.RemotingCdmHandlerE4;
32 41
import eu.etaxonomy.taxeditor.ui.dialog.configurator.SetSecundumForSubtreeConfigurationWizard;
42
import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
33 43

  
34 44
/**
35 45
 * @author k.luther
......
74 84
                    "unknown", //$NON-NLS-1$
75 85
                    TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
76 86
        }
87
        Collection<MPart> dirtyParts = EditorUtil.checkForTaxonChanges(null, partService);
88

  
89
        if (dirtyParts != null && !dirtyParts.isEmpty()){
90
            String[] buttonLables = {Messages.YES, Messages.NO,Messages.TreeNodeDropAdapter_CANCEL};
91
            MessageDialog dialog = new MessageDialog(null,  Messages.SetPublishFlagForSubtreeHandlerE4_UnsavedChanges, null, Messages.SetPublishFlagForSubtreeHandlerE4_UnsavedChangesQuestion, MessageDialog.QUESTION_WITH_CANCEL, buttonLables, 0);
92
            dialog.open();
93
            int returnCode = dialog.getReturnCode();
94
            boolean proceed = false;
95
            if (returnCode == 0){
96
                proceed = true;
97
            }else if (returnCode == 2){
98
                return Status.CANCEL_STATUS;
99
            }
100

  
101
            Iterator<MPart> partIterator = dirtyParts.iterator();
102
            while( partIterator.hasNext() ){
103
                MPart part = partIterator.next();
104
                if (proceed) {
105
                    if (part != null){
106
                        if (part.getElementId().equals("eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4")){ //$NON-NLS-1$
107
                            TaxonNameEditorE4 targetEditor = (TaxonNameEditorE4) WorkbenchUtility.getE4WrappedPart(part);
108
                            targetEditor.save(new NullProgressMonitor());
109
                        }else if (part.getElementId().equals("bulkeditor.editor")){ //$NON-NLS-1$
110
                            BulkEditorE4 targetEditor = (BulkEditorE4) WorkbenchUtility.getE4WrappedPart(part);
111
                            targetEditor.save(new NullProgressMonitor());
112
                        }
113

  
114
                    }
115

  
116
                }
117
            }
118
        }
77 119

  
78 120
        configurator = new SecundumForSubtreeConfigurator(taxonNode.getUuid());
79 121
        SetSecundumForSubtreeConfigurationWizard wizard = new SetSecundumForSubtreeConfigurationWizard(configurator);
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/SetPublishForSubtreeOperation.java
12 12
import java.util.UUID;
13 13

  
14 14
import org.apache.log4j.Logger;
15
import org.eclipse.core.runtime.Assert;
16 15
import org.eclipse.core.runtime.IAdaptable;
17 16
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.core.runtime.Status;
20
import org.eclipse.core.runtime.jobs.Job;
21 17
import org.eclipse.e4.ui.model.application.MApplication;
22 18
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
23 19
import org.eclipse.e4.ui.workbench.modeling.EModelService;
24 20
import org.eclipse.e4.ui.workbench.modeling.EPartService;
25 21
import org.eclipse.swt.widgets.Display;
26 22

  
27
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
28 23
import eu.etaxonomy.cdm.api.service.UpdateResult;
29 24
import eu.etaxonomy.cdm.api.service.config.PublishForSubtreeConfigurator;
30 25
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
31
import eu.etaxonomy.taxeditor.model.AbstractUtility;
26
import eu.etaxonomy.taxeditor.editor.EditorUtil;
32 27
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
33 28
import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
34
import eu.etaxonomy.taxeditor.store.CdmStore;
35 29

  
36 30
/**
37 31
 * @author k.luther
......
80 74
    }
81 75

  
82 76

  
83
    private Job createJob(IProgressMonitor monitor){
84
        Assert.isNotNull(config, "Configuration may not be null");
85

  
86
        final Display display = Display.getDefault();
87
        taxonNodeService = CdmStore.getService(ITaxonNodeService.class);
88
        Job job = new Job(Messages.SetPublishFlagForSubtreeOperation_SET_SEC_TASK) {
89

  
90

  
91
            @Override
92
            protected IStatus run(IProgressMonitor monitor) {
93
                if (config instanceof PublishForSubtreeConfigurator){
94
                	updateResult =  taxonNodeService.setPublishForSubtree(config.getSubtreeUuid(), ((PublishForSubtreeConfigurator)config).isPublish(), config.isIncludeAcceptedTaxa(), config.isIncludeSynonyms(), config.isIncludeSharedTaxa(), null);
95
                }else {
96
                	return Status.CANCEL_STATUS;
97
                }
98
                updateNameEditors();
99
                return Status.OK_STATUS;
100

  
101
            }
102
        };
103
        return job;
104
    }
77
//    private Job createJob(IProgressMonitor monitor){
78
//        Assert.isNotNull(config, "Configuration may not be null");
79
//
80
//        final Display display = Display.getDefault();
81
//        taxonNodeService = CdmStore.getService(ITaxonNodeService.class);
82
//        Job job = new Job(Messages.SetPublishFlagForSubtreeOperation_SET_SEC_TASK) {
83
//
84
//
85
//            @Override
86
//            protected IStatus run(IProgressMonitor monitor) {
87
//                if (config instanceof PublishForSubtreeConfigurator){
88
//                	updateResult =  taxonNodeService.setPublishForSubtree(config.getSubtreeUuid(), ((PublishForSubtreeConfigurator)config).isPublish(), config.isIncludeAcceptedTaxa(), config.isIncludeSynonyms(), config.isIncludeSharedTaxa(), null);
89
//                }else {
90
//                	return Status.CANCEL_STATUS;
91
//                }
92
//                updateNameEditors();
93
//                return Status.OK_STATUS;
94
//
95
//            }
96
//        };
97
//        return job;
98
//    }
105 99

  
106 100
    public void runMoniteredOperation() {
107 101

  
......
109 103
        Display.getDefault().asyncExec(new Runnable() {
110 104
            @Override
111 105
            public void run() {
112
                AbstractUtility.executeMoniteredOperation("Set Publish Flag for Subtree: ",
106
                EditorUtil.executeMoniteredOperation("Set Publish Flag for Subtree: ",
113 107
                        uuid,
114 108
                        1000,
115 109
                        false,
116 110
                        SetPublishForSubtreeOperation.this,
117 111
                        null,
118 112
                        true);
119
            updateNameEditors();
113
            //updateNameEditors();
120 114
            }
121 115

  
122 116
        });
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/SetSecundumForSubtreeOperation.java
13 13
import javax.inject.Inject;
14 14

  
15 15
import org.apache.log4j.Logger;
16
import org.eclipse.core.runtime.Assert;
17 16
import org.eclipse.core.runtime.IAdaptable;
18 17
import org.eclipse.core.runtime.IProgressMonitor;
19
import org.eclipse.core.runtime.IStatus;
20
import org.eclipse.core.runtime.Status;
21
import org.eclipse.core.runtime.jobs.Job;
22 18
import org.eclipse.e4.ui.di.UISynchronize;
23 19
import org.eclipse.e4.ui.model.application.MApplication;
24 20
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
......
31 27
import eu.etaxonomy.cdm.api.service.config.SecundumForSubtreeConfigurator;
32 28
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
33 29
import eu.etaxonomy.taxeditor.editor.EditorUtil;
34
import eu.etaxonomy.taxeditor.model.AbstractUtility;
35 30
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
36 31
import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
37 32

  
......
79 74
    }
80 75

  
81 76

  
82
    private Job createJob(IProgressMonitor monitor){
83
        Assert.isNotNull(config, "Configuration may not be null");
84

  
85
        final Display display = Display.getDefault();
86

  
87
        Job job = new Job(Messages.SetSecundumForSubtreeOperation_SET_SEC_TASK) {
88
            @Override
89
            protected IStatus run(IProgressMonitor monitor) {
90
            	if (config instanceof SecundumForSubtreeConfigurator){
91
					updateResult = taxonNodeService.setSecundumForSubtree((SecundumForSubtreeConfigurator)config);
92
				}else{
93
					return Status.CANCEL_STATUS;
94
				}
95

  
96
				return Status.OK_STATUS;
97

  
98
            }
99
        };
100
        return job;
101
    }
77
//    private Job createJob(IProgressMonitor monitor){
78
//        Assert.isNotNull(config, "Configuration may not be null");
79
//
80
//        final Display display = Display.getDefault();
81
//
82
//        Job job = new Job(Messages.SetSecundumForSubtreeOperation_SET_SEC_TASK) {
83
//            @Override
84
//            protected IStatus run(IProgressMonitor monitor) {
85
//            	if (config instanceof SecundumForSubtreeConfigurator){
86
//					updateResult = taxonNodeService.setSecundumForSubtree((SecundumForSubtreeConfigurator)config);
87
//				}else{
88
//					return Status.CANCEL_STATUS;
89
//				}
90
//
91
//				return Status.OK_STATUS;
92
//
93
//            }
94
//        };
95
//        return job;
96
//    }
102 97

  
103 98

  
104 99
    public void runMoniteredOperation() {
......
107 102
        Display.getDefault().asyncExec(new Runnable() {
108 103
            @Override
109 104
            public void run() {
110
                AbstractUtility.executeMoniteredOperation("Set Secundum Reference for Subtree: ",
105
                EditorUtil.executeMoniteredOperation("Set Secundum Reference for Subtree: ",
111 106
                        uuid,
112 107
                        1000,
113 108
                        false,
114 109
                        SetSecundumForSubtreeOperation.this,
115 110
                        null,
116 111
                        true);
117
                updateNameEditors();
112
               // updateNameEditors();
118 113
            }
119 114
        });
120 115

  
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/UpdateSubtreeOperation.java
22 22
import eu.etaxonomy.cdm.model.taxon.Taxon;
23 23
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
24 24
import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditorE4;
25
import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
25 26
import eu.etaxonomy.taxeditor.editor.EditorUtil;
26 27
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
27 28
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
......
57 58
	        subtreeNode = CdmStore.getService(ITaxonNodeService.class).load(config.getSubtreeUuid());
58 59
	    }
59 60
	  public void updateNameEditors(){
60
	      List<TaxonNode> nodesToUpdate = new ArrayList();
61
	      List<Taxon> taxaToUpdate = new ArrayList();
61 62
	      for (CdmBase object: updateResult.getUpdatedObjects()){
62 63
              Taxon taxon = null;
63 64
              TaxonNode node = null;
......
70 71
                  taxon = syn.getAcceptedTaxon();
71 72
                  node = taxon.getTaxonNode(subtreeNode.getClassification());
72 73
              }
73
              nodesToUpdate.add(node);
74
              taxaToUpdate.add(taxon);
74 75
	      }
75 76

  
76 77
	      Display.getDefault().asyncExec(new Runnable() {
......
84 85
    					    setFocus = true;
85 86
    					}
86 87
    					if (object instanceof TaxonNameEditorE4){
87
    					    if (object != null){
88
    					        EditorUtil.openTaxonBaseE4(((TaxonNameEditorE4)object).getTaxon().getUuid(), modelService, partService, application);
88
    					    if (object != null ){
89
    					        if (taxaToUpdate.contains(((TaxonNameEditorE4)object).getTaxon())){
90
                                    EditorUtil.openTaxonBaseE4(((TaxonNameEditorE4)object).getTaxon().getUuid(), modelService, partService, application);
91
                                }
89 92
    					    }
90 93
    					}
91
    					if (object instanceof BulkEditorE4){
94
    					if (object instanceof BulkEditorE4 && ((BulkEditorE4)object).getEditorInput() instanceof TaxonEditorInput){
92 95
    					    ((BulkEditorE4)object).getEditorInput().performSearch( ((BulkEditorE4)object).getLastQuery(), ((BulkEditorE4)object).getSelection());
93 96
    					}
94 97
    		    	}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ITaxonEditor.java
5 5

  
6 6
public interface ITaxonEditor {
7 7
	/**
8
	 * 
8
	 *
9 9
	 * @return the @Taxon of the editor
10
	 * 
10
	 *
11 11
	 */
12 12
	public abstract Taxon getTaxon();
13

  
14
	public abstract void update();
13 15
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)