Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331414

Summary: Sashform dont work
Product: [Eclipse Project] Platform Reporter: rafael merino garcia <rafamg13>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, rafamg13
Version: 3.5.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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