refactored folder structure
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / datasource / handler / EditDataSourceHandler.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.taxeditor.datasource.handler;
12
13 import org.eclipse.core.commands.ExecutionEvent;
14 import org.eclipse.jface.viewers.ISelection;
15 import org.eclipse.jface.viewers.StructuredSelection;
16 import org.eclipse.jface.wizard.WizardDialog;
17 import org.eclipse.ui.handlers.HandlerUtil;
18
19 import eu.etaxonomy.cdm.database.ICdmDataSource;
20 import eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceWizard;
21
22 /**
23 * @author n.hoffmann
24 * @created 15.04.2009
25 * @version 1.0
26 */
27 public class EditDataSourceHandler extends AbstractDataSourceHandler {
28
29 /* (non-Javadoc)
30 * @see eu.etaxonomy.taxeditor.store.datasource.handler.AbstractDataSourceHandler#specificExecute(org.eclipse.core.commands.ExecutionEvent)
31 */
32 @Override
33 public Object specificExecute(ExecutionEvent event) {
34 ISelection menuSelection = HandlerUtil.getActiveMenuSelection(event);
35 ICdmDataSource dataSource = (ICdmDataSource) ((StructuredSelection) menuSelection).getFirstElement();
36
37 CdmDataSourceWizard wizard = new CdmDataSourceWizard(dataSource);
38 WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), wizard);
39 dialog.open();
40
41 return null;
42 }
43 }