Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Hirsl2005-04-06 18:56:59 +0000
committerVladimir Hirsl2005-04-06 18:56:59 +0000
commite465c18c3419c22b6836e33a14044f93641eed27 (patch)
treecd1f8308bdd0e3e4fd131247e023ec5b009810cc /build/org.eclipse.cdt.make.ui
parent7a42a70017c5f0d533620e7cc5d95acfab124f1f (diff)
downloadorg.eclipse.cdt-e465c18c3419c22b6836e33a14044f93641eed27.tar.gz
org.eclipse.cdt-e465c18c3419c22b6836e33a14044f93641eed27.tar.xz
org.eclipse.cdt-e465c18c3419c22b6836e33a14044f93641eed27.zip
Proper handling of -I- command line option and generation of two sets of include paths:
for #include <...> directives and for #include "..." directives. Additional deleta all discovered scanner info action in DiscoveredPathContainerPage.
Diffstat (limited to 'build/org.eclipse.cdt.make.ui')
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java163
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java3
2 files changed, 89 insertions, 77 deletions
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java
index 1d711b6917e..a8e647c4e05 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java
@@ -33,6 +33,7 @@ import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerProjectDiscoveredPathInfo;
import org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredPathContainer;
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.SymbolEntry;
@@ -159,50 +160,52 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
if (!dirty) {
return true;
}
- IDiscoveredPathInfo info;
try {
- info = MakeCorePlugin.getDefault().
+ IDiscoveredPathInfo info = MakeCorePlugin.getDefault().
getDiscoveryManager().getDiscoveredInfo(fCProject.getProject());
+ if (info instanceof IPerProjectDiscoveredPathInfo) {
+ IPerProjectDiscoveredPathInfo projetcPathInfo = (IPerProjectDiscoveredPathInfo) info;
- LinkedHashMap includes = new LinkedHashMap();
- LinkedHashMap symbols = new LinkedHashMap();
-
- DiscoveredElement container = (DiscoveredElement) fDiscoveredContainerList.getElement(0);
- if (container != null && container.getEntryKind() == DiscoveredElement.CONTAINER) {
- Object[] cChildren = container.getChildren();
- if (cChildren != null) {
- for (int i = 0; i < cChildren.length; ++i) {
- DiscoveredElement group = (DiscoveredElement) cChildren[i];
- switch (group.getEntryKind()) {
- case DiscoveredElement.PATHS_GROUP: {
- // get the include paths
- Object[] gChildren = group.getChildren();
- if (gChildren != null) {
- for (int j = 0; j < gChildren.length; ++j) {
- DiscoveredElement include = (DiscoveredElement) gChildren[j];
- includes.put(include.getEntry(), Boolean.valueOf(include.isRemoved()));
- }
- }
- }
- break;
- case DiscoveredElement.SYMBOLS_GROUP: {
- // get the symbol definitions
- Object[] gChildren = group.getChildren();
- if (gChildren != null) {
- for (int j = 0; j < gChildren.length; ++j) {
- DiscoveredElement symbol = (DiscoveredElement) gChildren[j];
- ScannerConfigUtil.scAddSymbolString2SymbolEntryMap(symbols, symbol.getEntry(), !symbol.isRemoved());
- }
- }
- }
- break;
- }
- }
- }
- }
- info.setIncludeMap(includes);
- info.setSymbolMap(symbols);
-
+ LinkedHashMap includes = new LinkedHashMap();
+ LinkedHashMap symbols = new LinkedHashMap();
+
+ DiscoveredElement container = (DiscoveredElement) fDiscoveredContainerList.getElement(0);
+ if (container != null && container.getEntryKind() == DiscoveredElement.CONTAINER) {
+ Object[] cChildren = container.getChildren();
+ if (cChildren != null) {
+ for (int i = 0; i < cChildren.length; ++i) {
+ DiscoveredElement group = (DiscoveredElement) cChildren[i];
+ switch (group.getEntryKind()) {
+ case DiscoveredElement.PATHS_GROUP: {
+ // get the include paths
+ Object[] gChildren = group.getChildren();
+ if (gChildren != null) {
+ for (int j = 0; j < gChildren.length; ++j) {
+ DiscoveredElement include = (DiscoveredElement) gChildren[j];
+ includes.put(include.getEntry(), Boolean.valueOf(include.isRemoved()));
+ }
+ }
+ }
+ break;
+ case DiscoveredElement.SYMBOLS_GROUP: {
+ // get the symbol definitions
+ Object[] gChildren = group.getChildren();
+ if (gChildren != null) {
+ for (int j = 0; j < gChildren.length; ++j) {
+ DiscoveredElement symbol = (DiscoveredElement) gChildren[j];
+ ScannerConfigUtil.scAddSymbolString2SymbolEntryMap(symbols, symbol.getEntry(), !symbol.isRemoved());
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ projetcPathInfo.setIncludeMap(includes);
+ projetcPathInfo.setSymbolMap(symbols);
+ }
+
try {
// update scanner configuration
MakeCorePlugin.getDefault().getDiscoveryManager().updateDiscoveredInfo(info, null);
@@ -249,40 +252,43 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
IDiscoveredPathInfo info;
DiscoveredElement container = null;
try {
+ container = DiscoveredElement.createNew(null, fCProject.getProject(), null,
+ DiscoveredElement.CONTAINER, false, false);
info = MakeCorePlugin.getDefault().
getDiscoveryManager().getDiscoveredInfo(fCProject.getProject());
- container = DiscoveredElement.createNew(null, fCProject.getProject(), null,
- DiscoveredElement.CONTAINER, false, false);
try {
IPathEntryContainer peContainer = CoreModel.getPathEntryContainer(pathEntry.getPath(), fCProject);
if (peContainer != null) {
container.setEntry(peContainer.getDescription());
}
- // get include paths
- LinkedHashMap paths = info.getIncludeMap();
- for (Iterator i = paths.keySet().iterator(); i.hasNext(); ) {
- String include = (String) i.next();
- Boolean removed = (Boolean) paths.get(include);
- removed = (removed == null) ? Boolean.FALSE : removed;
- DiscoveredElement.createNew(container, fCProject.getProject(), include,
- DiscoveredElement.INCLUDE_PATH, removed.booleanValue(), false);
- }
- // get defined symbols
- LinkedHashMap symbols = info.getSymbolMap();
- for (Iterator i = symbols.keySet().iterator(); i.hasNext(); ) {
- String symbol = (String) i.next();
- SymbolEntry se = (SymbolEntry) symbols.get(symbol);
- for (Iterator j = se.getActiveRaw().iterator(); j.hasNext();) {
- String value = (String) j.next();
- DiscoveredElement.createNew(container, fCProject.getProject(), value,
- DiscoveredElement.SYMBOL_DEFINITION, false, false);
- }
- for (Iterator j = se.getRemovedRaw().iterator(); j.hasNext();) {
- String value = (String) j.next();
- DiscoveredElement.createNew(container, fCProject.getProject(), value,
- DiscoveredElement.SYMBOL_DEFINITION, true, false);
- }
- }
+ if (info instanceof IPerProjectDiscoveredPathInfo) {
+ IPerProjectDiscoveredPathInfo projetcPathInfo = (IPerProjectDiscoveredPathInfo) info;
+ // get include paths
+ LinkedHashMap paths = projetcPathInfo.getIncludeMap();
+ for (Iterator i = paths.keySet().iterator(); i.hasNext(); ) {
+ String include = (String) i.next();
+ Boolean removed = (Boolean) paths.get(include);
+ removed = (removed == null) ? Boolean.FALSE : removed;
+ DiscoveredElement.createNew(container, fCProject.getProject(), include,
+ DiscoveredElement.INCLUDE_PATH, removed.booleanValue(), false);
+ }
+ // get defined symbols
+ LinkedHashMap symbols = projetcPathInfo.getSymbolMap();
+ for (Iterator i = symbols.keySet().iterator(); i.hasNext(); ) {
+ String symbol = (String) i.next();
+ SymbolEntry se = (SymbolEntry) symbols.get(symbol);
+ for (Iterator j = se.getActiveRaw().iterator(); j.hasNext();) {
+ String value = (String) j.next();
+ DiscoveredElement.createNew(container, fCProject.getProject(), value,
+ DiscoveredElement.SYMBOL_DEFINITION, false, false);
+ }
+ for (Iterator j = se.getRemovedRaw().iterator(); j.hasNext();) {
+ String value = (String) j.next();
+ DiscoveredElement.createNew(container, fCProject.getProject(), value,
+ DiscoveredElement.SYMBOL_DEFINITION, true, false);
+ }
+ }
+ }
} catch (CModelException e) {
MakeUIPlugin.log(e.getStatus());
}
@@ -569,7 +575,20 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
List selElements = fDiscoveredContainerList.getSelectedElements();
for (int i = 0; i < selElements.size(); ++i) {
DiscoveredElement elem = (DiscoveredElement) selElements.get(i);
- if (elem.getEntryKind() != DiscoveredElement.CONTAINER) {
+ if (elem.getEntryKind() == DiscoveredElement.CONTAINER) {
+ collectorUtil.deleteAll(project);
+ Object[] children = elem.getChildren();
+ for (int j = 0; j < children.length; j++) {
+ if (children[j] instanceof DiscoveredElement) {
+ DiscoveredElement child = (DiscoveredElement) children[j];
+ child.delete();
+ }
+ }
+ newSelection.add(elem);
+ rc = true;
+ break;
+ }
+ else {
DiscoveredElement parent = elem.getParent();
if (parent != null) {
Object[] children = parent.getChildren();
@@ -688,12 +707,6 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
if (selElements.size() == 0) {
return false;
}
- for (int i = 0; i < selElements.size(); i++) {
- DiscoveredElement elem = (DiscoveredElement) selElements.get(i);
- if (elem.getEntryKind() == DiscoveredElement.CONTAINER) {
- return false;
- }
- }
return true;
}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java
index 63af2db24cd..be65c13154d 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java
@@ -46,7 +46,6 @@ import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.help.WorkbenchHelp;
/**
* A dialog to set scanner config discovery options.
@@ -109,7 +108,7 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock {
composite.setFont(font);
setControl(composite);
- WorkbenchHelp.setHelp(getControl(), IMakeHelpContextIds.SCANNER_CONFIG_DISCOVERY_OPTIONS);
+ MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), IMakeHelpContextIds.SCANNER_CONFIG_DISCOVERY_OPTIONS);
// create a composite for general scanner config discovery options
Composite scComp = ControlFactory.createComposite(composite, 1);

Back to the top