Bug 45811 [Dialogs] Problematic behavior of WorkbenchPreferenceDialog.setShellSize()
I20031023 MacOS X 10.3 - in Panther open Window > Preferences > Ant > Editor Observe: all hell breaks loose... I had to restart my machine and lost work! Two problems here: - a width of 12902 and a height of 16909 is passed to WorkbenchPreferenceDialog.setShellSize() (why this is the case needs further investigation) - however, JavaDoc of setShellSize states: "Changes the shell size to the given size, ensuring that it is no larger than the display bounds" the implementation is: private void setShellSize(int width, int height) { getShell().setSize(width, height); constrainShellSize(); } I think it doesn't make much sense to first set the Shell's size to a bogus value and then constrain its size to something sensible.
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Sash;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.DialogMessageArea;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.resource.JFaceColors;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.Assert;