mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-17 22:15:23 +02:00
bug 358832: Includes and Symbols tabs do not remember selected language
This commit is contained in:
parent
150793bfcc
commit
af1c5a901f
1 changed files with 7 additions and 6 deletions
|
@ -35,7 +35,6 @@ import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.graphics.Font;
|
import org.eclipse.swt.graphics.Font;
|
||||||
import org.eclipse.swt.graphics.Image;
|
import org.eclipse.swt.graphics.Image;
|
||||||
import org.eclipse.swt.graphics.Point;
|
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
@ -119,6 +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 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,6 +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 = lang.getLanguageId();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -372,7 +373,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
if (rcDes == null || !canBeVisible()) return;
|
if (rcDes == null || !canBeVisible()) return;
|
||||||
updateExport();
|
updateExport();
|
||||||
langTree.removeAll();
|
langTree.removeAll();
|
||||||
TreeItem firstItem = null;
|
TreeItem selectedItem = null;
|
||||||
ls = getLangSetting(rcDes);
|
ls = getLangSetting(rcDes);
|
||||||
if (ls != null) {
|
if (ls != null) {
|
||||||
Arrays.sort(ls, CDTListComparator.getInstance());
|
Arrays.sort(ls, CDTListComparator.getInstance());
|
||||||
|
@ -392,15 +393,15 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
langId = langSetting.getName();
|
langId = langSetting.getName();
|
||||||
t.setText(0, langId);
|
t.setText(0, langId);
|
||||||
t.setData(langSetting);
|
t.setData(langSetting);
|
||||||
if (firstItem == null) {
|
if (selectedItem == null || langSetting.getLanguageId().equals(selectedLanguageId)) {
|
||||||
firstItem = t;
|
selectedItem = t;
|
||||||
lang = langSetting;
|
lang = langSetting;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstItem != null && table != null) {
|
if (selectedItem != null && table != null) {
|
||||||
langTree.setSelection(firstItem);
|
langTree.setSelection(selectedItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
|
|
Loading…
Add table
Reference in a new issue