Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 372222 - [SWING] LayoutManager do not take care of screen bounds when recalculating size of a form
Summary: [SWING] LayoutManager do not take care of screen bounds when recalculating si...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-22 08:13 EST by Jeremie Bresson CLA
Modified: 2021-08-19 11:26 EDT (History)
3 users (show)

See Also:
zimmermann: juno+


Attachments
Minimal Example for Bug 372222 (3.85 KB, application/octet-stream)
2012-02-22 08:49 EST, Jeremie Bresson CLA
no flags Details
Proposed solution to enable resizing customization (3.44 KB, patch)
2012-03-16 13:32 EDT, Ken Lee CLA
mvi: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremie Bresson CLA 2012-02-22 08:13:20 EST
Build Identifier: 

Consider a Form that is configured to be too big compared to the user screen.

When the form is opened:
The form is reduced to the size of the screen -> Very Good

When something triggers a recalculation of the form size (For example: setVisible() on a Button), the screen size is no longer considered.


Reproducible: Always
Comment 1 Jeremie Bresson CLA 2012-02-22 08:49:56 EST
Created attachment 211403 [details]
Minimal Example for Bug 372222

Example Form for this bug.

Open the form:
  BigForm f = new BigForm();
  f.startDisplay();

In the form, click on the AButton, the form is resized.
Comment 2 Ken Lee CLA 2012-03-16 12:21:48 EDT
The problem described is actually not a bug since all fields have to be displayed in the form by default, i.e. if a form has too many fields such that its size exceeds the size of the screen, the form will be displayed completely nevertheless.

To enable customization two new methods called createJDialogEx are added to the interface ISwingEnvironment. This allows classes to subtype JDialogEx which have a different resizing logic and return these subtypes in SwingEnviroment.
Comment 3 Ken Lee CLA 2012-03-16 13:29:23 EDT
Problem:
Automatic resizing of forms should be made customizable to enable overriding of the default behavior of forms exceeding the screen size. This could happen e.g. if many fields are added to the form.

Solution:
Introduced two new methods in ISwingEnvironment. Customization can be done by overriding these methods and returning subtypes of JDialogEx which implements a different resizing logic.

Migration: 
None if ISwingEnvironment is not implemented by any classes.
Otherwise use the implementation in AbstractSwingEnvironment if the default behavior is sufficient.

public JDialogEx createJDialogEx(Dialog swingParent) {
  return new JDialogEx(swingParent);
}

public JDialogEx createJDialogEx(Frame swingParent) {
  return new JDialogEx(swingParent);
}
Comment 4 Ken Lee CLA 2012-03-16 13:32:12 EDT
Created attachment 212797 [details]
Proposed solution to enable resizing customization
Comment 5 Matthias Villiger CLA 2012-03-16 13:37:40 EDT
patch applied for Juno.

Thank you Ken!
Comment 6 Jeremie Bresson CLA 2012-03-23 10:47:24 EDT
Related forum post:
http://www.eclipse.org/forums/index.php/mv/msg/315253/827571/#msg_827571
Comment 7 Matthias Zimmermann CLA 2012-07-09 06:50:58 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)