Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331414 - Sashform dont work
Summary: Sashform dont work
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-30 06:04 EST by rafael merino garcia CLA
Modified: 2010-11-30 12:46 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rafael merino garcia CLA 2010-11-30 06:04:55 EST
Sashform can't be dinamically resized.The same code work
 if I use only swt (not jface) 
--------------------------------------------------
package com.swtjface.Ch3;

import org.eclipse.swt.*;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.widgets.*;
//No funciona en windows xp
public class Ch3_SashForm extends Composite {
	public Ch3_SashForm(Composite parent) {
		super(parent, SWT.NONE);
		SashForm sf = new SashForm(this, SWT.VERTICAL);
		sf.setSize(120, 100);
		Button button1 = new Button(sf, SWT.ARROW | SWT.UP);
		button1.setSize(120, 40);
		Button button2 = new Button(sf, SWT.ARROW | SWT.DOWN);
		button2.setBounds(0, 45, 120, 40);
		
	}
}

package com.swtjface.Ch3;

import org.eclipse.jface.window.*;
import org.eclipse.swt.widgets.*;

public class CompViewer extends ApplicationWindow {
	public CompViewer() {
		super(null);
	}

	protected Control createContents(Composite parent) {
		new Ch3_SashForm(parent);
		return parent;
	}

	public static void main(String[] args) {
		CompViewer cv = new CompViewer();
		cv.setBlockOnOpen(true);
		cv.open();
		Display.getCurrent().dispose();
	}
}
Comment 1 Felipe Heidrich CLA 2010-11-30 10:06:51 EST
Bug in JFace ?
Comment 2 Paul Webster CLA 2010-11-30 12:46:24 EST
In your example you are returning a Composite (Ch3_SashForm) with no layout.  That'll pretty well kill resizing below that point.

Add a line after super(parent, SWT.NONE);
setLayout(new FillLayout());

PW