|
36 | 36 |
|
37 | 37 | import org.contextmapper.dsl.ui.handler.wizard.pages.components.SCLFileChooser;
|
38 | 38 | import org.eclipse.core.resources.IFile;
|
| 39 | +import org.eclipse.jface.layout.GridDataFactory; |
| 40 | +import org.eclipse.jface.layout.GridLayoutFactory; |
39 | 41 | import org.eclipse.swt.SWT;
|
| 42 | +import org.eclipse.swt.custom.ScrolledComposite; |
40 | 43 | import org.eclipse.swt.events.SelectionAdapter;
|
41 | 44 | import org.eclipse.swt.events.SelectionEvent;
|
42 | 45 | import org.eclipse.swt.layout.GridData;
|
@@ -78,12 +81,25 @@ public String getDescription() {
|
78 | 81 |
|
79 | 82 | @Override
|
80 | 83 | public void createControl(Composite parent) {
|
81 |
| - container = new Composite(parent, SWT.NONE); |
| 84 | + Composite mainComposite = new Composite(parent, SWT.NONE); |
| 85 | + mainComposite.setLayout(GridLayoutFactory.fillDefaults().create()); |
| 86 | + |
| 87 | + ScrolledComposite scrollComp = new ScrolledComposite(mainComposite, SWT.V_SCROLL); |
| 88 | + scrollComp.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 500).create()); |
| 89 | + scrollComp.setLayout(new GridLayout(1,false)); |
| 90 | + scrollComp.setExpandHorizontal(true); |
| 91 | + scrollComp.setExpandVertical(true); |
| 92 | + scrollComp.setAlwaysShowScrollBars(true); |
| 93 | + |
| 94 | + container = new Composite(scrollComp, SWT.NONE); |
| 95 | + scrollComp.setContent(container); |
| 96 | + |
82 | 97 | GridLayout layout = new GridLayout();
|
83 | 98 | layout.numColumns = 2;
|
84 | 99 | layout.verticalSpacing = 10;
|
85 | 100 | container.setLayout(layout);
|
86 |
| - |
| 101 | + container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 102 | + |
87 | 103 | // SCL file selection
|
88 | 104 | new Label(container, SWT.NONE).setText("User representations:");
|
89 | 105 | sclFileChooser = new SCLFileChooser(container);
|
@@ -156,7 +172,11 @@ public void widgetSelected(SelectionEvent e) {
|
156 | 172 | createCriteriaPrioritySelectionCombo(constraintsCriteriaGroup, PREDEFINED_SERVICE);
|
157 | 173 | createCriteriaPrioritySelectionCombo(constraintsCriteriaGroup, SECURITY_CONSTRAINT);
|
158 | 174 |
|
159 |
| - setControl(container); |
| 175 | + container.setLayout(new GridLayout(1,false)); |
| 176 | + container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
| 177 | + scrollComp.setMinSize(container.computeSize(SWT.DEFAULT, SWT.DEFAULT)); |
| 178 | + |
| 179 | + setControl(mainComposite); |
160 | 180 | setPageComplete(false);
|
161 | 181 | }
|
162 | 182 |
|
|
0 commit comments