~ubuntu-branches/ubuntu/utopic/eclipse-linuxtools/utopic

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameExperimentHandler.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2014-05-12 18:11:40 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140512181140-w237r3vsah1tmybz
Tags: 2.2.1-1
* New upstream release.
* Refreshed d/patches.
* Removed eclipse-cdt-valgrind-remote package, all its functionality
  is now provided by eclipse-cdt-profiling-framework-remote.
* Added remove-license-feature.patch.
* Bump Standards-Version to 3.9.5.
* Enable eclipse-changelog package.
* Enable eclipse-rpm-editor package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
 
 * Copyright (c) 2011 Ericsson
3
 
 * 
 
2
 * Copyright (c) 2011, 2013 Ericsson
 
3
 *
4
4
 * All rights reserved. This program and the accompanying materials are
5
5
 * made available under the terms of the Eclipse Public License v1.0 which
6
6
 * accompanies this distribution, and is available at
7
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 
 * 
 
8
 *
9
9
 * Contributors:
10
10
 *   Francois Chouinard - Initial API and implementation
11
11
 *******************************************************************************/
33
33
public class RenameExperimentHandler extends AbstractHandler {
34
34
 
35
35
        private TmfExperimentElement fExperiment = null;
36
 
        
 
36
 
37
37
        // ------------------------------------------------------------------------
38
38
    // isEnabled
39
39
    // ------------------------------------------------------------------------
43
43
 
44
44
        // Check if we are closing down
45
45
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
46
 
        if (window == null)
 
46
        if (window == null) {
47
47
            return false;
 
48
        }
48
49
 
49
50
        // Get the selection
50
51
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
51
52
        IWorkbenchPart part = page.getActivePart();
 
53
        if (part == null) {
 
54
            return false;
 
55
        }
52
56
        ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
53
 
        if (selectionProvider == null)
 
57
        if (selectionProvider == null) {
54
58
            return false;
 
59
        }
55
60
        ISelection selection = selectionProvider.getSelection();
56
61
 
57
62
        // Make sure there is only selection and that it is an experiment
76
81
 
77
82
        // Check if we are closing down
78
83
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
79
 
        if (window == null)
 
84
        if (window == null) {
80
85
            return null;
 
86
        }
81
87
 
82
88
        // Fire the Rename Experiment dialog
83
89
        Shell shell = window.getShell();