|
Lines 33-38
Link Here
|
| 33 |
import org.eclipse.cdt.managedbuilder.core.IInputType; |
33 |
import org.eclipse.cdt.managedbuilder.core.IInputType; |
| 34 |
import org.eclipse.cdt.managedbuilder.core.IResourceInfo; |
34 |
import org.eclipse.cdt.managedbuilder.core.IResourceInfo; |
| 35 |
import org.eclipse.cdt.managedbuilder.core.ITool; |
35 |
import org.eclipse.cdt.managedbuilder.core.ITool; |
|
|
36 |
import org.eclipse.cdt.managedbuilder.internal.core.InputType; |
| 37 |
import org.eclipse.cdt.managedbuilder.internal.core.Tool; |
| 36 |
import org.eclipse.cdt.ui.CUIPlugin; |
38 |
import org.eclipse.cdt.ui.CUIPlugin; |
| 37 |
import org.eclipse.cdt.ui.newui.CDTPrefUtil; |
39 |
import org.eclipse.cdt.ui.newui.CDTPrefUtil; |
| 38 |
import org.eclipse.cdt.ui.newui.UIMessages; |
40 |
import org.eclipse.cdt.ui.newui.UIMessages; |
|
Lines 54-59
Link Here
|
| 54 |
import org.eclipse.swt.widgets.Combo; |
56 |
import org.eclipse.swt.widgets.Combo; |
| 55 |
import org.eclipse.swt.widgets.Composite; |
57 |
import org.eclipse.swt.widgets.Composite; |
| 56 |
import org.eclipse.swt.widgets.Group; |
58 |
import org.eclipse.swt.widgets.Group; |
|
|
59 |
import org.eclipse.swt.widgets.Label; |
| 57 |
import org.eclipse.swt.widgets.Table; |
60 |
import org.eclipse.swt.widgets.Table; |
| 58 |
import org.eclipse.swt.widgets.TableItem; |
61 |
import org.eclipse.swt.widgets.TableItem; |
| 59 |
|
62 |
|
|
Lines 71-76
Link Here
|
| 71 |
private static final String PROFILE_NAME = "name"; //$NON-NLS-1$ |
74 |
private static final String PROFILE_NAME = "name"; //$NON-NLS-1$ |
| 72 |
private static final int DEFAULT_HEIGHT = 110; |
75 |
private static final int DEFAULT_HEIGHT = 110; |
| 73 |
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 }; |
76 |
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 }; |
|
|
77 |
private Label fTableDefinition; |
| 74 |
private Table resTable; |
78 |
private Table resTable; |
| 75 |
private Button scEnabledButton; |
79 |
private Button scEnabledButton; |
| 76 |
private Button scProblemReportingEnabledButton; |
80 |
private Button scProblemReportingEnabledButton; |
|
Lines 118-125
Link Here
|
| 118 |
sashForm = new SashForm(usercomp, SWT.NONE); |
122 |
sashForm = new SashForm(usercomp, SWT.NONE); |
| 119 |
sashForm.setOrientation(SWT.HORIZONTAL); |
123 |
sashForm.setOrientation(SWT.HORIZONTAL); |
| 120 |
sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); |
124 |
sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); |
| 121 |
|
125 |
|
| 122 |
resTable = new Table(sashForm, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER); |
126 |
Composite comp = new Composite(sashForm, SWT.NONE); |
|
|
127 |
comp.setLayout(new GridLayout(1, true)); |
| 128 |
comp.setLayoutData(new GridData()); |
| 129 |
|
| 130 |
fTableDefinition = new Label(comp, SWT.LEFT); |
| 131 |
fTableDefinition.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 132 |
|
| 133 |
resTable = new Table(comp, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER); |
| 123 |
GridData gd = new GridData(GridData.FILL_VERTICAL); |
134 |
GridData gd = new GridData(GridData.FILL_VERTICAL); |
| 124 |
gd.widthHint = 150; |
135 |
gd.widthHint = 150; |
| 125 |
resTable.setLayoutData(gd); |
136 |
resTable.setLayoutData(gd); |
|
Lines 205-212
Link Here
|
| 205 |
} |
216 |
} |
| 206 |
|
217 |
|
| 207 |
private void updateData() { |
218 |
private void updateData() { |
| 208 |
if (scopeComboBox != null) |
219 |
int selScope = 0; |
| 209 |
scopeComboBox.select(cbi.isPerRcTypeDiscovery() ? 0 : 1); |
220 |
String lblText = "Tools:"; |
|
|
221 |
if(!cbi.isPerRcTypeDiscovery()) { |
| 222 |
selScope = 1; |
| 223 |
lblText = "Configuration:"; |
| 224 |
} |
| 225 |
if (scopeComboBox != null) |
| 226 |
scopeComboBox.select(selScope); |
| 227 |
fTableDefinition.setText(lblText); |
| 228 |
|
| 210 |
|
229 |
|
| 211 |
Map<CfgInfoContext, IScannerConfigBuilderInfo2> m = cbi.getInfoMap(); |
230 |
Map<CfgInfoContext, IScannerConfigBuilderInfo2> m = cbi.getInfoMap(); |
| 212 |
int pos = resTable.getSelectionIndex(); |
231 |
int pos = resTable.getSelectionIndex(); |
|
Lines 291-297
Link Here
|
| 291 |
int counter = 0; |
310 |
int counter = 0; |
| 292 |
int pos = 0; |
311 |
int pos = 0; |
| 293 |
String savedId = buildInfo.getSelectedProfileId(); |
312 |
String savedId = buildInfo.getSelectedProfileId(); |
|
|
313 |
ITool[] tools = null; |
| 314 |
Tool tool = (Tool)iContext.getTool(); |
| 315 |
if(null == tool) { |
| 316 |
IConfiguration conf = iContext.getConfiguration(); |
| 317 |
if(null != conf) { |
| 318 |
tools = conf.getToolChain().getTools(); |
| 319 |
} |
| 320 |
if(null == tools) |
| 321 |
return; |
| 322 |
} |
| 323 |
else |
| 324 |
tools = new ITool[] { tool }; |
| 325 |
|
| 294 |
for (String profileId : profilesList) { |
326 |
for (String profileId : profilesList) { |
|
|
327 |
boolean ok = false; |
| 328 |
for(int i = 0; i < tools.length; ++i) { |
| 329 |
IInputType[] inputTypes = ((Tool)tools[i]).getAllInputTypes(); |
| 330 |
if(null != inputTypes) { |
| 331 |
for(IInputType it : inputTypes) { |
| 332 |
String[] requiedProfiles = getDiscoveryProfileIds(tools[i], it); |
| 333 |
if(null != requiedProfiles) { |
| 334 |
for(String requiredProfile : requiedProfiles) { |
| 335 |
if(profileId.equals(requiredProfile)) { |
| 336 |
ok = true; |
| 337 |
break; |
| 338 |
} |
| 339 |
} |
| 340 |
} |
| 341 |
} |
| 342 |
} |
| 343 |
if(ok) |
| 344 |
break; |
| 345 |
} |
| 346 |
if(!ok) |
| 347 |
continue; |
| 295 |
if (!cbi.isProfileSupported(iContext, profileId)) |
348 |
if (!cbi.isProfileSupported(iContext, profileId)) |
| 296 |
continue; |
349 |
continue; |
| 297 |
visibleProfilesList.add(profileId); |
350 |
visibleProfilesList.add(profileId); |
|
Lines 325-331
Link Here
|
| 325 |
handleDiscoveryProfileChanged(); |
378 |
handleDiscoveryProfileChanged(); |
| 326 |
} |
379 |
} |
| 327 |
|
380 |
|
| 328 |
private String[] normalize(String[] labels, String[] ids, int counter) { |
381 |
private String[] getDiscoveryProfileIds(ITool iTool, IInputType it) { |
|
|
382 |
String attribute = ((InputType)it).getDiscoveryProfileIdAttribute(); |
| 383 |
if(null == attribute) |
| 384 |
return new String[0]; |
| 385 |
// FIXME: temporary; we should add new method to IInputType instead of that |
| 386 |
String[] profileIds = attribute.split("\\|"); |
| 387 |
for(int i = 0; i < profileIds.length; ++i) |
| 388 |
profileIds[i] = profileIds[i].trim(); |
| 389 |
return profileIds; |
| 390 |
} |
| 391 |
|
| 392 |
private String[] normalize(String[] labels, String[] ids, int counter) { |
| 329 |
int mode = CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES); |
393 |
int mode = CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES); |
| 330 |
String[] tmp = new String[counter]; |
394 |
String[] tmp = new String[counter]; |
| 331 |
// Always show either Name + ID, or ID only |
395 |
// Always show either Name + ID, or ID only |