2010-10-26 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug309042
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / project / handlers / RenameProjectHandler.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 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.handlers;
14
15 import org.eclipse.core.commands.ExecutionEvent;
16 import org.eclipse.core.commands.ExecutionException;
17 import org.eclipse.core.commands.IHandler;
18 import org.eclipse.core.commands.IHandlerListener;
19 import org.eclipse.linuxtools.lttng.ui.views.project.model.LTTngProjectNode;
20 import org.eclipse.swt.widgets.MessageBox;
21 import org.eclipse.ui.PlatformUI;
22
23 /**
24 * <b><u>RenameProjectHandler</u></b>
25 * <p>
26 * TODO: Implement me. Please.
27 */
28 public class RenameProjectHandler implements IHandler {
29
30 private LTTngProjectNode fProject = null;
31
32 // ------------------------------------------------------------------------
33 // Validation
34 // ------------------------------------------------------------------------
35
36 @Override
37 public boolean isEnabled() {
38
39 // // Check if we are closing down
40 // IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
41 // if (window == null)
42 // return false;
43 //
44 // // Check if we are in the Project View
45 // IWorkbenchPage page = window.getActivePage();
46 // if (!(page.getActivePart() instanceof ProjectView))
47 // return false;
48 //
49 // // Check if a project is selected
50 // ISelection selection = page.getSelection(ProjectView.ID);
51 // if (selection instanceof StructuredSelection) {
52 // Object element = ((StructuredSelection) selection).getFirstElement();
53 // fProjectNode = (element instanceof LTTngProjectNode) ? (LTTngProjectNode) element : null;
54 // }
55
56 return (fProject != null);
57 }
58
59 // Handled if we are in the ProjectView
60 @Override
61 public boolean isHandled() {
62 return false;
63 }
64
65 // ------------------------------------------------------------------------
66 // Execution
67 // ------------------------------------------------------------------------
68
69 @Override
70 public Object execute(ExecutionEvent event) throws ExecutionException {
71
72 MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
73 mb.setText("Rename Project");
74 mb.setMessage("Not implemented yet");
75 mb.open();
76
77 return null;
78 }
79
80 @Override
81 public void dispose() {
82 // TODO Auto-generated method stub
83 }
84
85 // ------------------------------------------------------------------------
86 // IHandlerListener
87 // ------------------------------------------------------------------------
88
89 @Override
90 public void addHandlerListener(IHandlerListener handlerListener) {
91 // TODO Auto-generated method stub
92 }
93
94 @Override
95 public void removeHandlerListener(IHandlerListener handlerListener) {
96 // TODO Auto-generated method stub
97 }
98
99 }
This page took 0.032381 seconds and 5 git commands to generate.