mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 359176: cosmetics, more descriptive names
This commit is contained in:
parent
210549ba61
commit
8382397625
1 changed files with 14 additions and 13 deletions
|
@ -118,7 +118,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final Comparator<Object> comp = CDTListComparator.getInstance();
|
private static final Comparator<Object> comp = CDTListComparator.getInstance();
|
||||||
private static String selectedLanguageId;
|
private static String selectedLanguage;
|
||||||
|
|
||||||
private final static Image IMG_FOLDER = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_FOLDER);
|
private final static Image IMG_FOLDER = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_FOLDER);
|
||||||
private final static Image IMG_INCLUDES_FOLDER = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_INCLUDES_FOLDER);
|
private final static Image IMG_INCLUDES_FOLDER = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_INCLUDES_FOLDER);
|
||||||
|
@ -291,7 +291,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
ICLanguageSetting langSetting = (ICLanguageSetting) items[0].getData();
|
ICLanguageSetting langSetting = (ICLanguageSetting) items[0].getData();
|
||||||
if (langSetting != null) {
|
if (langSetting != null) {
|
||||||
lang = langSetting;
|
lang = langSetting;
|
||||||
selectedLanguageId = getLanguageId(lang);
|
selectedLanguage = getLanguageName(lang);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,11 +380,11 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
for (ICLanguageSetting langSetting : ls) {
|
for (ICLanguageSetting langSetting : ls) {
|
||||||
if ((langSetting.getSupportedEntryKinds() & getKind()) != 0) {
|
if ((langSetting.getSupportedEntryKinds() & getKind()) != 0) {
|
||||||
TreeItem t = new TreeItem(langTree, SWT.NONE);
|
TreeItem t = new TreeItem(langTree, SWT.NONE);
|
||||||
String langId = getLanguageId(langSetting);
|
String langId = getLanguageName(langSetting);
|
||||||
t.setText(0, langId);
|
t.setText(0, langId);
|
||||||
t.setData(langSetting);
|
t.setData(langSetting);
|
||||||
if (selectedItem == null
|
if (selectedItem == null
|
||||||
|| (selectedLanguageId != null && selectedLanguageId.equals(langId))) {
|
|| (selectedLanguage != null && selectedLanguage.equals(langId))) {
|
||||||
selectedItem = t;
|
selectedItem = t;
|
||||||
lang = langSetting;
|
lang = langSetting;
|
||||||
}
|
}
|
||||||
|
@ -398,19 +398,20 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getLanguageId(ICLanguageSetting langSetting) {
|
private String getLanguageName(ICLanguageSetting langSetting) {
|
||||||
String langId = langSetting.getLanguageId();
|
String langId = langSetting.getLanguageId();
|
||||||
if (langId != null && !langId.equals(EMPTY_STR)) {
|
String langName = null;
|
||||||
|
if (langId != null && !langId.isEmpty()) {
|
||||||
// Bug #178033: get language name via LangManager.
|
// Bug #178033: get language name via LangManager.
|
||||||
ILanguageDescriptor langDes = LanguageManager.getInstance().getLanguageDescriptor(langId);
|
ILanguageDescriptor langDes = LanguageManager.getInstance().getLanguageDescriptor(langId);
|
||||||
if (langDes == null)
|
if (langDes != null)
|
||||||
langId = null;
|
langName = langDes.getName();
|
||||||
else
|
|
||||||
langId = langDes.getName();
|
|
||||||
}
|
}
|
||||||
if (langId == null || langId.equals(EMPTY_STR))
|
if (langName == null || langName.isEmpty())
|
||||||
langId = langSetting.getName();
|
langName = langSetting.getName();
|
||||||
return langId;
|
if (langName == null || langName.isEmpty())
|
||||||
|
langName = langId;
|
||||||
|
return langName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateExport() {
|
private void updateExport() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue