Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to change row layout structure based on radio button in Eclipse SWT(How to change row layout structure based on radio button in Eclipse SWT)
How to change row layout structure based on radio button in Eclipse SWT [message #833648] Sat, 31 March 2012 16:51 Go to next message
Subhadeep Bose is currently offline Subhadeep Bose
Messages: 3
Registered: March 2012
Junior Member
I want to show two text boxes based on selection of a radio button using SWT Widget. However, when I will select another radio button, the previous textboxes should be hidden and a dropdown should be displayed. I am able to achieve the functionality using setVisibility(true) and false. The main problem here is that when the textboxes are not displayed, the space for them is getting consumed and the dropdown is coming below that based on selection of 2nd radio button . I don't want to waste that much space and want the layouts to overlap and consume a common space allotted to them since both can't be used at the same time.
Re: How to change row layout structure based on radio button in Eclipse SWT [message #834122 is a reply to message #833648] Sun, 01 April 2012 08:46 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph Keimel
Messages: 332
Registered: December 2010
Location: Germany
Senior Member
Place the text-input and the combobox on parent Composite using FillLayout.
Re: How to change row layout structure based on radio button in Eclipse SWT [message #836488 is a reply to message #833648] Wed, 04 April 2012 10:39 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
Here are a couple of example snippets to look at:

-
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet98.java
-
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet249.java

Grant


On 3/31/2012 4:51 PM, Subhadeep Bose wrote:
> I want to show two text boxes based on selection of a radio button using
> SWT Widget. However, when I will select another radio button, the
> previous textboxes should be hidden and a dropdown should be displayed.
> I am able to achieve the functionality using setVisibility(true) and
> false. The main problem here is that when the textboxes are not
> displayed, the space for them is getting consumed and the dropdown is
> coming below that based on selection of 2nd radio button . I don't want
> to waste that much space and want the layouts to overlap and consume a
> common space allotted to them since both can't be used at the same time.
Previous Topic:select collapsed item in TreeView
Next Topic:How to select all files of a particular type in the included jar using Eclipse SWT
Goto Forum:
  


Current Time: Mon Jul 28 22:44:23 EDT 2014

Powered by FUDForum. Page generated in 0.03112 seconds