Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to Make Main App Window Resized to Show All Widgets?
https://www.eclipse.org/forums/index.php/mv/msg/145705/458610/#msg_458610
I like to set my RCP application main window resized to show all the widgets after it is launched instead of hardcoded using IWorkbenchWindowConfigurer.setInitialSize(...) e.g. IWorkbenchWindowConfigurer.setInitialSize(new Point(445, 355));
Does RCP or SWT has APIs to allow me to something Swing's pack() method where JFrame.pack() will resized JFrame according to the components layout contains within?
Thanks
/lim/]]>TH Lim2006-11-23T09:24:58-00:00Re: How to Make Main App Window Resized to Show All Widgets?
https://www.eclipse.org/forums/index.php/mv/msg/145705/458630/#msg_458630
Alex Blewitt2006-11-23T12:37:01-00:00Re: How to Make Main App Window Resized to Show All Widgets?
https://www.eclipse.org/forums/index.php/mv/msg/145705/458645/#msg_458645
TH Lim2006-11-23T14:47:16-00:00Re: How to Make Main App Window Resized to Show All Widgets?
https://www.eclipse.org/forums/index.php/mv/msg/145705/458730/#msg_458730
The other approach in your advisor is to have a preWindowOpen() or postWindowOpen() do the work for each window. I'm not sure on the effect of a pack() prior to the shell being displayed, though.
Alex.]]>Alex Blewitt2006-11-23T16:37:44-00:00Re: How to Make Main App Window Resized to Show All Widgets?
https://www.eclipse.org/forums/index.php/mv/msg/145705/458772/#msg_458772
Thanks]]>TH Lim2006-11-24T10:43:29-00:00Re: How to Make Main App Window Resized to Show All Widgets?
https://www.eclipse.org/forums/index.php/mv/msg/145705/458775/#msg_458775
Most of the perspectives are specified by ratios (e.g. this takes up 1/3 of the width, or 1/2 of the height), so it's difficult to know how to get the sizes of individual elements or to be able to resize them appropriately.
You might want to have a look at LayoutPart (org.eclipse.ui.internal) and its subclasses (PartPane,ViewPane,EditorPane) since those have the sizes of the individual areas. They've also got a computePreferredSize as well as a getControl() which you might be able to do setSize on. But this is all internal stuff, and might not be a good way of doing it. Maybe the SWT newsgroup would be able to offer specific advice.
Alex.]]>Alex Blewitt2006-11-24T11:38:00-00:00Re: How to Make Main App Window Resized to Show All Widgets?
https://www.eclipse.org/forums/index.php/mv/msg/145705/458777/#msg_458777
https://bugs.eclipse.org/bugs/show_bug.cgi?id=51580
which discusses being able to resize views programmatically.
Alex.]]>Alex Blewitt2006-11-24T11:47:25-00:00Re: How to Make Main App Window Resized to Show All Widgets?
https://www.eclipse.org/forums/index.php/mv/msg/145705/458801/#msg_458801
Thanks for the tips, Alex. I will look at bug you have included in the thread.]]>TH Lim2006-11-24T16:42:51-00:00