Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Krasilnikov2007-11-26 16:35:18 +0000
committerOleg Krasilnikov2007-11-26 16:35:18 +0000
commitfb52bde67230bc23f222f58abe96e5227faaf242 (patch)
treef13038fc33e9e54f89e71dd227c7ecb6259dd6b6
parent203fcf2d73c0e25e1290cb7b9d91e1ddd5e631a0 (diff)
downloadorg.eclipse.cdt-fb52bde67230bc23f222f58abe96e5227faaf242.tar.gz
org.eclipse.cdt-fb52bde67230bc23f222f58abe96e5227faaf242.tar.xz
org.eclipse.cdt-fb52bde67230bc23f222f58abe96e5227faaf242.zip
Bug #210835 : NPE in Preferences "Binary Parsers"
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java31
1 files changed, 27 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java
index 0e801986688..6965ee573d0 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/BinaryParsTab.java
@@ -38,6 +38,7 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CoreModelUtil;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.core.settings.model.ICTargetPlatformSetting;
import org.eclipse.cdt.ui.CUIPlugin;
@@ -71,6 +72,8 @@ public class BinaryParsTab extends AbstractCPropertyTab {
protected Table table;
protected CheckboxTableViewer tv;
protected Composite parserGroup;
+
+ private ICTargetPlatformSetting tps;
// private ICTargetPlatformSetting tps;
@@ -169,7 +172,19 @@ public class BinaryParsTab extends AbstractCPropertyTab {
}
public void updateData(ICResourceDescription cfgd) {
- String[] ids = CoreModelUtil.getBinaryParserIds(page.getCfgsEditable());
+ String[] ids = null;
+ if (page.isForPrefs()) { // prefs
+ if (cfgd != null && cfgd.getConfiguration() != null) {
+ tps = cfgd.getConfiguration().getTargetPlatformSetting();
+ if (tps != null)
+ ids = tps.getBinaryParserIds();
+ }
+ if (ids == null)
+ ids = new String[0]; // no selection
+ } else { // project
+ ICConfigurationDescription[] cfgs = page.getCfgsEditable();
+ ids = CoreModelUtil.getBinaryParserIds(cfgs);
+ }
Object[] data = new Object[configMap.size()];
HashMap clone = new HashMap(configMap);
// add checked elements
@@ -294,8 +309,12 @@ public class BinaryParsTab extends AbstractCPropertyTab {
}
}
- protected void performDefaults() {
- CoreModelUtil.setBinaryParserIds(page.getCfgsEditable(), null);
+ protected void performDefaults() {
+ if (page.isForProject())
+ CoreModelUtil.setBinaryParserIds(page.getCfgsEditable(), null);
+ else
+ if (tps != null)
+ tps.setBinaryParserIds(null);
informPages(false);
updateData(getResDesc());
}
@@ -357,7 +376,11 @@ public class BinaryParsTab extends AbstractCPropertyTab {
ids[i] = ((BinaryParserConfiguration)objs[i]).getID();
}
}
- CoreModelUtil.setBinaryParserIds(page.getCfgsEditable(), ids);
+ if (page.isForPrefs()) {
+ if (tps != null) tps.setBinaryParserIds(ids);
+ } else {
+ CoreModelUtil.setBinaryParserIds(page.getCfgsEditable(), ids);
+ }
}
// This page can be displayed for project only
public boolean canBeVisible() {

Back to the top