mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +02:00
Bug fix: tab should not be displayed if no languages supported for element.
This commit is contained in:
parent
dc3905bfb1
commit
53988fe210
1 changed files with 19 additions and 15 deletions
|
@ -208,24 +208,26 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
public void updateData(ICResourceDescription cfg) {
|
public void updateData(ICResourceDescription cfg) {
|
||||||
if (cfg == null) return;
|
if (cfg == null) return;
|
||||||
updateExport();
|
updateExport();
|
||||||
ICLanguageSetting []ls = getLangSetting(cfg);
|
|
||||||
Arrays.sort(ls, CDTListComparator.getInstance());
|
|
||||||
langTree.removeAll();
|
langTree.removeAll();
|
||||||
TreeItem firstItem = null;
|
TreeItem firstItem = null;
|
||||||
for (int i=0; i<ls.length; i++) {
|
ICLanguageSetting []ls = getLangSetting(cfg);
|
||||||
if ((ls[i].getSupportedEntryKinds() & getKind()) != 0) {
|
if (ls != null) {
|
||||||
TreeItem t = new TreeItem(langTree, SWT.NONE);
|
Arrays.sort(ls, CDTListComparator.getInstance());
|
||||||
t.setText(0, ls[i].getName());
|
for (int i=0; i<ls.length; i++) {
|
||||||
t.setData(ls[i]);
|
if ((ls[i].getSupportedEntryKinds() & getKind()) != 0) {
|
||||||
if (firstItem == null) {
|
TreeItem t = new TreeItem(langTree, SWT.NONE);
|
||||||
firstItem = t;
|
t.setText(0, ls[i].getName());
|
||||||
lang = ls[i];
|
t.setData(ls[i]);
|
||||||
|
if (firstItem == null) {
|
||||||
|
firstItem = t;
|
||||||
|
lang = ls[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if (firstItem != null && table != null) {
|
||||||
if (firstItem != null && table != null) {
|
langTree.setSelection(firstItem);
|
||||||
langTree.setSelection(firstItem);
|
}
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@ -388,7 +390,8 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
return foDes.getLanguageSettings();
|
return foDes.getLanguageSettings();
|
||||||
case ICSettingBase.SETTING_FILE:
|
case ICSettingBase.SETTING_FILE:
|
||||||
ICFileDescription fiDes = (ICFileDescription)rcDes;
|
ICFileDescription fiDes = (ICFileDescription)rcDes;
|
||||||
return new ICLanguageSetting[] { fiDes.getLanguageSetting() };
|
ICLanguageSetting ls = fiDes.getLanguageSetting();
|
||||||
|
return (ls != null) ? new ICLanguageSetting[] { ls } : null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -396,6 +399,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
public boolean canBeVisible() {
|
public boolean canBeVisible() {
|
||||||
if (getResDesc() == null) return true;
|
if (getResDesc() == null) return true;
|
||||||
ICLanguageSetting [] ls = getLangSetting(getResDesc());
|
ICLanguageSetting [] ls = getLangSetting(getResDesc());
|
||||||
|
if (ls == null) return false;
|
||||||
for (int i=0; i<ls.length; i++) {
|
for (int i=0; i<ls.length; i++) {
|
||||||
if ((ls[i].getSupportedEntryKinds() & getKind()) != 0)
|
if ((ls[i].getSupportedEntryKinds() & getKind()) != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue