/*******************************************************************************
* Copyright (c) 2009, 2010, 2011 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
*******************************************************************************/
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return false;
+ }
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null)
return false;
/*******************************************************************************
* Copyright (c) 2011 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
*******************************************************************************/
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return false;
+ }
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
- if (selectionProvider == null)
+ if (selectionProvider == null) {
return false;
+ }
ISelection selection = selectionProvider.getSelection();
// Make sure a trace is selected
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return null;
+ }
// Fire the Copy Experiment dialog
Shell shell = window.getShell();
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelection selection = part.getSite().getSelectionProvider().getSelection();
if (selection instanceof TreeSelection) {
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
/*******************************************************************************
* Copyright (c) 2009, 2010, 2011 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
*******************************************************************************/
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return null;
+ }
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelection selection = part.getSite().getSelectionProvider().getSelection();
TmfExperimentFolder experimentFolder = null;
if (selection instanceof TreeSelection) {
// Get the selection
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
final IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
final ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
// Get the selection
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
final IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
final ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
/*******************************************************************************
* Copyright (c) 2011 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
*******************************************************************************/
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
- return null;
+ if (window == null) {
+ return null;
+ }
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelection selection = part.getSite().getSelectionProvider().getSelection();
if (selection instanceof TreeSelection) {
TreeSelection treeSelection = (TreeSelection) selection;
/*******************************************************************************
* Copyright (c) 2011 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
*******************************************************************************/
public class RenameExperimentHandler extends AbstractHandler {
private TmfExperimentElement fExperiment = null;
-
+
// ------------------------------------------------------------------------
// isEnabled
// ------------------------------------------------------------------------
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return false;
+ }
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
- if (selectionProvider == null)
+ if (selectionProvider == null) {
return false;
+ }
ISelection selection = selectionProvider.getSelection();
// Make sure there is only selection and that it is an experiment
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return null;
+ }
// Fire the Rename Experiment dialog
Shell shell = window.getShell();
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
if (selectionProvider == null) {
return false;
/*******************************************************************************
* Copyright (c) 2009, 2010, 2011 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
*******************************************************************************/
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return false;
+ }
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
+ if (part == null) {
+ return false;
+ }
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
- if (selectionProvider == null)
+ if (selectionProvider == null) {
return false;
+ }
ISelection selection = selectionProvider.getSelection();
// Make sure there is only one selection and that it is an experiment
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return null;
+ }
// Fire the Select Traces Wizard
IWorkbench workbench = PlatformUI.getWorkbench();