Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Section in Form Page is Collapsed(SWT)
Section in Form Page is Collapsed [message #758688] Thu, 24 November 2011 09:16 Go to next message
Vinod Kannur is currently offline Vinod KannurFriend
Messages: 7
Registered: October 2011
Junior Member

I have a created the Form view page using Eclipse Plug-gin with a view.I am trying to run a Form View Page, but Sections are collapsed on my first display.
I have set the property of Section as Expanded but its not getting reflected. If I again click on the section, it will expand and will display the contents.

Please find the code snippet for the Form View Page.

public class View extends ViewPart {
	private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
	private Text txtEemv;
public View() {
	public static final String ID = "example2.view";
	class ViewContentProvider implements IStructuredContentProvider {
		public void inputChanged(Viewer v, Object oldInput, Object newInput) {

		public void dispose() {

		public Object[] getElements(Object parent) {
			if (parent instanceof Object[]) {
				return (Object[]) parent;
	        return new Object[0];

	class ViewLabelProvider extends LabelProvider implements
			ITableLabelProvider {
		public String getColumnText(Object obj, int index) {
			return getText(obj);

		public getColumnImage(Object obj, int index) {
			return getImage(obj);

		public getImage(Object obj) {
			return PlatformUI.getWorkbench().getSharedImages().getImage(

	public void createPartControl(Composite parent) {
		TabFolder tabFolder = new TabFolder(parent, SWT.BOTTOM);
final ScrolledForm scrldfrmNewScrolledform = formToolkit.createScrolledForm(tabFolder);
Section sctnCatalogEntry = formToolkit.createSection(scrldfrmNewScrolledform.getBody(),Section.EXPANDED| Section.TWISTIE| Section.TITLE_BAR);
		sctnCatalogEntry.setBounds(10, 276, 365, 124);
		sctnCatalogEntry.setText("Catalog Entry");
		sctnCatalogEntry.setToolTipText("Catalog Information");
Composite composite_2 = new Composite(sctnCatalogEntry, SWT.Expand);
		org.eclipse.swt.widgets.Label lblNewLabel_3 = new org.eclipse.swt.widgets.Label(composite_2, SWT.NONE);
		lblNewLabel_3.setBounds(7, 10, 84, 15);
		formToolkit.adapt(lblNewLabel_3, true, true);
		lblNewLabel_3.setText("Item Title :");
		txtContractToCash_1 = new Text(composite_2, SWT.BORDER);
		txtContractToCash_1.setBounds(102, 7, 241, 21);
		txtContractToCash_1.setText("Contract to Cash");
		formToolkit.adapt(txtContractToCash_1, true, true);
public void setFocus() {
	public void dispose() {

Can you please let me know what could be reason and how can I render when I run for the first time?


Re: Section in Form Page is Collapsed [message #758720 is a reply to message #758688] Thu, 24 November 2011 11:43 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
I am curious to know ,why have you not used any layout in your application?

any way...
this code

should be after setting the text and bounds etc

Re: Section in Form Page is Collapsed [message #758741 is a reply to message #758720] Thu, 24 November 2011 12:55 Go to previous message
Vinod Kannur is currently offline Vinod KannurFriend
Messages: 7
Registered: October 2011
Junior Member
I have used Window Builder to design the Form View Page. Thanks a ton Vijay. It worked. Smile


[Updated on: Thu, 24 November 2011 12:56]

Report message to a moderator

Previous Topic:Linux Lotus Notes parent window unresponsive
Next Topic:modifying ImageData on server ( headless mode)
Goto Forum:

Current Time: Sun May 28 08:39:58 GMT 2017

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

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