Skip to content

Commit 2fb271c

Browse files
committed
Service cut generator: adjust dialog for small resolutions (scrollable)
1 parent 6b35064 commit 2fb271c

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateNewServiceCutContextMapWizardPage.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636

3737
import org.contextmapper.dsl.ui.handler.wizard.pages.components.SCLFileChooser;
3838
import org.eclipse.core.resources.IFile;
39+
import org.eclipse.jface.layout.GridDataFactory;
40+
import org.eclipse.jface.layout.GridLayoutFactory;
3941
import org.eclipse.swt.SWT;
42+
import org.eclipse.swt.custom.ScrolledComposite;
4043
import org.eclipse.swt.events.SelectionAdapter;
4144
import org.eclipse.swt.events.SelectionEvent;
4245
import org.eclipse.swt.layout.GridData;
@@ -78,12 +81,25 @@ public String getDescription() {
7881

7982
@Override
8083
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+
8297
GridLayout layout = new GridLayout();
8398
layout.numColumns = 2;
8499
layout.verticalSpacing = 10;
85100
container.setLayout(layout);
86-
101+
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
102+
87103
// SCL file selection
88104
new Label(container, SWT.NONE).setText("User representations:");
89105
sclFileChooser = new SCLFileChooser(container);
@@ -156,7 +172,11 @@ public void widgetSelected(SelectionEvent e) {
156172
createCriteriaPrioritySelectionCombo(constraintsCriteriaGroup, PREDEFINED_SERVICE);
157173
createCriteriaPrioritySelectionCombo(constraintsCriteriaGroup, SECURITY_CONSTRAINT);
158174

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);
160180
setPageComplete(false);
161181
}
162182

0 commit comments

Comments
 (0)