Project

General

Profile

« Previous | Next » 

Revision 9af003a7

Added by Patrick Plitzner over 6 years ago

ref #6622, #6598 Migrate New and connect menus

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/create/NewPersonHandler.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
*/
9 9

  
10 10
package eu.etaxonomy.taxeditor.editor.handler.create;
11 11

  
12
import org.apache.log4j.Logger;
13
import org.eclipse.core.commands.AbstractHandler;
14
import org.eclipse.core.commands.ExecutionEvent;
15
import org.eclipse.core.commands.ExecutionException;
16
import org.eclipse.core.commands.IHandler;
12
import javax.inject.Named;
13

  
14
import org.eclipse.e4.core.di.annotations.Execute;
15
import org.eclipse.e4.ui.services.IServiceConstants;
17 16
import org.eclipse.jface.wizard.WizardDialog;
18
import org.eclipse.ui.handlers.HandlerUtil;
17
import org.eclipse.swt.widgets.Shell;
19 18

  
20 19
import eu.etaxonomy.taxeditor.newWizard.NewPersonWizard;
21 20

  
22 21
/**
23
 * <p>NewPersonHandler class.</p>
24 22
 *
25
 * @author n.hoffmann
26
 * @created Jun 1, 2010
27
 * @version 1.0
23
 * @author pplitzner
24
 * @date 10.10.2017
25
 *
28 26
 */
29
public class NewPersonHandler extends AbstractHandler implements IHandler {
30
	private static final Logger logger = Logger
31
			.getLogger(NewPersonHandler.class);
27
public class NewPersonHandler {
32 28

  
33
	/* (non-Javadoc)
34
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
35
	 */
36
	/** {@inheritDoc} */
37
	public Object execute(ExecutionEvent event) throws ExecutionException {
29
    @Execute
30
    public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
38 31
		NewPersonWizard wizard = new NewPersonWizard();
39 32
		wizard.init(null, null);
40
		WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), wizard);
33
		WizardDialog dialog = new WizardDialog(shell, wizard);
41 34
		dialog.open();
42
		
43
		return null;
44 35
	}
45 36
}

Also available in: Unified diff