Skip to main content
summaryrefslogtreecommitdiffstats
blob: 43dc44b2ac6def2a4897ab833ace849ac36fba40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*******************************************************************************
 * Copyright (c) 2009, 2010 Ericsson
 * 
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *   Francois Chouinard - Initial API and implementation
 *******************************************************************************/

package org.eclipse.linuxtools.lttng.ui.views.project.handlers;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.commands.IHandlerListener;
import org.eclipse.linuxtools.lttng.ui.views.project.model.LTTngProjectNode;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.ui.PlatformUI;

/**
 * <b><u>RenameProjectHandler</u></b>
 * <p>
 * TODO: Implement me. Please.
 */
public class RenameProjectHandler implements IHandler {

	private LTTngProjectNode fProject = null;

	// ------------------------------------------------------------------------
	// Validation
	// ------------------------------------------------------------------------

	public boolean isEnabled() {

//		// Check if we are closing down
//		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
//		if (window == null)
//			return false;
//
//		// Check if we are in the Project View
//		IWorkbenchPage page = window.getActivePage();
//		if (!(page.getActivePart() instanceof ProjectView))
//			return false;
//
//		// Check if a project is selected
//		ISelection selection = page.getSelection(ProjectView.ID);
//		if (selection instanceof StructuredSelection) {
//			Object element = ((StructuredSelection) selection).getFirstElement();
//			fProjectNode = (element instanceof LTTngProjectNode) ? (LTTngProjectNode) element : null;
//		}

		return (fProject != null);
	}

	// Handled if we are in the ProjectView
	public boolean isHandled() {
		return false;
	}

	// ------------------------------------------------------------------------
	// Execution
	// ------------------------------------------------------------------------

	public Object execute(ExecutionEvent event) throws ExecutionException {

		MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
		mb.setText("Rename Project");
		mb.setMessage("Not implemented yet");
		mb.open();

		return null;
	}

	public void dispose() {
		// TODO Auto-generated method stub
	}

	// ------------------------------------------------------------------------
	// IHandlerListener
	// ------------------------------------------------------------------------

	public void addHandlerListener(IHandlerListener handlerListener) {
		// TODO Auto-generated method stub
	}

	public void removeHandlerListener(IHandlerListener handlerListener) {
		// TODO Auto-generated method stub
	}

}

Back to the top