author | Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com> |
Wed, 23 Jun 2010 15:05:09 +0300 | |
changeset 12 | ae255c9aa552 |
parent 5 | 844b047e260d |
permissions | -rw-r--r-- |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
17 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
18 |
package com.nokia.carbide.cpp.internal.pi.wizards.ui; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
19 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
20 |
import java.util.List; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
21 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
22 |
import org.eclipse.core.runtime.IPath; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
23 |
import org.eclipse.core.runtime.IStatus; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
24 |
import org.eclipse.core.runtime.Path; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
25 |
import org.eclipse.core.runtime.Status; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
26 |
import org.eclipse.jface.dialogs.ErrorDialog; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
27 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
28 |
import org.eclipse.jface.viewers.IStructuredContentProvider; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
29 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
30 |
import org.eclipse.jface.viewers.TableViewer; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
31 |
import org.eclipse.jface.viewers.Viewer; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
32 |
import org.eclipse.swt.SWT; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
33 |
import org.eclipse.swt.events.SelectionAdapter; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
34 |
import org.eclipse.swt.events.SelectionEvent; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
35 |
import org.eclipse.swt.layout.GridData; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
36 |
import org.eclipse.swt.layout.GridLayout; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
37 |
import org.eclipse.swt.widgets.Button; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
38 |
import org.eclipse.swt.widgets.Composite; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
39 |
import org.eclipse.swt.widgets.DirectoryDialog; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
40 |
import org.eclipse.swt.widgets.FileDialog; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
41 |
import org.eclipse.swt.widgets.Table; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
42 |
import org.eclipse.swt.widgets.TableColumn; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
43 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
44 |
import com.nokia.carbide.cpp.pi.PiPlugin; |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
45 |
import com.nokia.carbide.cpp.pi.wizards.WizardsPlugin; |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
46 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
47 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
48 |
* Provides content of the profile data file selection from file system group |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
49 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
50 |
public class FileSelectionGroup extends AbstractBaseGroup { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
51 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
52 |
private TableViewer profileDataTable; |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
53 |
private PluginSelectionGroup pluginSelectionGroup; |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
54 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
55 |
/** |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
56 |
* Constructor |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
57 |
* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
58 |
* @param parent instance of the parent composite |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
59 |
* @param wizardSettings instance of the INewPIWizardSettings |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
60 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
61 |
public FileSelectionGroup(Composite parent, |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
62 |
INewPIWizardSettings wizardSettings) { |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
63 |
super(parent, wizardSettings, false); |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
64 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
65 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
66 |
/* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
67 |
* (non-Javadoc) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
68 |
* @see com.nokia.carbide.cpp.internal.pi.wizards.ui.AbstractBaseGroup#createContent() |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
69 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
70 |
protected void createContent() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
71 |
GridLayout gridLayout = new GridLayout(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
72 |
gridLayout.numColumns = 2; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
73 |
this.setLayout(gridLayout); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
74 |
this.setLayoutData(new GridData(GridData.FILL_BOTH)); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
75 |
this.setText(Messages.getString("FileSelectionGroup.title")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
76 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
77 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
78 |
profileDataTable = new TableViewer(this, SWT.BORDER| SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
79 |
| SWT.FULL_SELECTION); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
80 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
81 |
TableColumn column = new TableColumn(profileDataTable.getTable(), SWT.NONE); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
82 |
column.setText(Messages.getString("FileSelectionGroup.profilerDataFileName")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
83 |
column.setWidth(200); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
84 |
column.setResizable(true); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
85 |
column.setMoveable(true); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
86 |
column.addSelectionListener(new SelectionAdapter(){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
87 |
public void widgetSelected(SelectionEvent e) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
88 |
{ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
89 |
if (!(e.widget instanceof TableColumn)) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
90 |
return; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
91 |
((AbstractBaseSorter)profileDataTable.getSorter()).doSort(0); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
92 |
profileDataTable.refresh(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
93 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
94 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
95 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
96 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
97 |
column = new TableColumn(profileDataTable.getTable(), SWT.NONE); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
98 |
column.setText(Messages.getString("FileSelectionGroup.profilerDataFilePath")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
99 |
column.setWidth(300); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
100 |
column.setResizable(true); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
101 |
column.setMoveable(true); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
102 |
column.addSelectionListener(new SelectionAdapter(){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
103 |
public void widgetSelected(SelectionEvent e) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
104 |
{ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
105 |
if (!(e.widget instanceof TableColumn)) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
106 |
return; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
107 |
((AbstractBaseSorter)profileDataTable.getSorter()).doSort(1); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
108 |
profileDataTable.refresh(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
109 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
110 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
111 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
112 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
113 |
GridData fileLogsTableGridData = new GridData(GridData.FILL_BOTH); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
114 |
profileDataTable.getTable().setLayoutData(fileLogsTableGridData); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
115 |
profileDataTable.getTable().setHeaderVisible(true); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
116 |
profileDataTable.getTable().setLinesVisible(true); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
117 |
profileDataTable.setContentProvider(new IStructuredContentProvider(){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
118 |
public Object[] getElements(Object inputElement) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
119 |
if (inputElement instanceof List<?>){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
120 |
return ((List<?>)inputElement).toArray(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
121 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
122 |
return new Object[0]; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
123 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
124 |
public void dispose() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
125 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
126 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
127 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
128 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
129 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
130 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
131 |
profileDataTable.addSelectionChangedListener(new ISelectionChangedListener() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
132 |
public void selectionChanged(SelectionChangedEvent event) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
133 |
if(profileDataTable.getTable().getSelectionCount() == 1){ |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
134 |
pluginSelectionGroup.updateTraceIds(getSelectedItem()); |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
135 |
wizardSettings.validatePage(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
136 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
137 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
138 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
139 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
140 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
141 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
142 |
profileDataTable.setSorter( new AbstractBaseSorter(profileDataTable.getTable(), 0){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
143 |
@Override |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
144 |
public int compare(Viewer viewer, Object e1, Object e2) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
145 |
IPath path1 = (IPath)e1; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
146 |
IPath path2 = (IPath)e2; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
147 |
int returnCode = 0; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
148 |
switch (column) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
149 |
case 0: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
150 |
returnCode = path1.lastSegment().compareTo(path2.lastSegment()); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
151 |
break; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
152 |
case 1: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
153 |
returnCode = path1.removeLastSegments(1).toOSString().compareTo(path2.removeLastSegments(1).toOSString()); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
154 |
break; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
155 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
156 |
default: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
157 |
break; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
158 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
159 |
if (!sortAscending) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
160 |
returnCode = -returnCode; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
161 |
return returnCode; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
162 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
163 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
164 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
165 |
profileDataTable.setLabelProvider(new AbstractLabelProvider() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
166 |
public String getColumnText(Object element, int columnIndex) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
167 |
IPath path = (IPath)element; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
168 |
switch (columnIndex) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
169 |
case 0: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
170 |
return path.lastSegment(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
171 |
case 1: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
172 |
return path.removeLastSegments(1).toOSString(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
173 |
default: |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
174 |
break; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
175 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
176 |
return ""; //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
177 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
178 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
179 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
180 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
181 |
Composite fileSelectionButtonComposite = new Composite(this, SWT.NONE); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
182 |
GridLayout threadButtonLayout = new GridLayout(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
183 |
GridData fileSelectionButtonGridData = new GridData( |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
184 |
GridData.HORIZONTAL_ALIGN_FILL); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
185 |
fileSelectionButtonComposite.setLayoutData(fileSelectionButtonGridData); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
186 |
fileSelectionButtonComposite.setLayout(threadButtonLayout); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
187 |
threadButtonLayout.numColumns = 1; |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
188 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
189 |
// Add file button |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
190 |
Button addFileButton = new Button(fileSelectionButtonComposite, |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
191 |
SWT.PUSH); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
192 |
addFileButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
193 |
addFileButton.setText(Messages.getString("FileSelectionGroup.actionAddFile")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
194 |
addFileButton.addSelectionListener(new SelectionAdapter() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
195 |
public void widgetSelected(SelectionEvent e) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
196 |
// open file dialog for selecting a crash file |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
197 |
FileDialog dialog = new FileDialog(getShell(), SWT.MULTI); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
198 |
dialog.setText(Messages.getString("FileSelectionGroup.dialogFileTitle")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
199 |
String[] filterExt = { "*.dat", "*.*" }; //$NON-NLS-1$ //$NON-NLS-2$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
200 |
dialog.setFilterExtensions(filterExt); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
201 |
String path = dialog.open(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
202 |
if(path != null){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
203 |
IPath folder = new Path(path).removeLastSegments(1); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
204 |
for(String fileName: dialog.getFileNames()){ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
205 |
try { |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
206 |
addProfilerDataFile(folder.append(fileName),0,0); |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
207 |
} catch (IllegalArgumentException iae) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
208 |
IStatus status = new Status(Status.ERROR, |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
209 |
PiPlugin.PLUGIN_ID, iae.getMessage()); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
210 |
ErrorDialog.openError(getShell(), |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
211 |
Messages.getString("FileSelectionGroup.performanceInvestigator"), null, status); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
212 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
213 |
} |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
214 |
refreshTable(profileDataTable, true); |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
215 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
216 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
217 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
218 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
219 |
// Add folder button |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
220 |
Button addDirectoryButton = new Button(fileSelectionButtonComposite, |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
221 |
SWT.PUSH); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
222 |
addDirectoryButton |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
223 |
.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
224 |
addDirectoryButton.setText(Messages.getString("FileSelectionGroup.actionAddDirectory")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
225 |
addDirectoryButton.addSelectionListener(new SelectionAdapter() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
226 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
227 |
public void widgetSelected(SelectionEvent e) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
228 |
// open file dialog for selecting a crash file |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
229 |
DirectoryDialog dialog = new DirectoryDialog(getShell()); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
230 |
dialog |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
231 |
.setText(Messages.getString("FileSelectionGroup.dialogDirectoryTitle")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
232 |
String result = dialog.open(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
233 |
if (result != null) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
234 |
try { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
235 |
addDirectory(new Path(result)); |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
236 |
refreshTable(profileDataTable, true); |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
237 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
238 |
} catch (IllegalArgumentException iae) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
239 |
IStatus status = new Status(Status.ERROR, |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
240 |
PiPlugin.PLUGIN_ID, iae.getMessage()); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
241 |
ErrorDialog.openError(getShell(), |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
242 |
Messages.getString("FileSelectionGroup.performanceInvestigator"), null, status); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
243 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
244 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
245 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
246 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
247 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
248 |
// Remove one file button |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
249 |
Button removeOneButton = new Button(fileSelectionButtonComposite, |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
250 |
SWT.PUSH); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
251 |
removeOneButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
252 |
removeOneButton.setText(Messages.getString("FileSelectionGroup.actionRemove")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
253 |
removeOneButton.addSelectionListener(new SelectionAdapter() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
254 |
public void widgetSelected(SelectionEvent e) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
255 |
removeSelectedItem(profileDataTable); |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
256 |
refreshTable(profileDataTable, true); |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
257 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
258 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
259 |
}); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
260 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
261 |
// Remove all files and folders button |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
262 |
Button removeAllButton = new Button(fileSelectionButtonComposite, |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
263 |
SWT.PUSH); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
264 |
removeAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
265 |
removeAllButton.setText(Messages.getString("FileSelectionGroup.actionRemoveAll")); //$NON-NLS-1$ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
266 |
removeAllButton.addSelectionListener(new SelectionAdapter() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
267 |
public void widgetSelected(SelectionEvent e) { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
268 |
removeAll(); |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
269 |
refreshTable(profileDataTable, true); |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
270 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
271 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
272 |
}); |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
273 |
pluginSelectionGroup = new PluginSelectionGroup(this,wizardSettings, false); |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
274 |
} |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
275 |
|
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
276 |
/* |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
277 |
* (non-Javadoc) |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
278 |
* @see com.nokia.carbide.cpp.internal.pi.wizards.ui.AbstractBaseGroup#getTable() |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
279 |
*/ |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
280 |
@Override |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
281 |
public Table getTable() { |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
282 |
return profileDataTable.getTable(); |
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
283 |
} |
12
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
284 |
|
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
285 |
|
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
286 |
@Override |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
287 |
public IStatus validateContent(NewPIWizard wizardPage) { |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
288 |
IStatus status = Status.OK_STATUS; |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
289 |
if(pluginSelectionGroup != null){ |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
290 |
pluginSelectionGroup.updateTraceIds(getSelectedItem()); |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
291 |
wizardPage.setProfilerDataFiles(getProfilerDataFiles()); |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
292 |
} |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
293 |
int count = getProfilerDataFiles().size(); |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
294 |
if( count > 1){ |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
295 |
status = new Status(Status.WARNING, WizardsPlugin.PLUGIN_ID, Messages.getString("NewPIWizardPageInputTask.noteImportMayTakeSeveralMinutes")); //$NON-NLS-1$ |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
296 |
}else if(count == 1){ |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
297 |
status = new Status(Status.OK, WizardsPlugin.PLUGIN_ID,Messages.getString("NewPIWizardPageSampleFile.description")); //$NON-NLS-1$ |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
298 |
}else{ |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
299 |
status = new Status(Status.INFO, WizardsPlugin.PLUGIN_ID,Messages.getString("NewPIWizardPageSampleFile.description")); //$NON-NLS-1$ |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
300 |
} |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
301 |
return status; |
ae255c9aa552
Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
5
diff
changeset
|
302 |
} |
5
844b047e260d
Performance Investigator Carbide extension 2.3.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff
changeset
|
303 |
} |