91d83be589e0e01844473a549712e65d4eb0187f
1 /*******************************************************************************
2 * Copyright (c) 2011, 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 * Francois Chouinard - Initial API and implementation
11 * Patrick Tasse - Remove enable check
12 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.internal
.tmf
.ui
.project
.handlers
;
16 import org
.eclipse
.core
.commands
.AbstractHandler
;
17 import org
.eclipse
.core
.commands
.ExecutionEvent
;
18 import org
.eclipse
.core
.commands
.ExecutionException
;
19 import org
.eclipse
.jface
.viewers
.ISelection
;
20 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
21 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfTraceElement
;
22 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.wizards
.CopyTraceDialog
;
23 import org
.eclipse
.swt
.widgets
.Shell
;
24 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
27 * <b><u>CopyTraceHandler</u></b>
30 public class CopyTraceHandler
extends AbstractHandler
{
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
37 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
39 // Get selection already validated by handler in plugin.xml
40 ISelection selection
= HandlerUtil
.getCurrentSelectionChecked(event
);
41 if (!(selection
instanceof IStructuredSelection
)) {
44 TmfTraceElement trace
= (TmfTraceElement
) ((IStructuredSelection
) selection
).getFirstElement();
46 // Fire the Copy Trace dialog
47 Shell shell
= HandlerUtil
.getActiveShellChecked(event
);
48 CopyTraceDialog dialog
= new CopyTraceDialog(shell
, trace
);
This page took 0.032403 seconds and 4 git commands to generate.