02f6d6b27977a7065fb676982edf377870ee4f6c
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / project / actions / DeleteTraceActionDelegate.java
1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.lttng.ui.views.project.actions;
14
15 import org.eclipse.jface.action.IAction;
16 import org.eclipse.jface.dialogs.MessageDialog;
17 import org.eclipse.jface.viewers.ISelection;
18 import org.eclipse.jface.viewers.IStructuredSelection;
19 import org.eclipse.linuxtools.lttng.ui.views.project.model.LTTngTraceEntry;
20 import org.eclipse.swt.widgets.Shell;
21 import org.eclipse.ui.IWorkbench;
22 import org.eclipse.ui.IWorkbenchWindow;
23 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
24 import org.eclipse.ui.PlatformUI;
25
26 /**
27 * <b><u>DeleteTraceActionDelegate</u></b>
28 * <p>
29 * TODO: Implement me. Please.
30 */
31 public class DeleteTraceActionDelegate implements IWorkbenchWindowActionDelegate {
32
33 public static final String ID = "org.eclipse.linuxtools.lttng.ui.view.project.menu.deleteTrace";
34
35 @SuppressWarnings("unused")
36 private IWorkbenchWindow fWindow;
37 private IStructuredSelection fSelection;
38 private LTTngTraceEntry fEntry;
39
40 /**
41 *
42 */
43 public DeleteTraceActionDelegate() {
44 // TODO Auto-generated constructor stub
45 }
46
47 /* (non-Javadoc)
48 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
49 */
50 public void dispose() {
51 // TODO Auto-generated method stub
52 }
53
54 /* (non-Javadoc)
55 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
56 */
57 public void init(IWorkbenchWindow window) {
58 fWindow = window;
59 }
60
61 /* (non-Javadoc)
62 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
63 */
64 public void run(IAction action) {
65 IWorkbench workbench = PlatformUI.getWorkbench();
66 Shell shell = workbench.getActiveWorkbenchWindow().getShell();
67 MessageDialog dialog = new MessageDialog(shell, "Delete Trace", null,
68 "Sorry, this feature is not implemented yet.\n\n" +
69 "In the mean time, you can use the standard Eclipse Navigator View.",
70 MessageDialog.INFORMATION, new String[] { "OK" }, 0);
71 dialog.open();
72 }
73
74 /* (non-Javadoc)
75 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
76 */
77 public void selectionChanged(IAction action, ISelection selection) {
78 if (selection instanceof IStructuredSelection) {
79 fSelection = (IStructuredSelection) selection;
80 fEntry = null;
81 Object sel = fSelection.getFirstElement();
82 if (sel instanceof LTTngTraceEntry) {
83 fEntry = (LTTngTraceEntry) sel;
84 }
85 }
86 }
87
88 }
This page took 0.03316 seconds and 4 git commands to generate.