Bug 466793 - Override the preferred height of the tree view
Also removes some redundant GridData instances which are instantiated
but never used.
Signed-off-by: Stefan Xenos <sxenos@google.com>
Change-Id: I1dcfee419df16bf5a93c5130f34d3cb8c268b005
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
index ccb9df5..7bd58ed 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2013, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Teddy Walker <teddy.walker@googlemail.com>
* - Bug 188056 [Preferences] PreferencePages have to less indent in PreferenceDialog
+ * Stefan Xenos <sxenos@google.com> - Bug 466793
*******************************************************************************/
package org.eclipse.jface.preference;
@@ -30,6 +31,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.PageChangedEvent;
import org.eclipse.jface.dialogs.TrayDialog;
+import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.Policy;
@@ -369,13 +371,10 @@
createSash(composite,treeControl);
Label versep = new Label(composite, SWT.SEPARATOR | SWT.VERTICAL);
- GridData verGd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_VERTICAL);
-
- versep.setLayoutData(verGd);
- versep.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true));
+ GridDataFactory.fillDefaults().grab(false, true).applyTo(versep);
Composite pageAreaComposite = new Composite(composite, SWT.NONE);
- pageAreaComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(pageAreaComposite);
GridLayout layout = new GridLayout(1, true);
layout.marginHeight = 0;
layout.marginWidth = 0;
@@ -895,10 +894,8 @@
* @since 3.0
*/
protected void layoutTreeAreaControl(Control control) {
- GridData gd = new GridData(GridData.FILL_VERTICAL);
- gd.widthHint = getLastRightWidth();
- gd.verticalSpan = 1;
- control.setLayoutData(gd);
+ GridDataFactory.fillDefaults().hint(getLastRightWidth(), convertVerticalDLUsToPixels(120)).grab(false, true)
+ .applyTo(control);
}
/**
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
index d2f0b9d..5c0400d 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2014 IBM Corporation and others.
+ * Copyright (c) 2003, 2014, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Oakland Software (Francis Upton) <francisu@ieee.org> - bug 219273
* Lars Vogel <Lars.Vogel@gmail.com> - Bug 440810
+ * Stefan Xenos <sxenos@google.com> - Bug 466793
*******************************************************************************/
package org.eclipse.ui.internal.dialogs;
@@ -221,8 +222,6 @@
TreeViewer tree;
if (!hasAtMostOnePage()) {
filteredTree= new PreferenceFilteredTree(parent, styleBits, new PreferencePatternFilter());
- GridData gd= new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.horizontalIndent= IDialogConstants.HORIZONTAL_MARGIN;
filteredTree.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
tree= filteredTree.getViewer();