Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-01-16 21:17:52 +0000
committerJeff Johnston2018-01-16 21:17:52 +0000
commitd822d7ce162297d3d4bf480ba11ce835529c1eae (patch)
tree32e39f31075c099b1dbe714bae0b86590b58c433
parentb222d730014ffe6433e479c0659b7cd18907706b (diff)
downloadorg.eclipse.cdt-d822d7ce162297d3d4bf480ba11ce835529c1eae.tar.gz
org.eclipse.cdt-d822d7ce162297d3d4bf480ba11ce835529c1eae.tar.xz
org.eclipse.cdt-d822d7ce162297d3d4bf480ba11ce835529c1eae.zip
Bug 529799 - problem with entries tree in LanguageSettingsEntriesTab
- fix provided by Christian Walther - fix createTreeForEntries() method to use addTreeListener() instead of addPaintListener() to handle resizing - in TreeListener, define treeExpanded method which uses pack method for entries column Change-Id: I28db2059d3e0561ce9e5e52f569409de9aff9a6d
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java
index a7c5be0c706..adf6d4d84da 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsEntriesTab.java
@@ -28,7 +28,6 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.layout.PixelConverter;
import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
@@ -39,8 +38,9 @@ import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.TreeAdapter;
+import org.eclipse.swt.events.TreeEvent;
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;
@@ -382,19 +382,18 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
treeEntries.setLinesVisible(true);
final TreeColumn treeCol = new TreeColumn(treeEntries, SWT.NONE);
- treeEntries.addPaintListener(new PaintListener() {
+ treeEntries.addTreeListener(new TreeAdapter() {
@Override
- public void paintControl(PaintEvent e) {
- Point p = treeEntries.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- if (treeCol.getWidth() != p.x)
- treeCol.setWidth(p.x);
+ public void treeExpanded(TreeEvent e) {
+ treeEntries.getDisplay().asyncExec(() -> {
+ treeCol.pack();
+ });
}
});
treeCol.setText(Messages.LanguageSettingsProviderTab_SettingEntries);
treeCol.setWidth(200);
- treeCol.setResizable(false);
treeCol.setToolTipText(Messages.LanguageSettingsProviderTab_SettingEntriesTooltip);
treeEntriesViewer = new TreeViewer(treeEntries);

Back to the top