1 /*******************************************************************************
2 * Copyright (c) 2009 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 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.project
.actions
;
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
;
27 * <b><u>DeleteTraceActionDelegate</u></b>
29 * TODO: Implement me. Please.
31 public class DeleteTraceActionDelegate
implements IWorkbenchWindowActionDelegate
{
33 public static final String ID
= "org.eclipse.linuxtools.lttng.ui.view.project.menu.deleteTrace";
35 @SuppressWarnings("unused")
36 private IWorkbenchWindow fWindow
;
37 private IStructuredSelection fSelection
;
38 private LTTngTraceEntry fEntry
;
43 public DeleteTraceActionDelegate() {
44 // TODO Auto-generated constructor stub
48 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
50 public void dispose() {
51 // TODO Auto-generated method stub
55 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
57 public void init(IWorkbenchWindow window
) {
62 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
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);
75 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
77 public void selectionChanged(IAction action
, ISelection selection
) {
78 if (selection
instanceof IStructuredSelection
) {
79 fSelection
= (IStructuredSelection
) selection
;
81 Object sel
= fSelection
.getFirstElement();
82 if (sel
instanceof LTTngTraceEntry
) {
83 fEntry
= (LTTngTraceEntry
) sel
;