1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Marc-Andre Laperle - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.tmf
.ui
.project
.wizards
.tracepkg
.importexport
;
15 import org
.eclipse
.core
.commands
.AbstractHandler
;
16 import org
.eclipse
.core
.commands
.ExecutionEvent
;
17 import org
.eclipse
.core
.commands
.ExecutionException
;
18 import org
.eclipse
.jface
.viewers
.ISelection
;
19 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
20 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
21 import org
.eclipse
.jface
.wizard
.WizardDialog
;
22 import org
.eclipse
.ui
.IWorkbenchWindow
;
23 import org
.eclipse
.ui
.PlatformUI
;
24 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
27 * Handler for importing a trace package
29 * @author Marc-Andre Laperle
31 public class ImportTracePackageHandler
extends AbstractHandler
{
34 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
35 ImportTracePackageWizard w
= new ImportTracePackageWizard();
36 IWorkbenchWindow window
= PlatformUI
.getWorkbench().getActiveWorkbenchWindow();
42 ISelection currentSelection
= HandlerUtil
.getCurrentSelection(event
);
43 IStructuredSelection sec
= StructuredSelection
.EMPTY
;
44 if (currentSelection
instanceof IStructuredSelection
) {
45 sec
= (IStructuredSelection
) currentSelection
;
48 w
.init(PlatformUI
.getWorkbench(), sec
);
49 WizardDialog dialog
= new WizardDialog(window
.getShell(), w
);