2010-10-26 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug309042
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / project / handlers / RenameProjectHandler.java
CommitLineData
abfad0aa
FC
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
13package org.eclipse.linuxtools.tmf.ui.views.project.handlers;
14
15import org.eclipse.core.commands.AbstractHandler;
16import org.eclipse.core.commands.ExecutionEvent;
17import org.eclipse.core.commands.ExecutionException;
18import org.eclipse.linuxtools.tmf.ui.views.project.model.TmfProjectNode;
19import org.eclipse.swt.widgets.MessageBox;
20import org.eclipse.ui.PlatformUI;
21
22/**
23 * <b><u>RenameProjectHandler</u></b>
24 * <p>
25 * TODO: Implement me. Please.
26 */
27public class RenameProjectHandler extends AbstractHandler {
28
29 private TmfProjectNode fProject = null;
30
31 // ------------------------------------------------------------------------
32 // Validation
33 // ------------------------------------------------------------------------
34
9ccc6d01 35 @Override
abfad0aa
FC
36 public boolean isEnabled() {
37
38// // Check if we are closing down
39// IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
40// if (window == null)
41// return false;
42//
43// // Check if we are in the Project View
44// IWorkbenchPage page = window.getActivePage();
45// if (!(page.getActivePart() instanceof ProjectView))
46// return false;
47//
48// // Check if a project is selected
49// ISelection selection = page.getSelection(ProjectView.ID);
50// if (selection instanceof StructuredSelection) {
51// Object element = ((StructuredSelection) selection).getFirstElement();
52// fProjectNode = (element instanceof TmfProjectNode) ? (TmfProjectNode) element : null;
53// }
54
55 return (fProject != null);
56 }
57
58 // ------------------------------------------------------------------------
59 // Execution
60 // ------------------------------------------------------------------------
61
d4011df2 62 @Override
abfad0aa
FC
63 public Object execute(ExecutionEvent event) throws ExecutionException {
64
65 MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
66 mb.setText("Rename Project");
67 mb.setMessage("Not implemented yet");
68 mb.open();
69
70 return null;
71 }
72
73}
This page took 0.027465 seconds and 5 git commands to generate.