Project

General

Profile

« Previous | Next » 

Revision b5b429af

Added by Patrick Plitzner over 6 years ago

ref #6925 Inject context into operations to allow sync/async execution

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RefreshNodeNumberingHandler.java
5 5
import org.eclipse.core.commands.ExecutionException;
6 6
import org.eclipse.core.commands.common.NotDefinedException;
7 7
import org.eclipse.core.commands.operations.IUndoContext;
8
import org.eclipse.jface.dialogs.MessageDialog;
9 8
import org.eclipse.jface.viewers.IStructuredSelection;
10 9
import org.eclipse.ui.IEditorPart;
11 10
import org.eclipse.ui.handlers.HandlerUtil;
......
15 14
import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
16 15
import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
17 16
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
18
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.CreateNodeOperation;
19 17
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.RefreshNodeNumberingOperation;
20 18
import eu.etaxonomy.taxeditor.model.MessagingUtils;
21 19
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
......
31 29
					.getActiveEditor();
32 30

  
33 31
			if (editorPage instanceof PolytomousKeyListEditor) {
34
								
32

  
35 33
				IStructuredSelection selection = (IStructuredSelection) HandlerUtil
36 34
						.getCurrentSelection(event);
37 35

  
......
45 43

  
46 44
						AbstractPostOperation operation = new RefreshNodeNumberingOperation(
47 45
								label, undoContext, keyNode, editorPage);
48
						EditorUtil.executeOperation(operation);
49 46
					} catch (NotDefinedException e) {
50 47
						MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$
51 48
					}
52
				} 
49
				}
53 50
			}
54
		}	    
51
		}
55 52

  
56 53
		return null;
57 54
	}

Also available in: Unified diff