Lines 44-50
Link Here
|
44 |
Button preferredButton, tooSmallButton, smallButton, largeButton, fillHButton, fillVButton; |
44 |
Button preferredButton, tooSmallButton, smallButton, largeButton, fillHButton, fillVButton; |
45 |
|
45 |
|
46 |
/* Common groups and composites */ |
46 |
/* Common groups and composites */ |
47 |
Composite tabFolderPage; |
47 |
Composite pageComposite; |
48 |
Group exampleGroup, controlGroup, listenersGroup, otherGroup, sizeGroup, styleGroup, colorGroup, backgroundModeGroup; |
48 |
Group exampleGroup, controlGroup, listenersGroup, otherGroup, sizeGroup, styleGroup, colorGroup, backgroundModeGroup; |
49 |
|
49 |
|
50 |
/* Controlling instance */ |
50 |
/* Controlling instance */ |
Lines 231-237
Link Here
|
231 |
* right half of each example tab. It consists of the |
231 |
* right half of each example tab. It consists of the |
232 |
* "Style" group, the "Other" group and the "Size" group. |
232 |
* "Style" group, the "Other" group and the "Size" group. |
233 |
*/ |
233 |
*/ |
234 |
controlGroup = new Group (tabFolderPage, SWT.NONE); |
234 |
controlGroup = new Group (pageComposite, SWT.NONE); |
235 |
controlGroup.setLayout (new GridLayout (2, true)); |
235 |
controlGroup.setLayout (new GridLayout (2, true)); |
236 |
controlGroup.setLayoutData (new GridData(SWT.FILL, SWT.FILL, false, false)); |
236 |
controlGroup.setLayoutData (new GridData(SWT.FILL, SWT.FILL, false, false)); |
237 |
controlGroup.setText (ControlExample.getResourceString("Parameters")); |
237 |
controlGroup.setText (ControlExample.getResourceString("Parameters")); |
Lines 762-768
Link Here
|
762 |
* is typically the left hand column in the tab. |
762 |
* is typically the left hand column in the tab. |
763 |
*/ |
763 |
*/ |
764 |
void createExampleGroup () { |
764 |
void createExampleGroup () { |
765 |
exampleGroup = new Group (tabFolderPage, SWT.NONE); |
765 |
exampleGroup = new Group (pageComposite, SWT.NONE); |
766 |
exampleGroup.setLayout (new GridLayout ()); |
766 |
exampleGroup.setLayout (new GridLayout ()); |
767 |
exampleGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true)); |
767 |
exampleGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true)); |
768 |
} |
768 |
} |
Lines 901-907
Link Here
|
901 |
* goes below the "Example" and "Control" groups. |
901 |
* goes below the "Example" and "Control" groups. |
902 |
*/ |
902 |
*/ |
903 |
void createListenersGroup () { |
903 |
void createListenersGroup () { |
904 |
listenersGroup = new Group (tabFolderPage, SWT.NONE); |
904 |
listenersGroup = new Group (pageComposite, SWT.NONE); |
905 |
listenersGroup.setLayout (new GridLayout (3, false)); |
905 |
listenersGroup.setLayout (new GridLayout (3, false)); |
906 |
listenersGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true, 2, 1)); |
906 |
listenersGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true, 2, 1)); |
907 |
listenersGroup.setText (ControlExample.getResourceString ("Listeners")); |
907 |
listenersGroup.setText (ControlExample.getResourceString ("Listeners")); |
Lines 1238-1267
Link Here
|
1238 |
* @param tabFolder org.eclipse.swt.widgets.TabFolder |
1238 |
* @param tabFolder org.eclipse.swt.widgets.TabFolder |
1239 |
* @return the new page for the tab folder |
1239 |
* @return the new page for the tab folder |
1240 |
*/ |
1240 |
*/ |
1241 |
Composite createTabFolderPage (TabFolder tabFolder) { |
1241 |
Composite createPageComposite(Composite parent) { |
1242 |
/* Cache the shell and display. */ |
1242 |
if (pageComposite == null) { |
1243 |
shell = tabFolder.getShell (); |
1243 |
/* Cache the shell and display. */ |
1244 |
display = shell.getDisplay (); |
1244 |
shell = parent.getShell (); |
1245 |
|
1245 |
display = shell.getDisplay (); |
1246 |
/* Create a two column page. */ |
1246 |
|
1247 |
tabFolderPage = new Composite (tabFolder, SWT.NONE); |
1247 |
/* Create a two column page. */ |
1248 |
tabFolderPage.setLayout (new GridLayout (2, false)); |
1248 |
pageComposite = new Composite (parent, SWT.NONE); |
1249 |
|
1249 |
pageComposite.setLayout (new GridLayout (2, false)); |
1250 |
/* Create the "Example" and "Control" groups. */ |
1250 |
|
1251 |
createExampleGroup (); |
1251 |
/* Create the "Example" and "Control" groups. */ |
1252 |
createControlGroup (); |
1252 |
createExampleGroup (); |
1253 |
|
1253 |
createControlGroup (); |
1254 |
/* Create the "Listeners" group under the "Control" group. */ |
1254 |
|
1255 |
createListenersGroup (); |
1255 |
/* Create the "Listeners" group under the "Control" group. */ |
1256 |
|
1256 |
createListenersGroup (); |
1257 |
/* Create and initialize the example and control widgets. */ |
1257 |
|
1258 |
createExampleWidgets (); |
1258 |
/* Create and initialize the example and control widgets. */ |
1259 |
hookExampleWidgetListeners (); |
1259 |
createExampleWidgets (); |
1260 |
createControlWidgets (); |
1260 |
hookExampleWidgetListeners (); |
1261 |
createBackgroundModeGroup (); |
1261 |
createControlWidgets (); |
1262 |
setExampleWidgetState (); |
1262 |
createBackgroundModeGroup (); |
|
|
1263 |
setExampleWidgetState (); |
1264 |
} |
1263 |
|
1265 |
|
1264 |
return tabFolderPage; |
1266 |
return pageComposite; |
1265 |
} |
1267 |
} |
1266 |
|
1268 |
|
1267 |
void setExampleWidgetPopupMenu() { |
1269 |
void setExampleWidgetPopupMenu() { |
Lines 1734-1740
Link Here
|
1734 |
gridData.verticalAlignment = fillVButton.getSelection() ? SWT.FILL : SWT.TOP; |
1736 |
gridData.verticalAlignment = fillVButton.getSelection() ? SWT.FILL : SWT.TOP; |
1735 |
controls [i].setLayoutData (gridData); |
1737 |
controls [i].setLayoutData (gridData); |
1736 |
} |
1738 |
} |
1737 |
tabFolderPage.layout (controls); |
1739 |
pageComposite.layout (controls); |
1738 |
} |
1740 |
} |
1739 |
|
1741 |
|
1740 |
/** |
1742 |
/** |
Lines 1806-1809
Link Here
|
1806 |
} |
1808 |
} |
1807 |
return result; |
1809 |
return result; |
1808 |
} |
1810 |
} |
|
|
1811 |
|
1812 |
/** |
1813 |
* This is called by the parent view when the tab is activated. |
1814 |
*/ |
1815 |
public void activated() { |
1816 |
// default implementation does nothing |
1817 |
} |
1809 |
} |
1818 |
} |