summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Ostroukhov2011-09-27 08:29:24 (EDT)
committer Andrew Gvozdev2011-09-27 08:29:24 (EDT)
commit8bfbc64c7e4c6503a219aadd67821328a1cba9d5 (patch)
tree5667cf18eb77f10baa4deb804d72048b2909019e
parentf73fa36c10642a5b4eddc2de6fb524a9c458d29d (diff)
downloadorg.eclipse.cdt-8bfbc64c7e4c6503a219aadd67821328a1cba9d5.zip
org.eclipse.cdt-8bfbc64c7e4c6503a219aadd67821328a1cba9d5.tar.gz
org.eclipse.cdt-8bfbc64c7e4c6503a219aadd67821328a1cba9d5.tar.bz2
bug 358832: Includes and Symbols tabs do not remember selected language
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java13
1 files changed, 7 insertions, 6 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 7528b6f..354891f 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
@@ -35,7 +35,6 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
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 String selectedLanguageId;
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);
@@ -291,6 +291,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
ICLanguageSetting langSetting = (ICLanguageSetting) items[0].getData();
if (langSetting != null) {
lang = langSetting;
+ selectedLanguageId = lang.getLanguageId();
update();
}
}
@@ -372,7 +373,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
if (rcDes == null || !canBeVisible()) return;
updateExport();
langTree.removeAll();
- TreeItem firstItem = null;
+ TreeItem selectedItem = null;
ls = getLangSetting(rcDes);
if (ls != null) {
Arrays.sort(ls, CDTListComparator.getInstance());
@@ -392,15 +393,15 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
langId = langSetting.getName();
t.setText(0, langId);
t.setData(langSetting);
- if (firstItem == null) {
- firstItem = t;
+ if (selectedItem == null || langSetting.getLanguageId().equals(selectedLanguageId)) {
+ selectedItem = t;
lang = langSetting;
}
}
}
- if (firstItem != null && table != null) {
- langTree.setSelection(firstItem);
+ if (selectedItem != null && table != null) {
+ langTree.setSelection(selectedItem);
}
}
update();