mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
ToolChain modification fixes
This commit is contained in:
parent
37e5d4a0d8
commit
855cc012dd
2 changed files with 24 additions and 7 deletions
|
@ -996,12 +996,28 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
|
||||||
|
|
||||||
private ITool[] calculateToolsArray(ITool[] removed, ITool[] added){
|
private ITool[] calculateToolsArray(ITool[] removed, ITool[] added){
|
||||||
ITool tools[] = getTools();
|
ITool tools[] = getTools();
|
||||||
HashSet set = new HashSet();
|
Map map = calcExtToolIdToToolMap(tools);
|
||||||
set.addAll(Arrays.asList(tools));
|
Map removedMap = calcExtToolIdToToolMap(removed);
|
||||||
set.removeAll(Arrays.asList(removed));
|
for(Iterator iter = removedMap.keySet().iterator(); iter.hasNext();){
|
||||||
set.addAll(Arrays.asList(added));
|
map.remove(iter.next());
|
||||||
|
}
|
||||||
|
map.putAll(calcExtToolIdToToolMap(added));
|
||||||
|
|
||||||
return (ITool[])set.toArray(new ITool[set.size()]);
|
return (ITool[])map.values().toArray(new ITool[map.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map calcExtToolIdToToolMap(ITool tools[]){
|
||||||
|
Map map = new HashMap();
|
||||||
|
for(int i = 0; i < tools.length; i++){
|
||||||
|
ITool tool = tools[i];
|
||||||
|
ITool extTool = ManagedBuildManager.getExtensionTool(tool);
|
||||||
|
if(extTool == null)
|
||||||
|
extTool = tool;
|
||||||
|
|
||||||
|
map.put(extTool.getId(), tool);
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ITool[][] calculateConflictingTools(ITool[] newTools){
|
private ITool[][] calculateConflictingTools(ITool[] newTools){
|
||||||
|
|
|
@ -182,13 +182,14 @@ public class ToolSelectionDialog extends Dialog {
|
||||||
if (!exists) added.add(t);
|
if (!exists) added.add(t);
|
||||||
add(t, t2, !exists);
|
add(t, t2, !exists);
|
||||||
}
|
}
|
||||||
if (check && removed.size() > 0 || added.size() > 0) {
|
if (true/*check && removed.size() > 0 || added.size() > 0 */) {
|
||||||
IModificationStatus st = fi.getToolChainModificationStatus(
|
IModificationStatus st = fi.getToolChainModificationStatus(
|
||||||
(ITool[])removed.toArray(new ITool[removed.size()]),
|
(ITool[])removed.toArray(new ITool[removed.size()]),
|
||||||
(ITool[])added.toArray(new ITool[added.size()]));
|
(ITool[])added.toArray(new ITool[added.size()]));
|
||||||
if (st.isOK()) {
|
if (st.isOK()) {
|
||||||
errorLabel.setText(""); //$NON-NLS-1$
|
errorLabel.setText(""); //$NON-NLS-1$
|
||||||
getButton(IDialogConstants.OK_ID).setEnabled(true);
|
if(getButton(IDialogConstants.OK_ID) != null)
|
||||||
|
getButton(IDialogConstants.OK_ID).setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
int c = st.getCode();
|
int c = st.getCode();
|
||||||
String s = ""; //$NON-NLS-1$
|
String s = ""; //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue