Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 217772 Details for
Bug 371285
Session comparison between runs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Added data collection viewer
0002-Added-data-collection-view-PerfDataCollectionView.ja.patch (text/plain), 5.17 KB, created by
Camilo Bernal
on 2012-06-22 18:35:51 EDT
(
hide
)
Description:
Added data collection viewer
Filename:
MIME Type:
Creator:
Camilo Bernal
Created:
2012-06-22 18:35:51 EDT
Size:
5.17 KB
patch
obsolete
>From 0e75d5118461686060f15e17ef60a1791e8d47b7 Mon Sep 17 00:00:00 2001 >From: Camilo Bernal <cabernal@redhat.com> >Date: Fri, 22 Jun 2012 17:22:21 -0400 >Subject: [PATCH 2/2] Added data collection view > (PerfDataCollectionView.java). > >This view is used to display the selected data files that will be compared >when the PerfDiff action is invoked. To keep track of the selected files >an object array is used, which is updated everytime a selection is made. >An ISelectionListener is used to listen to selection events and >update the view accordingly. >--- > .../internal/perf/ui/PerfDataCollectionView.java | 131 ++++++++++++++++++++ > 1 files changed, 131 insertions(+), 0 deletions(-) > create mode 100644 perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDataCollectionView.java > >diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDataCollectionView.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDataCollectionView.java >new file mode 100644 >index 0000000..64b48b1 >--- /dev/null >+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDataCollectionView.java >@@ -0,0 +1,131 @@ >+/******************************************************************************* >+ * Copyright (c) 2012 Red Hat, Inc. >+ * 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: >+ * Camilo Bernal <cabernal@redhat.com> - Initial Implementation. >+ *******************************************************************************/ >+package org.eclipse.linuxtools.internal.perf.ui; >+ >+import java.util.ArrayList; >+ >+import org.eclipse.jface.action.Action; >+import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.viewers.ArrayContentProvider; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.jface.viewers.TableViewer; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.ui.IActionBars; >+import org.eclipse.ui.ISelectionListener; >+import org.eclipse.ui.IWorkbenchPart; >+import org.eclipse.ui.model.WorkbenchLabelProvider; >+import org.eclipse.ui.part.ViewPart; >+ >+public class PerfDataCollectionView extends ViewPart { >+ >+ private static final String ID = "org.eclipse.linuxtools.internal.perf.views.SessionCompareView"; >+ >+ public static ArrayList<Object> selectedFiles = new ArrayList<Object>(); >+ >+ private TableViewer tableviewer; >+ >+ // This keeps track of the first selection event >+ private boolean starting = true; >+ >+ // listener registered with the selection service >+ public ISelectionListener listener = new ISelectionListener() { >+ public void selectionChanged(IWorkbenchPart sourcepart, >+ ISelection selection) { >+ if (selectedFiles.size() >= 2) >+ return; >+ // ignore our own selections >+ if (sourcepart != PerfDataCollectionView.this) { >+ if (starting) { >+ starting = false; >+ return; >+ } >+ showSelection(sourcepart, selection); >+ } >+ } >+ }; >+ >+ /** >+ * Show selected files >+ * >+ * @param sourcepart >+ * source part of selection >+ * @param selection >+ * selected item >+ */ >+ public void showSelection(IWorkbenchPart sourcepart, ISelection selection) { >+ if (selection instanceof IStructuredSelection) { >+ IStructuredSelection ss = (IStructuredSelection) selection; >+ Object[] o = ss.toArray(); >+ selectedFiles.add(o[0]); >+ showItems(selectedFiles.toArray()); >+ } >+ } >+ >+ private void showItems(Object[] items) { >+ tableviewer.setInput(items); >+ tableviewer.refresh(); >+ } >+ >+ public void createPartControl(Composite parent) { >+ setContentDescription("Select data files to compare from the Project Explorer"); >+ tableviewer = new TableViewer(parent, SWT.NONE); >+ tableviewer.setLabelProvider(new WorkbenchLabelProvider()); >+ tableviewer.setContentProvider(new ArrayContentProvider()); >+ >+ // provide tableviewer selection >+ getSite().setSelectionProvider(tableviewer); >+ >+ contributeToActionBars(); >+ getSite().getWorkbenchWindow().getSelectionService() >+ .addSelectionListener(listener); >+ } >+ >+ private void contributeToActionBars() { >+ Action clearAction = new PerfDataClearAction(); >+ Action diffAction = new PerfDiffAction(); >+ >+ IActionBars actionBars = getViewSite().getActionBars(); >+ IToolBarManager toolBar = actionBars.getToolBarManager(); >+ toolBar.add(clearAction); >+ toolBar.add(diffAction); >+ } >+ >+ public void setFocus() { >+ tableviewer.getControl().setFocus(); >+ } >+ >+ public void refreshView() { >+ showItems(selectedFiles.toArray()); >+ } >+ >+ public void dispose() { >+ // remove listener when disposing view >+ getSite().getWorkbenchWindow().getSelectionService() >+ .removeSelectionListener(listener); >+ super.dispose(); >+ } >+ >+ public void clearSelections() { >+ starting = true; >+ selectedFiles.clear(); >+ refreshView(); >+ } >+ >+ public void restart() { >+ starting = true; >+ } >+ >+ public ArrayList<Object> getSelectedFiles() { >+ return selectedFiles; >+ } >+} >\ No newline at end of file >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jjohnstn
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 371285
:
217768
|
217769
|
217770
|
217771
| 217772 |
217773
|
217774
|
217775
|
217776
|
217779
|
218026
|
218056