author | stechong |
Wed, 20 Oct 2010 11:19:31 -0500 | |
changeset 2165 | 2a7b5eccb0bc |
parent 2090 | 0a42921f1c76 |
permissions | -rw-r--r-- |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
1 |
/* |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
2 |
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
8 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
11 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
13 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
15 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
16 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
17 |
package com.nokia.carbide.cpp.internal.sdk.ui; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
18 |
|
1746 | 19 |
import java.io.File; |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
20 |
import java.text.MessageFormat; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
21 |
import java.util.Iterator; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
22 |
import java.util.List; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
23 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
24 |
import org.eclipse.core.runtime.IPath; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
25 |
import org.eclipse.core.runtime.Path; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
26 |
import org.eclipse.jface.dialogs.MessageDialog; |
2003
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
27 |
import org.eclipse.jface.preference.IPreferenceStore; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
28 |
import org.eclipse.jface.preference.PreferencePage; |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
29 |
import org.eclipse.jface.viewers.ArrayContentProvider; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
30 |
import org.eclipse.jface.viewers.CellEditor; |
1986 | 31 |
import org.eclipse.jface.viewers.CheckStateChangedEvent; |
1746 | 32 |
import org.eclipse.jface.viewers.CheckboxTableViewer; |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
33 |
import org.eclipse.jface.viewers.ColumnViewer; |
1431 | 34 |
import org.eclipse.jface.viewers.ColumnViewerEditor; |
35 |
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; |
|
36 |
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy; |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
37 |
import org.eclipse.jface.viewers.EditingSupport; |
1986 | 38 |
import org.eclipse.jface.viewers.ICheckStateListener; |
1746 | 39 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
40 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
41 |
import org.eclipse.jface.viewers.ITableColorProvider; |
|
42 |
import org.eclipse.jface.viewers.ITableLabelProvider; |
|
43 |
import org.eclipse.jface.viewers.LabelProvider; |
|
44 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
|
45 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
46 |
import org.eclipse.jface.viewers.TableViewerColumn; |
1431 | 47 |
import org.eclipse.jface.viewers.TableViewerEditor; |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
48 |
import org.eclipse.jface.viewers.TextCellEditor; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
49 |
import org.eclipse.swt.SWT; |
1746 | 50 |
import org.eclipse.swt.events.SelectionAdapter; |
51 |
import org.eclipse.swt.events.SelectionEvent; |
|
52 |
import org.eclipse.swt.events.SelectionListener; |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
53 |
import org.eclipse.swt.graphics.Color; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
54 |
import org.eclipse.swt.graphics.Image; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
55 |
import org.eclipse.swt.layout.GridData; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
56 |
import org.eclipse.swt.layout.GridLayout; |
1746 | 57 |
import org.eclipse.swt.widgets.Button; |
58 |
import org.eclipse.swt.widgets.Composite; |
|
59 |
import org.eclipse.swt.widgets.Control; |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
60 |
import org.eclipse.swt.widgets.DirectoryDialog; |
1746 | 61 |
import org.eclipse.swt.widgets.Label; |
62 |
import org.eclipse.swt.widgets.Shell; |
|
63 |
import org.eclipse.swt.widgets.Table; |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
64 |
import org.eclipse.swt.widgets.Text; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
65 |
import org.eclipse.ui.ISharedImages; |
1746 | 66 |
import org.eclipse.ui.IWorkbench; |
67 |
import org.eclipse.ui.IWorkbenchPreferencePage; |
|
68 |
import org.eclipse.ui.PlatformUI; |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
69 |
|
2090 | 70 |
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; |
743
78fd666a897a
Fix filesystem caching performance as in bug #10318
Ed Swartz <ed.swartz@nokia.com>
parents:
608
diff
changeset
|
71 |
import com.nokia.carbide.cpp.internal.api.sdk.SymbianBuildContextDataCache; |
2090 | 72 |
import com.nokia.carbide.cpp.internal.sdk.core.model.SBSv2BuildInfo; |
1434 | 73 |
import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK; |
1746 | 74 |
import com.nokia.carbide.cpp.sdk.core.ISDKManager; |
2090 | 75 |
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; |
1746 | 76 |
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
77 |
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; |
|
1994
e9be28ae423a
Bug 10645 - add p2 install operation for docs plugins
dadubrow
parents:
1986
diff
changeset
|
78 |
import com.nokia.carbide.cpp.sdk.ui.SDKUIPlugin; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
79 |
import com.nokia.carbide.cpp.sdk.ui.shared.AddSDKDialog; |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
80 |
import com.nokia.carbide.cpp.ui.TextAndDialogCellEditor; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
81 |
import com.nokia.cpp.internal.api.utils.ui.BrowseDialogUtils; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
82 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
83 |
public class SDKPreferencePage |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
84 |
extends PreferencePage |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
85 |
implements IWorkbenchPreferencePage { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
86 |
|
1495 | 87 |
private class SDKLabelProvider extends LabelProvider implements ITableLabelProvider, ITableColorProvider { |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
88 |
public Image getColumnImage(Object element, int columnIndex) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
89 |
return null; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
90 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
91 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
92 |
public String getColumnText(Object element, int columnIndex) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
93 |
ISymbianSDK sdk = (ISymbianSDK) element; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
94 |
switch (columnIndex) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
95 |
case 1: |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
96 |
return sdk.getUniqueId(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
97 |
case 2: |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
98 |
return sdk.getEPOCROOT(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
99 |
default: |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
100 |
return ""; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
101 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
102 |
} |
1495 | 103 |
|
104 |
public Color getForeground(Object element, int columnIndex) { |
|
105 |
ISymbianSDK sdk = (ISymbianSDK) element; |
|
106 |
return updateSDKcolor(sdk); |
|
107 |
} |
|
108 |
||
109 |
public Color getBackground(Object element, int columnIndex) { |
|
110 |
return white; |
|
111 |
} |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
112 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
113 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
114 |
private class IdEditingSupport extends EditingSupport { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
115 |
private TextCellEditor editor; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
116 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
117 |
public IdEditingSupport(ColumnViewer viewer) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
118 |
super(viewer); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
119 |
editor = new TextCellEditor((Composite) viewer.getControl()); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
120 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
121 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
122 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
123 |
protected boolean canEdit(Object element) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
124 |
if (element instanceof ISymbianSDK) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
125 |
return true; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
126 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
127 |
return false; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
128 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
129 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
130 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
131 |
protected CellEditor getCellEditor(Object element) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
132 |
return editor; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
133 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
134 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
135 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
136 |
protected Object getValue(Object element) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
137 |
ISymbianSDK sdk = (ISymbianSDK) element; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
138 |
return sdk.getUniqueId(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
139 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
140 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
141 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
142 |
protected void setValue(Object element, Object value) { |
1431 | 143 |
String sdkID = value.toString(); |
144 |
||
145 |
// check for spaces in ID |
|
146 |
if (sdkID.contains(" ")){ //$NON-NLS-1$ |
|
147 |
MessageDialog.openError(getShell(), Messages.getString("AddSDKDialog.Invalid_SDK_ID"), Messages.getString("AddSDKDialog.SDK_ID_No_Spaces")); //$NON-NLS-1$ //$NON-NLS-2$ |
|
148 |
return; |
|
149 |
} |
|
150 |
||
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
151 |
ISymbianSDK sdk = (ISymbianSDK) element; |
1434 | 152 |
((SymbianSDK)sdk).setUniqueId(sdkID); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
153 |
SDKCorePlugin.getSDKManager().updateSDK(sdk); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
154 |
getViewer().refresh(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
155 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
156 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
157 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
158 |
private class LocationEditingSupport extends EditingSupport { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
159 |
private LocationCellEditor editor; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
160 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
161 |
public LocationEditingSupport(ColumnViewer viewer) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
162 |
super(viewer); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
163 |
editor = new LocationCellEditor((Composite) viewer.getControl()); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
164 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
165 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
166 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
167 |
protected boolean canEdit(Object element) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
168 |
if (element instanceof ISymbianSDK) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
169 |
return true; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
170 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
171 |
return false; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
172 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
173 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
174 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
175 |
protected CellEditor getCellEditor(Object element) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
176 |
return editor; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
177 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
178 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
179 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
180 |
protected Object getValue(Object element) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
181 |
ISymbianSDK sdk = (ISymbianSDK) element; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
182 |
return sdk.getEPOCROOT(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
183 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
184 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
185 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
186 |
protected void setValue(Object element, Object value) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
187 |
ISymbianSDK sdk = (ISymbianSDK) element; |
2090 | 188 |
File currentPath = new File(sdk.getEPOCROOT()); |
189 |
File editedPath = new File(value.toString()); |
|
190 |
if (!currentPath.equals(editedPath)){ |
|
191 |
// User changed the path, so make sure to scan again (boog 12172) |
|
192 |
((SymbianSDK)sdk).setScannedRaptor(false); |
|
193 |
SymbianBuildContextDataCache.refreshForSDKs(new ISymbianSDK[] { sdk }); |
|
194 |
} |
|
1462 | 195 |
((SymbianSDK)sdk).setEPOCROOT(value.toString()); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
196 |
SDKCorePlugin.getSDKManager().updateSDK(sdk); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
197 |
getViewer().refresh(); |
1928
cfa3a98b5df2
Fix for Bug 11967 [SDK pref - Error message not updated as soon as error fixed, have to click off and back again].
stechong
parents:
1805
diff
changeset
|
198 |
updateSDKStatus(sdk); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
199 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
200 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
201 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
202 |
private class LocationCellEditor extends TextAndDialogCellEditor { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
203 |
private Button button; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
204 |
private Text text; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
205 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
206 |
public LocationCellEditor(Composite parent) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
207 |
super(parent); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
208 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
209 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
210 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
211 |
protected Control createContents(Composite parent) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
212 |
text = (Text) super.createContents(parent); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
213 |
return text; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
214 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
215 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
216 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
217 |
protected Control createControl(Composite parent) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
218 |
Control control = super.createControl(parent); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
219 |
button = getButton(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
220 |
button.setText(Messages.getString("SDKPreferencePage.Browse_Location_Label")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
221 |
return control; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
222 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
223 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
224 |
@Override |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
225 |
protected Object openDialogBox(Control cellEditorWindow) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
226 |
DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.OPEN); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
227 |
BrowseDialogUtils.initializeFrom(dialog, text); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
228 |
return dialog.open(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
229 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
230 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
231 |
|
1431 | 232 |
private class SDKViewerStrategy extends ColumnViewerEditorActivationStrategy { |
233 |
public SDKViewerStrategy(ColumnViewer viewer) { |
|
234 |
super(viewer); |
|
235 |
} |
|
236 |
||
237 |
@Override |
|
238 |
protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) { |
|
239 |
return (event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION); |
|
240 |
} |
|
241 |
} |
|
242 |
||
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
243 |
private ISDKManager sdkMgr; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
244 |
private List<ISymbianSDK> sdkList; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
245 |
private CheckboxTableViewer sdkListTableViewer; |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
246 |
private Button addButton; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
247 |
private Button deleteButton; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
248 |
private Button propertiesButton; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
249 |
private Button rescanButton; |
2003
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
250 |
private Button scanPluginsButton; |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
251 |
private Label iconLabel; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
252 |
private Label statusLabel; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
253 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
254 |
private Color black; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
255 |
private Color gray; |
1495 | 256 |
private Color red; |
257 |
private Color white; |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
258 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
259 |
/** |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
260 |
* Constructor. |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
261 |
*/ |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
262 |
public SDKPreferencePage() { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
263 |
super(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
264 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
265 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
266 |
/* |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
267 |
* (non-Javadoc) |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
268 |
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite) |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
269 |
*/ |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
270 |
public void createControl(Composite parent){ |
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
271 |
if (sdkMgr == null) { |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
272 |
sdkMgr = SDKCorePlugin.getSDKManager(); |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
273 |
} |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
274 |
if (sdkMgr == null) { |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
275 |
return; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
276 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
277 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
278 |
super.createControl(parent); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
279 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
280 |
// Hide "Restore Defaults" button |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
281 |
getDefaultsButton().setVisible(false); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
282 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
283 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(super.getControl(), SDKUIHelpIds.SDK_PREFERENCES_PAGE); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
284 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
285 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
286 |
/* |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
287 |
* (non-Javadoc) |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
288 |
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
289 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
290 |
public void init(IWorkbench workbench) { |
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
291 |
if (sdkMgr == null) { |
1756
bd6f1436505a
ensure sdk mgr for both pref page and portal layer
dadubrow
parents:
1753
diff
changeset
|
292 |
sdkMgr = SDKCorePlugin.getSDKManager(); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
293 |
} |
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
294 |
if (sdkMgr != null) { |
1743 | 295 |
sdkList = sdkMgr.getSDKList(); |
296 |
} |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
297 |
} |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
298 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
299 |
/* |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
300 |
* (non-Javadoc) |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
301 |
* @see org.eclipse.jface.preference.PreferencePage#performOk() |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
302 |
*/ |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
303 |
public boolean performOk() { |
2003
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
304 |
IPreferenceStore prefsStore = SDKUIPlugin.getDefault().getPreferenceStore(); |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
305 |
prefsStore.setValue(SDKUIPreferenceConstants.SCAN_FOR_NEW_PLUGINS, scanPluginsButton.getSelection()); |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
306 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
307 |
// Remember which SDK is enabled |
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
308 |
for (ISymbianSDK sdk : sdkMgr.getSDKList()) { |
1434 | 309 |
((SymbianSDK)sdk).setEnabled(false); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
310 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
311 |
Object[] sdkObjects = sdkListTableViewer.getCheckedElements(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
312 |
for (Object currObj : sdkObjects){ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
313 |
if (currObj instanceof ISymbianSDK){ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
314 |
ISymbianSDK sdk = (ISymbianSDK)currObj; |
1434 | 315 |
((SymbianSDK)sdk).setEnabled(true); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
316 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
317 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
318 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
319 |
// Update cached SDK info |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
320 |
sdkMgr.updateCarbideSDKCache(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
321 |
return super.performOk(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
322 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
323 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
324 |
/* |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
325 |
* (non-Javadoc) |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
326 |
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
327 |
*/ |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
328 |
@Override |
1730
e0e324a4ef67
make createContents public so Carbide portal can access SDK Prefs to draw it.
timkelly
parents:
1700
diff
changeset
|
329 |
public Control createContents(Composite parent) { |
2003
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
330 |
IPreferenceStore prefsStore = SDKUIPlugin.getDefault().getPreferenceStore(); |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
331 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
332 |
// Set up colors used in this preference page |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
333 |
Shell shell = parent.getShell(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
334 |
black = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
335 |
gray = shell.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND); |
1495 | 336 |
red = shell.getDisplay().getSystemColor(SWT.COLOR_RED); |
337 |
white = shell.getDisplay().getSystemColor(SWT.COLOR_WHITE); |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
338 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
339 |
Composite content = new Composite(parent, SWT.NONE); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
340 |
GridLayout gridLayout = new GridLayout(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
341 |
gridLayout.numColumns = 2; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
342 |
content.setLayout(gridLayout); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
343 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
344 |
// SDK table |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
345 |
sdkListTableViewer = CheckboxTableViewer.newCheckList(content, |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
346 |
SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
347 |
createSDKTable(); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
348 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
349 |
// Buttons composite |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
350 |
Composite composite1 = new Composite(content, SWT.NONE); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
351 |
gridLayout = new GridLayout(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
352 |
gridLayout.makeColumnsEqualWidth = true; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
353 |
composite1.setLayout(gridLayout); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
354 |
GridData gridData = new GridData(SWT.LEFT, SWT.TOP, true, false); |
1431 | 355 |
composite1.setLayoutData(gridData); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
356 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
357 |
// Add button |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
358 |
addButton = new Button(composite1, SWT.NONE); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
359 |
addButton.setLayoutData(gridData); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
360 |
addButton.setText(Messages.getString("SDKPreferencePage.Add_Button_Label")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
361 |
addButton.setToolTipText(Messages.getString("SDKPreferencePage.Add_Button_ToolTip")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
362 |
addButtonListener(addButton); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
363 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
364 |
// Delete button |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
365 |
deleteButton = new Button(composite1, SWT.NONE); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
366 |
deleteButton.setLayoutData(gridData); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
367 |
deleteButton.setText(Messages.getString("SDKPreferencePage.Delete_Button_Label")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
368 |
deleteButton.setToolTipText(Messages.getString("SDKPreferencePage.Delete_Button_ToolTip")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
369 |
addButtonListener(deleteButton); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
370 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
371 |
// Properties button |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
372 |
propertiesButton = new Button(composite1, SWT.NONE); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
373 |
propertiesButton.setLayoutData(gridData); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
374 |
propertiesButton.setText(Messages.getString("SDKPreferencePage.Properties_Button_Label")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
375 |
propertiesButton.setToolTipText(Messages.getString("SDKPreferencePage.Properties_Button_ToolTip")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
376 |
addButtonListener(propertiesButton); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
377 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
378 |
// Status and Rescan composite |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
379 |
Composite composite2 = new Composite(content, SWT.NONE); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
380 |
gridData = new GridData(SWT.FILL, SWT.CENTER, true, false); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
381 |
gridData.widthHint = 350; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
382 |
gridData.heightHint = 50; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
383 |
composite2.setLayoutData(gridData); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
384 |
gridLayout = new GridLayout(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
385 |
gridLayout.numColumns = 2; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
386 |
composite2.setLayout(gridLayout); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
387 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
388 |
// IStatus icon label |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
389 |
iconLabel = new Label(composite2, SWT.NONE); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
390 |
// IStatus text label |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
391 |
statusLabel = new Label(composite2, SWT.WRAP); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
392 |
gridData = new GridData(SWT.LEFT, SWT.TOP, true, false); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
393 |
gridData.verticalSpan = 2; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
394 |
statusLabel.setLayoutData(gridData); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
395 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
396 |
new Label(content, SWT.WRAP); // filler |
2003
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
397 |
|
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
398 |
// Scan for installable features in SDKs button |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
399 |
scanPluginsButton = new Button(content, SWT.CHECK); |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
400 |
scanPluginsButton.setToolTipText(Messages.getString("SDKPreferencePage.scanPlugins_ButtonToolTip")); //$NON-NLS-1$ |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
401 |
scanPluginsButton.setText(Messages.getString("SDKPreferencePage.scanPlugins_Button_Label")); //$NON-NLS-1$ |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
402 |
scanPluginsButton.setSelection(prefsStore.getBoolean(SDKUIPreferenceConstants.SCAN_FOR_NEW_PLUGINS)); |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
403 |
addButtonListener(scanPluginsButton); |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
404 |
|
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
405 |
new Label(content, SWT.WRAP); // filler |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
406 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
407 |
// Rescan button |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
408 |
rescanButton = new Button(content, SWT.NONE); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
409 |
rescanButton.setToolTipText(Messages.getString("SDKPreferencePage.Rescan_Button_ToolTip")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
410 |
rescanButton.setText(Messages.getString("SDKPreferencePage.Rescan_Button_Label")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
411 |
addButtonListener(rescanButton); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
412 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
413 |
// Populate SDK table |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
414 |
addSDKComponentTableItems(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
415 |
selectSDKEntry(0); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
416 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
417 |
return content; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
418 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
419 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
420 |
private void addButtonListener(final Button aButton) { |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
421 |
SelectionListener listener = new SelectionAdapter() { |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
422 |
public void widgetSelected(SelectionEvent e) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
423 |
if (e.getSource().equals(addButton)) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
424 |
handleAddButton(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
425 |
} else if (e.getSource().equals(deleteButton)) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
426 |
handleDeleteButton(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
427 |
} else if (e.getSource().equals(propertiesButton)) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
428 |
handlePropertiesButton(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
429 |
} else if (e.getSource().equals(rescanButton)) { |
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
430 |
handleRescanButton(false); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
431 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
432 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
433 |
}; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
434 |
aButton.addSelectionListener(listener); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
435 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
436 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
437 |
private void addSDKComponentTableItems() { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
438 |
sdkListTableViewer.setLabelProvider(new SDKLabelProvider()); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
439 |
sdkListTableViewer.setContentProvider(new ArrayContentProvider()); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
440 |
sdkList = sdkMgr.getSDKList(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
441 |
sdkListTableViewer.setInput(sdkList.toArray()); |
1451
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
442 |
Table table = sdkListTableViewer.getTable(); |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
443 |
int count = table.getItemCount(); |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
444 |
if (count < 10) { // min. number of rows |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
445 |
count = 10; |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
446 |
} else |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
447 |
if (count > 20) { // max. number of rows |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
448 |
count = 20; |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
449 |
} |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
450 |
table.setToolTipText(Messages.getString("SDKPreferencePage.List_of_Available_SDKs_ToolTip")); //$NON-NLS-1$ |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
451 |
GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false); |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
452 |
gridData.widthHint = 350; |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
453 |
gridData.heightHint = table.getItemHeight() * (count + 2); |
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
454 |
table.setLayoutData(gridData); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
455 |
setCheckedElements(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
456 |
addSDKTableViewerListeners(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
457 |
if (sdkList == null || sdkList.size() == 0){ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
458 |
statusError(Messages.getString("SDKPreferencePage.No_SDKs_Available_Message")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
459 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
460 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
461 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
462 |
private void addSDKTableViewerListeners(){ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
463 |
sdkListTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
464 |
public void selectionChanged(SelectionChangedEvent event) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
465 |
if(event.getSelection() instanceof IStructuredSelection) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
466 |
IStructuredSelection selection = (IStructuredSelection)event.getSelection(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
467 |
if (selection.size() == 1){ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
468 |
ISymbianSDK sdk = (ISymbianSDK)selection.getFirstElement(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
469 |
deleteButton.setEnabled(true); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
470 |
propertiesButton.setEnabled(true); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
471 |
updateSDKStatus(sdk); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
472 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
473 |
else { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
474 |
deleteButton.setEnabled(false); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
475 |
propertiesButton.setEnabled(false); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
476 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
477 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
478 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
479 |
}); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
480 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
481 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
482 |
private void createSDKTable() { |
1451
1d88f6209d70
Add SDK version info back to SDK properties dialog; more changes to make table in SDK preference page resizable.
stechong
parents:
1446
diff
changeset
|
483 |
Table table = sdkListTableViewer.getTable(); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
484 |
table.setHeaderVisible(true); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
485 |
table.setLinesVisible(false); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
486 |
|
1431 | 487 |
SDKViewerStrategy strategy = new SDKViewerStrategy(sdkListTableViewer); |
488 |
TableViewerEditor.create(sdkListTableViewer, strategy, ColumnViewerEditor.DEFAULT); |
|
489 |
||
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
490 |
TableViewerColumn enabledCol = new TableViewerColumn(sdkListTableViewer, SWT.LEFT); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
491 |
enabledCol.getColumn().setText(Messages.getString("SDKPreferencePage.SDK_Table_Enabled_Column_Label")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
492 |
enabledCol.getColumn().setWidth(50); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
493 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
494 |
TableViewerColumn idCol = new TableViewerColumn(sdkListTableViewer, SWT.LEFT); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
495 |
idCol.setEditingSupport(new IdEditingSupport(sdkListTableViewer)); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
496 |
idCol.getColumn().setText(Messages.getString("SDKPreferencePage.SDK_Table_ID_Column_Label")); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
497 |
idCol.getColumn().setWidth(160); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
498 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
499 |
TableViewerColumn locationCol = new TableViewerColumn(sdkListTableViewer, SWT.LEFT); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
500 |
locationCol.setEditingSupport(new LocationEditingSupport(sdkListTableViewer)); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
501 |
locationCol.getColumn().setText(Messages.getString("SDKPreferencePage.SDK_Table_Location_Column_Label")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
502 |
locationCol.getColumn().setWidth(170); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
503 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
504 |
|
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
505 |
public void handleAddButton() { |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
506 |
AddSDKDialog dialog = new AddSDKDialog(getShell()); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
507 |
if (dialog.open() == AddSDKDialog.OK){ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
508 |
sdkList = sdkMgr.getSDKList(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
509 |
sdkListTableViewer.setInput(sdkList.toArray()); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
510 |
setCheckedElements(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
511 |
sdkListTableViewer.refresh(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
512 |
selectSDKEntry(sdkList.size() - 1); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
513 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
514 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
515 |
|
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
516 |
public void handleDeleteButton() { |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
517 |
ISymbianSDK sdk = (ISymbianSDK)((IStructuredSelection)sdkListTableViewer.getSelection()).getFirstElement(); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
518 |
int index = sdkListTableViewer.getTable().getSelectionIndex(); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
519 |
if (sdk != null){ |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
520 |
if (sdkMgr.removeSDK(sdk.getUniqueId())){ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
521 |
sdkList = sdkMgr.getSDKList(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
522 |
sdkListTableViewer.setInput(sdkList.toArray()); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
523 |
if (index > 0) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
524 |
selectSDKEntry(index - 1); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
525 |
} else { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
526 |
selectSDKEntry(index); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
527 |
} |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
528 |
sdkListTableViewer.refresh(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
529 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
530 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
531 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
532 |
|
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
533 |
public void handlePropertiesButton() { |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
534 |
ISymbianSDK sdk = (ISymbianSDK)((IStructuredSelection)sdkListTableViewer.getSelection()).getFirstElement(); |
1431 | 535 |
int index = sdkListTableViewer.getTable().getSelectionIndex(); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
536 |
if (sdk != null){ |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
537 |
SDKPropertiesDialog sdkPropDlg = new SDKPropertiesDialog(getShell(), sdk); |
1431 | 538 |
sdkPropDlg.open(); |
539 |
selectSDKEntry(index); |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
540 |
} else { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
541 |
MessageDialog.openError(getShell(), Messages.getString("SDKPreferencePage.No_SDK_Selected"), Messages.getString("SDKPreferencePage.No_selected_SDK_detected")); //$NON-NLS-1$ //$NON-NLS-2$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
542 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
543 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
544 |
|
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
545 |
public void handleRescanButton(boolean fromPortalPage) { |
743
78fd666a897a
Fix filesystem caching performance as in bug #10318
Ed Swartz <ed.swartz@nokia.com>
parents:
608
diff
changeset
|
546 |
// forcible rescan; dump cache |
78fd666a897a
Fix filesystem caching performance as in bug #10318
Ed Swartz <ed.swartz@nokia.com>
parents:
608
diff
changeset
|
547 |
SymbianBuildContextDataCache.refreshForSDKs(null); |
1456 | 548 |
startRescanning(); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
549 |
sdkMgr.scanSDKs(); |
1456 | 550 |
finishRescanning(); |
483
34f888c29813
Fix Bug 9787 - Carbide gets its SDK list out of sync with devices.xml
timkelly
parents:
335
diff
changeset
|
551 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
552 |
|
1456 | 553 |
private void startRescanning() { |
554 |
rescanButton.setText(Messages.getString("SDKPreferencePage.Rescanning_Button_Label")); //$NON-NLS-1$ |
|
555 |
rescanButton.setEnabled(false); |
|
556 |
} |
|
557 |
||
558 |
private void finishRescanning(){ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
559 |
sdkListTableViewer.getTable().clearAll(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
560 |
sdkListTableViewer.refresh(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
561 |
sdkList.clear(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
562 |
sdkList = sdkMgr.getSDKList(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
563 |
addSDKComponentTableItems(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
564 |
sdkListTableViewer.refresh(); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
565 |
selectSDKEntry(0); |
2003
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
566 |
if (scanPluginsButton.getSelection()) { |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
567 |
NewPluginChecker.checkForNewlyInstalledPlugins(SDKUIPlugin.getDefault().getWorkbench()); |
576284888c71
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
stechong
parents:
1994
diff
changeset
|
568 |
} |
1456 | 569 |
rescanButton.setText(Messages.getString("SDKPreferencePage.Rescan_Button_Label")); //$NON-NLS-1$ |
570 |
rescanButton.setEnabled(true); |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
571 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
572 |
|
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
573 |
public void selectSDKEntry(int index) { |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
574 |
ISymbianSDK sdk = (ISymbianSDK)sdkListTableViewer.getElementAt(index); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
575 |
if (sdk != null){ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
576 |
sdkListTableViewer.setSelection(new StructuredSelection(sdk), true); |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
577 |
sdkListTableViewer.getTable().setFocus(); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
578 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
579 |
updateSDKStatus(sdk); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
580 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
581 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
582 |
private void setCheckedElements() { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
583 |
Iterator<ISymbianSDK> iterator = sdkList.iterator(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
584 |
while (iterator.hasNext()) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
585 |
ISymbianSDK sdk = iterator.next(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
586 |
sdkListTableViewer.setChecked(sdk, sdk.isEnabled()); |
483
34f888c29813
Fix Bug 9787 - Carbide gets its SDK list out of sync with devices.xml
timkelly
parents:
335
diff
changeset
|
587 |
} |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
588 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
589 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
590 |
private void statusClear() { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
591 |
iconLabel.setImage(null); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
592 |
statusLabel.setText(""); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
593 |
} |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
594 |
|
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
595 |
private void statusError(String msg) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
596 |
String errorMsg = "Error : " + msg; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
597 |
iconLabel.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK)); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
598 |
statusLabel.setText(errorMsg); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
599 |
statusLabel.setForeground(red); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
600 |
statusLabel.setBackground(gray); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
601 |
statusLabel.update(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
602 |
statusLabel.getParent().layout(true); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
603 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
604 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
605 |
private void statusWarning(String msg) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
606 |
String warningMsg = "Warning : " + msg; //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
607 |
iconLabel.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK)); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
608 |
statusLabel.setText(warningMsg); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
609 |
statusLabel.setForeground(black); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
610 |
statusLabel.setBackground(gray); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
611 |
statusLabel.update(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
612 |
statusLabel.getParent().layout(true); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
613 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
614 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
615 |
private void statusInfo(String msg) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
616 |
String infoMsg = "Info : " + msg; //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
617 |
iconLabel.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK)); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
618 |
statusLabel.setText(infoMsg); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
619 |
statusLabel.setForeground(black); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
620 |
statusLabel.setBackground(gray); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
621 |
statusLabel.update(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
622 |
statusLabel.getParent().layout(true); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
623 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
624 |
|
1495 | 625 |
private Color updateSDKcolor(ISymbianSDK sdk){ |
626 |
Color color = black; |
|
627 |
||
628 |
// Check SDK EPOCROOT |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
629 |
String epocRootStr = sdk.getEPOCROOT(); |
1495 | 630 |
IPath epocRoot = new Path(epocRootStr); |
631 |
epocRoot = epocRoot.append("epoc32"); |
|
632 |
File epocRootFile = epocRoot.toFile(); |
|
633 |
if (!epocRootFile.exists()) { |
|
634 |
color = red; |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
635 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
636 |
|
1495 | 637 |
// Check SDK OS Version |
638 |
if ((sdk.getOSVersion().getMajor() < 9 || |
|
639 |
(sdk.getOSVersion().getMajor() == 9 && sdk.getOSVersion().getMinor() < 4))) { |
|
640 |
color = red; |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
641 |
} |
1495 | 642 |
|
643 |
return color; |
|
644 |
} |
|
645 |
||
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
646 |
private void updateSDKStatus(ISymbianSDK sdk){ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
647 |
// No SDK selected |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
648 |
if (sdk == null) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
649 |
statusWarning(Messages.getString("SDKPreferencePage.No_SDKs_Available_Message")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
650 |
return; |
1350
653fc45456c4
Remove ABLD support (and support for OS 9.4 and less)
timkelly
parents:
743
diff
changeset
|
651 |
} else { |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
652 |
// Check SDK EPOCROOT |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
653 |
String epocRootStr = sdk.getEPOCROOT(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
654 |
IPath epocRoot = new Path(epocRootStr); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
655 |
epocRoot = epocRoot.append("epoc32"); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
656 |
File epocRootFile = epocRoot.toFile(); |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
657 |
if (!epocRootFile.exists()) { |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
658 |
statusError(Messages.getString("SDKPreferencePage.Invalid_Location_Message")); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
659 |
return; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
660 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
661 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
662 |
// Check SDK OS Version |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
663 |
if ((sdk.getOSVersion().getMajor() < 9 || |
1431 | 664 |
(sdk.getOSVersion().getMajor() == 9 && sdk.getOSVersion().getMinor() < 4))) { |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
665 |
statusError(MessageFormat.format( |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
666 |
Messages.getString("SDKPreferencePage.Invalid_SDK_Message"), //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
667 |
sdk.getOSVersion().toString())); //$NON-NLS-1$ |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
668 |
return; |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
669 |
} |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
670 |
|
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
671 |
// No error |
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
672 |
statusClear(); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
673 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
674 |
} |
1421
587da7cb64b7
New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents:
1352
diff
changeset
|
675 |
|
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
676 |
public void updateForPortalLayer() { |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
677 |
addButton.setVisible(false); |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
678 |
deleteButton.setVisible(false); |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
679 |
propertiesButton.setVisible(false); |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
680 |
rescanButton.setVisible(false); |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
681 |
getApplyButton().setVisible(false); |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
682 |
GridLayout gridLayout = new GridLayout(); |
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
683 |
sdkListTableViewer.getTable().getParent().setLayout(gridLayout); |
1986 | 684 |
sdkListTableViewer.addCheckStateListener(new ICheckStateListener() { |
685 |
||
686 |
public void checkStateChanged(CheckStateChangedEvent event) { |
|
687 |
performApply(); |
|
688 |
} |
|
689 |
}); |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
690 |
} |
1761
bd89f0317b13
Updated SDK preference page to make it more portal friendly.
stechong
parents:
1743
diff
changeset
|
691 |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
692 |
} |