Lines 899-904
Link Here
|
899 |
* goes below the "Example" and "Control" groups. |
899 |
* goes below the "Example" and "Control" groups. |
900 |
*/ |
900 |
*/ |
901 |
void createListenersGroup () { |
901 |
void createListenersGroup () { |
|
|
902 |
/* Create a sash to separate the Listeners group from the "Example" and "Control" groups. */ |
903 |
createSash (); |
904 |
|
902 |
listenersGroup = new Group (tabFolderPage, SWT.NONE); |
905 |
listenersGroup = new Group (tabFolderPage, SWT.NONE); |
903 |
listenersGroup.setLayout (new GridLayout (3, false)); |
906 |
listenersGroup.setLayout (new GridLayout (3, false)); |
904 |
listenersGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true, 2, 1)); |
907 |
listenersGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true, 2, 1)); |
Lines 964-969
Link Here
|
964 |
}); |
967 |
}); |
965 |
} |
968 |
} |
966 |
|
969 |
|
|
|
970 |
void createSash() { |
971 |
final Sash sash = new Sash(tabFolderPage, SWT.HORIZONTAL); |
972 |
sash.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false, 2, 1)); |
973 |
sash.addSelectionListener(new SelectionAdapter() { |
974 |
public void widgetSelected(SelectionEvent event) { |
975 |
if (event.detail == SWT.DRAG) return; |
976 |
int change = event.y - sash.getBounds().y; |
977 |
|
978 |
/* Change the example group's height. */ |
979 |
GridData data = (GridData) exampleGroup.getLayoutData(); |
980 |
int height = data.heightHint; |
981 |
if (height == SWT.DEFAULT) height = exampleGroup.getBounds().height; |
982 |
height += change; |
983 |
data.heightHint = height; |
984 |
|
985 |
/* Change the control group's height to match. */ |
986 |
data = (GridData) controlGroup.getLayoutData(); |
987 |
data.heightHint = height; |
988 |
|
989 |
tabFolderPage.layout(true); |
990 |
} |
991 |
}); |
992 |
} |
993 |
|
967 |
/** |
994 |
/** |
968 |
* Returns a list of set/get API method names (without the set/get prefix) |
995 |
* Returns a list of set/get API method names (without the set/get prefix) |
969 |
* that can be used to set/get values in the example control(s). |
996 |
* that can be used to set/get values in the example control(s). |