mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
fix bogus message about change in project path which switching between include and project path property pages
This commit is contained in:
parent
83c6521896
commit
9e55dcaf36
9 changed files with 25 additions and 16 deletions
|
@ -170,11 +170,12 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple
|
|||
|
||||
private String getEncodedSettings() {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
|
||||
int nElements = getCPaths().size();
|
||||
|
||||
List elements = getCPaths();
|
||||
int nElements = elements.size();
|
||||
buf.append('[').append(nElements).append(']');
|
||||
for (int i = 0; i < nElements; i++) {
|
||||
CPElement elem = (CPElement) getCPaths().get(i);
|
||||
CPElement elem = (CPElement) elements.get(i);
|
||||
elem.appendEncodedSettings(buf);
|
||||
}
|
||||
return buf.toString();
|
||||
|
|
|
@ -11,8 +11,8 @@ package org.eclipse.cdt.internal.ui.dialogs.cpaths;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class CPElementGroup {
|
|||
public CPElementGroup(IResource resource) {
|
||||
this.kind = -1;
|
||||
this.resource = resource;
|
||||
this.childrenListMap = new HashMap(2);
|
||||
this.childrenListMap = new LinkedHashMap(2);
|
||||
}
|
||||
|
||||
public CPElementGroup(CPElement parent, int kind) {
|
||||
|
@ -150,15 +150,14 @@ public class CPElementGroup {
|
|||
public CPElement[] getChildren() {
|
||||
if (childrenList != null) {
|
||||
return (CPElement[])childrenList.toArray(new CPElement[childrenList.size()]);
|
||||
} else {
|
||||
Collection lists = childrenListMap.values();
|
||||
Iterator iter = lists.iterator();
|
||||
List children = new ArrayList();
|
||||
while (iter.hasNext()) {
|
||||
children.addAll((List)iter.next());
|
||||
}
|
||||
return (CPElement[])children.toArray(new CPElement[children.size()]);
|
||||
}
|
||||
Collection lists = childrenListMap.values();
|
||||
Iterator iter = lists.iterator();
|
||||
List children = new ArrayList();
|
||||
while (iter.hasNext()) {
|
||||
children.addAll((List)iter.next());
|
||||
}
|
||||
return (CPElement[])children.toArray(new CPElement[children.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,6 +69,7 @@ public class CPathContainerEntryPage extends CPathBasePage {
|
|||
fContainersList.enableButton(IDX_REMOVE, false);
|
||||
fContainersList.enableButton(IDX_EDIT, false);
|
||||
fContainersList.enableButton(IDX_EXPORT, false);
|
||||
fContainersList.setTreeExpansionLevel(2);
|
||||
|
||||
fContainersList.setViewerSorter(new CPElementSorter());
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ public class CPathIncludeSymbolEntryPage extends CPathBasePage {
|
|||
fIncludeSymPathsList.enableButton(IDX_EXPORT, false);
|
||||
fIncludeSymPathsList.enableButton(IDX_UP, false);
|
||||
fIncludeSymPathsList.enableButton(IDX_DOWN, false);
|
||||
|
||||
fIncludeSymPathsList.setTreeExpansionLevel(2);
|
||||
fShowInheritedPaths = new SelectionButtonDialogField(SWT.CHECK);
|
||||
fShowInheritedPaths.setSelection(true);
|
||||
fShowInheritedPaths.setLabelText(CPathEntryMessages.getString("IncludeSymbolsEntryPage.show_inherited.check")); //$NON-NLS-1$
|
||||
|
@ -269,12 +269,18 @@ public class CPathIncludeSymbolEntryPage extends CPathBasePage {
|
|||
List resourceGroups = new ArrayList(5);
|
||||
fProjectGroup = new CPElementGroup(fCurrCProject.getResource());
|
||||
resourceGroups.add(fProjectGroup);
|
||||
// add containers first so that they appear at top of list
|
||||
for (int i = 0; i < cPaths.size(); i++) {
|
||||
CPElement element = (CPElement)cPaths.get(i);
|
||||
switch (element.getEntryKind()) {
|
||||
case IPathEntry.CDT_CONTAINER :
|
||||
fProjectGroup.addChild(element);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < cPaths.size(); i++) {
|
||||
CPElement element = (CPElement)cPaths.get(i);
|
||||
switch (element.getEntryKind()) {
|
||||
case IPathEntry.CDT_INCLUDE :
|
||||
case IPathEntry.CDT_MACRO :
|
||||
CPElementGroup resGroup = new CPElementGroup(element.getResource());
|
||||
|
|
|
@ -103,6 +103,7 @@ public class CPathLibraryEntryPage extends CPathBasePage {
|
|||
fLibrariesList.enableButton(IDX_EDIT, false);
|
||||
fLibrariesList.enableButton(IDX_REMOVE, false);
|
||||
fLibrariesList.enableButton(IDX_EXPORT, false);
|
||||
fLibrariesList.setTreeExpansionLevel(2);
|
||||
}
|
||||
|
||||
public Image getImage() {
|
||||
|
|
|
@ -92,6 +92,7 @@ public class CPathOutputEntryPage extends CPathBasePage {
|
|||
fOutputList.setViewerSorter(new CPElementSorter());
|
||||
fOutputList.enableButton(IDX_EDIT, false);
|
||||
fOutputList.enableButton(IDX_REMOVE, false);
|
||||
fOutputList.setTreeExpansionLevel(2);
|
||||
}
|
||||
|
||||
public Image getImage() {
|
||||
|
|
|
@ -93,6 +93,7 @@ public class CPathSourceEntryPage extends CPathBasePage {
|
|||
fFoldersList.setViewerSorter(new CPElementSorter());
|
||||
fFoldersList.enableButton(IDX_EDIT, false);
|
||||
fFoldersList.enableButton(IDX_REMOVE, false);
|
||||
fFoldersList.setTreeExpansionLevel(2);
|
||||
}
|
||||
|
||||
public Image getImage() {
|
||||
|
|
|
@ -31,6 +31,7 @@ public class NewIncludesSymbolsTabBlock extends AbstractPathOptionBlock implemen
|
|||
|
||||
public NewIncludesSymbolsTabBlock(IStatusChangeListener context, int pageToShow) {
|
||||
super(context, pageToShow);
|
||||
fIncludeSymbols = new CPathIncludeSymbolEntryPage(this);
|
||||
}
|
||||
|
||||
protected void addTab(ICOptionPage tab) {
|
||||
|
@ -46,7 +47,6 @@ public class NewIncludesSymbolsTabBlock extends AbstractPathOptionBlock implemen
|
|||
fComposite = new Composite(parent, SWT.NONE);
|
||||
fComposite.setLayout(new GridLayout(1, false));
|
||||
|
||||
fIncludeSymbols = new CPathIncludeSymbolEntryPage(this);
|
||||
addPage(fIncludeSymbols);
|
||||
setCurrentPage(fIncludeSymbols);
|
||||
initializingTabs = false;
|
||||
|
|
|
@ -270,7 +270,6 @@ public class TreeListDialogField extends DialogField {
|
|||
handleKeyPressed(e);
|
||||
}
|
||||
});
|
||||
fTree.setAutoExpandLevel(99);
|
||||
fTree.setContentProvider(fTreeViewerAdapter);
|
||||
fTree.setLabelProvider(fLabelProvider);
|
||||
fTree.addSelectionChangedListener(fTreeViewerAdapter);
|
||||
|
|
Loading…
Add table
Reference in a new issue