Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Dynamically Change Layout
Dynamically Change Layout [message #467348] Sun, 29 January 2006 20:57 Go to next message
Gene is currently offline GeneFriend
Messages: 1
Registered: July 2009
Junior Member
Hi all,

Any help is appreciated...
I am new to SWT and still trying to get oriented....
Currently I am writing an application using SWT and JFace and need some
guidance in the approach...
I am trying to solve the following problem for a couple days but
not successful.

Here is my problem:

A,B,C are composites in the following layout Composite A contains
Composite B and C using FormLayout for the layout management.
_____________________
| A |
|_______ _________|
|| | | ||
|| | | ||
|| B | | C ||
||______| |________||
---------------------

What I need to do is to
be able to dynamically either
1. Hide/Destroy C and have B take the entire space
2. Insert C back upon an event.

Is this approach possible because I have been trying to change the layout
of the composites by change or create FormData
update, pack, redraw, computeSize of the composites in all possible
combination that I can think of but still no success. :(

If this approach is not possible what would be the better widget for this?
If this approach is possible... please point me to place where I can find
some sample code I am all out of idea...


Thanks in advance
Gene
Re: Dynamically Change Layout [message #467353 is a reply to message #467348] Mon, 30 January 2006 08:29 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
Have a look at layout in all its variations. If you are using
FormToolkit you might need to call reflow (or the like)

Gene wrote:
> Hi all,
>
> Any help is appreciated...
> I am new to SWT and still trying to get oriented....
> Currently I am writing an application using SWT and JFace and need some
> guidance in the approach...
> I am trying to solve the following problem for a couple days but
> not successful.
>
> Here is my problem:
>
> A,B,C are composites in the following layout Composite A contains
> Composite B and C using FormLayout for the layout management.
> _____________________
> | A |
> |_______ _________|
> || | | ||
> || | | ||
> || B | | C ||
> ||______| |________||
> ---------------------
>
> What I need to do is to
> be able to dynamically either
> 1. Hide/Destroy C and have B take the entire space
> 2. Insert C back upon an event.
>
> Is this approach possible because I have been trying to change the layout
> of the composites by change or create FormData
> update, pack, redraw, computeSize of the composites in all possible
> combination that I can think of but still no success. :(
>
> If this approach is not possible what would be the better widget for this?
> If this approach is possible... please point me to place where I can
> find some sample code I am all out of idea...
>
>
> Thanks in advance
> Gene
>
>
Re: Dynamically Change Layout [message #467362 is a reply to message #467348] Mon, 30 January 2006 11:30 Go to previous messageGo to next message
Ricky is currently offline RickyFriend
Messages: 204
Registered: July 2009
Senior Member
I did something similar with a GridLayout. It is possible to set the field
exclude on a GridData object to true. This excludes the item from beeing
rendered but it is still around.

hth,

Ricky
Re: Dynamically Change Layout [message #467372 is a reply to message #467348] Mon, 30 January 2006 17:30 Go to previous message
Cory Horner is currently offline Cory HornerFriend
Messages: 4
Registered: July 2009
Junior Member
> Is this approach possible because I have been trying to change the layout
> of the composites by change or create FormData
> update, pack, redraw, computeSize of the composites in all possible
> combination that I can think of but still no success. :(

After spending hours 'debugging' such problems, i've often found that
calling layout() on the parent composite does the trick.

Cheers,
Cory.
Previous Topic:undo-redo dropdown list
Next Topic:thread of Program
Goto Forum:
  


Current Time: Sun Jul 21 21:15:30 GMT 2019

Powered by FUDForum. Page generated in 0.01742 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top