Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 371285 | Differences between
and this patch

Collapse All | Expand All

(-)a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDataClearAction.java (+32 lines)
Added Link Here
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.ui.IWorkbench;
15
import org.eclipse.ui.IWorkbenchPage;
16
import org.eclipse.ui.IWorkbenchWindow;
17
import org.eclipse.ui.PlatformUI;
18
19
public class PerfDataClearAction extends Action {
20
	public PerfDataClearAction() {
21
		super("Clear Selection");
22
	}
23
24
	public void run() {
25
		IWorkbench wb = PlatformUI.getWorkbench();
26
		IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
27
		IWorkbenchPage page = win.getActivePage();
28
		PerfDataCollectionView vp = (PerfDataCollectionView) page
29
				.findView("org.eclipse.linuxtools.perf.ui.PerfSessionCompareView");
30
		vp.clearSelections();
31
	}
32
}
(-)a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDataCollectionAction.java (-1 / +46 lines)
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
}

Return to bug 371285