/** * Constrain the shell size to be no larger than the display bounds. * * @since 2.0 */ protected void constrainShellSize() { // limit the shell size to the display size Rectangle bounds = shell.getBounds(); Rectangle constrained = getConstrainedShellBounds(bounds); if (!bounds.equals(constrained)) { shell.setBounds(constrained); } }
/** * Constrain the shell size to be no larger than the display bounds. * * @since 2.0 */ protected void constrainShellSize() { // limit the shell size to the display size Rectangle bounds = shell.getBounds(); Rectangle constrained = getConstrainedShellBounds(bounds); if (!bounds.equals(constrained)) { shell.setBounds(constrained); } }
/** * Constrain the shell size to be no larger than the display bounds. * * @since 1.0 */ protected void constrainShellSize() { // limit the shell size to the display size Rectangle bounds = shell.getBounds(); Rectangle constrained = getConstrainedShellBounds(bounds); if (!bounds.equals(constrained)) { shell.setBounds(constrained); } }
/** * Initializes the location and size of this window's SWT shell after it has * been created. * <p> * This framework method is called by the <code>create</code> framework * method. The default implementation calls <code>getInitialSize</code> * and <code>getInitialLocation</code> and passes the results to * <code>Shell.setBounds</code>. This is only done if the bounds of the * shell have not already been modified. Subclasses may extend or * reimplement. * </p> */ protected void initializeBounds() { if (resizeListener != null) { shell.removeListener(SWT.Resize, resizeListener); } if (resizeHasOccurred) { // Check if shell size has been set already. return; } Point size = getInitialSize(); Point location = getInitialLocation(size); shell.setBounds(getConstrainedShellBounds(new Rectangle(location.x, location.y, size.x, size.y))); }
/** * Initializes the location and size of this window's SWT shell after it has * been created. * <p> * This framework method is called by the <code>create</code> framework * method. The default implementation calls <code>getInitialSize</code> * and <code>getInitialLocation</code> and passes the results to * <code>Shell.setBounds</code>. This is only done if the bounds of the * shell have not already been modified. Subclasses may extend or * reimplement. * </p> */ protected void initializeBounds() { if (resizeListener != null) { shell.removeListener(SWT.Resize, resizeListener); } if (resizeHasOccurred) { // Check if shell size has been set already. return; } Point size = getInitialSize(); Point location = getInitialLocation(size); shell.setBounds(getConstrainedShellBounds(new Rectangle(location.x, location.y, size.x, size.y))); }
/** * Initializes the location and size of this window's SWT shell after it has * been created. * <p> * This framework method is called by the <code>create</code> framework * method. The default implementation calls <code>getInitialSize</code> * and <code>getInitialLocation</code> and passes the results to * <code>Shell.setBounds</code>. This is only done if the bounds of the * shell have not already been modified. Subclasses may extend or * reimplement. * </p> */ protected void initializeBounds() { if (resizeListener != null) { shell.removeListener(SWT.Resize, resizeListener); } if (resizeHasOccurred) { // Check if shell size has been set already. return; } Point size = getInitialSize(); Point location = getInitialLocation(size); shell.setBounds(getConstrainedShellBounds(new Rectangle(location.x, location.y, size.x, size.y))); }