|
Added
Link Here
|
| 0 |
- |
1 |
/******************************************************************************* |
|
|
2 |
* Copyright (c) 2012 Red Hat, Inc. |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: |
| 9 |
* Camilo Bernal <cabernal@redhat.com> - Initial Implementation. |
| 10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.linuxtools.internal.perf.ui; |
| 12 |
|
| 13 |
import org.eclipse.jface.action.Action; |
| 14 |
import org.eclipse.jface.dialogs.MessageDialog; |
| 15 |
import org.eclipse.swt.widgets.Display; |
| 16 |
import org.eclipse.ui.IWorkbench; |
| 17 |
import org.eclipse.ui.IWorkbenchPage; |
| 18 |
import org.eclipse.ui.IWorkbenchWindow; |
| 19 |
import org.eclipse.ui.PartInitException; |
| 20 |
import org.eclipse.ui.PlatformUI; |
| 21 |
|
| 22 |
public class PerfDataCollectionAction extends Action { |
| 23 |
public PerfDataCollectionAction() { |
| 24 |
super("Compare Sessions"); |
| 25 |
} |
| 26 |
|
| 27 |
@Override |
| 28 |
public void run() { |
| 29 |
MessageDialog |
| 30 |
.openInformation(Display.getCurrent().getActiveShell(), |
| 31 |
"Compare Selection", |
| 32 |
"Please select the older and newer perf data files you wish to compare."); |
| 33 |
IWorkbench workbench = PlatformUI.getWorkbench(); |
| 34 |
IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); |
| 35 |
try { |
| 36 |
IWorkbenchPage wbp = workbenchWindow.getActivePage(); |
| 37 |
wbp.showView("org.eclipse.linuxtools.perf.ui.PerfSessionCompareView"); |
| 38 |
PerfDataCollectionView vp = (PerfDataCollectionView) wbp |
| 39 |
.findView("org.eclipse.linuxtools.perf.ui.PerfSessionCompareView"); |
| 40 |
|
| 41 |
vp.clearSelections(); |
| 42 |
} catch (PartInitException e) { |
| 43 |
e.printStackTrace(); |
| 44 |
} |
| 45 |
} |
| 46 |
} |