Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Krasilnikov2007-02-26 13:29:12 +0000
committerOleg Krasilnikov2007-02-26 13:29:12 +0000
commit53988fe21051d241e6f073e4386255463745cad4 (patch)
tree1c6e2ca67982c1c83f64c9f27588ebbe98ee5273
parentdc3905bfb1d51b615364fb0fd6831377d8956604 (diff)
downloadorg.eclipse.cdt-53988fe21051d241e6f073e4386255463745cad4.tar.gz
org.eclipse.cdt-53988fe21051d241e6f073e4386255463745cad4.tar.xz
org.eclipse.cdt-53988fe21051d241e6f073e4386255463745cad4.zip
Bug fix: tab should not be displayed if no languages supported for element.
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java34
1 files changed, 19 insertions, 15 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java
index a4c5d7be8c9..c607dab71ef 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java
@@ -208,24 +208,26 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
public void updateData(ICResourceDescription cfg) {
if (cfg == null) return;
updateExport();
- ICLanguageSetting []ls = getLangSetting(cfg);
- Arrays.sort(ls, CDTListComparator.getInstance());
langTree.removeAll();
TreeItem firstItem = null;
- for (int i=0; i<ls.length; i++) {
- if ((ls[i].getSupportedEntryKinds() & getKind()) != 0) {
- TreeItem t = new TreeItem(langTree, SWT.NONE);
- t.setText(0, ls[i].getName());
- t.setData(ls[i]);
- if (firstItem == null) {
- firstItem = t;
- lang = ls[i];
+ ICLanguageSetting []ls = getLangSetting(cfg);
+ if (ls != null) {
+ Arrays.sort(ls, CDTListComparator.getInstance());
+ for (int i=0; i<ls.length; i++) {
+ if ((ls[i].getSupportedEntryKinds() & getKind()) != 0) {
+ TreeItem t = new TreeItem(langTree, SWT.NONE);
+ t.setText(0, ls[i].getName());
+ t.setData(ls[i]);
+ if (firstItem == null) {
+ firstItem = t;
+ lang = ls[i];
+ }
}
}
- }
-
- if (firstItem != null && table != null) {
- langTree.setSelection(firstItem);
+
+ if (firstItem != null && table != null) {
+ langTree.setSelection(firstItem);
+ }
}
update();
}
@@ -388,7 +390,8 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
return foDes.getLanguageSettings();
case ICSettingBase.SETTING_FILE:
ICFileDescription fiDes = (ICFileDescription)rcDes;
- return new ICLanguageSetting[] { fiDes.getLanguageSetting() };
+ ICLanguageSetting ls = fiDes.getLanguageSetting();
+ return (ls != null) ? new ICLanguageSetting[] { ls } : null;
}
return null;
}
@@ -396,6 +399,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
public boolean canBeVisible() {
if (getResDesc() == null) return true;
ICLanguageSetting [] ls = getLangSetting(getResDesc());
+ if (ls == null) return false;
for (int i=0; i<ls.length; i++) {
if ((ls[i].getSupportedEntryKinds() & getKind()) != 0)
return true;

Back to the top