### Eclipse Workspace Patch 1.0 #P org.eclipse.swt.examples Index: src/org/eclipse/swt/examples/controlexample/Tab.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java,v retrieving revision 1.83 diff -u -r1.83 Tab.java --- src/org/eclipse/swt/examples/controlexample/Tab.java 26 Feb 2010 20:14:58 -0000 1.83 +++ src/org/eclipse/swt/examples/controlexample/Tab.java 7 Apr 2010 17:44:56 -0000 @@ -899,6 +899,9 @@ * goes below the "Example" and "Control" groups. */ void createListenersGroup () { + /* Create a sash to separate the Listeners group from the "Example" and "Control" groups. */ + createSash (); + listenersGroup = new Group (tabFolderPage, SWT.NONE); listenersGroup.setLayout (new GridLayout (3, false)); listenersGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true, 2, 1)); @@ -964,6 +967,30 @@ }); } + void createSash() { + final Sash sash = new Sash(tabFolderPage, SWT.HORIZONTAL); + sash.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false, 2, 1)); + sash.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent event) { + if (event.detail == SWT.DRAG) return; + int change = event.y - sash.getBounds().y; + + /* Change the example group's height. */ + GridData data = (GridData) exampleGroup.getLayoutData(); + int height = data.heightHint; + if (height == SWT.DEFAULT) height = exampleGroup.getBounds().height; + height += change; + data.heightHint = height; + + /* Change the control group's height to match. */ + data = (GridData) controlGroup.getLayoutData(); + data.heightHint = height; + + tabFolderPage.layout(true); + } + }); + } + /** * Returns a list of set/get API method names (without the set/get prefix) * that can be used to set/get values in the example control(s).