Merge "Issue #2291 - Fixed resizing of components." into omaha_14.2.1

Former-commit-id: b3928f4f49 [formerly 277513c8d810a3996d93fd04a5691eb730c78630]
Former-commit-id: dd12515ca2
This commit is contained in:
Lee Venable 2014-01-20 17:32:38 -06:00 committed by Gerrit Code Review
commit 4e121d1261

View file

@ -22,6 +22,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 7, 2013 skorolev Initial creation * Nov 7, 2013 skorolev Initial creation
* Jan 20, 2013 #2291 lvenable Fixed resizing of components.
* *
* </pre> * </pre>
* *
@ -41,23 +42,26 @@ public class TextMessageDlg extends CaveSWTDialog {
@Override @Override
protected void initializeComponents(Shell shell) { protected void initializeComponents(Shell shell) {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, false, false); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
GridLayout gl = new GridLayout(1, false); GridLayout gl = new GridLayout(1, false);
Composite mainComp = new Composite(shell, SWT.NONE); Composite mainComp = new Composite(shell, SWT.NONE);
mainComp.setLayout(gl); mainComp.setLayout(gl);
mainComp.setLayoutData(gd); mainComp.setLayoutData(gd);
gd = new GridData(); gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.widthHint = 350; gd.widthHint = 400;
gd.heightHint = 350; gd.heightHint = 350;
StyledText text = new StyledText(mainComp, SWT.MULTI | SWT.WRAP StyledText text = new StyledText(mainComp, SWT.MULTI | SWT.WRAP
| SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
text.setLayoutData(gd); text.setLayoutData(gd);
text.setText(messageText); text.setText(messageText);
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.widthHint = 60;
Button okBtn = new Button(mainComp, SWT.PUSH); Button okBtn = new Button(mainComp, SWT.PUSH);
okBtn.setText("OK"); okBtn.setText("OK");
okBtn.setLayoutData(new GridData(SWT.CENTER, SWT.DEFAULT, true, true)); okBtn.setLayoutData(gd);
okBtn.setLayoutData(gd);
okBtn.addSelectionListener(new SelectionAdapter() { okBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -65,5 +69,4 @@ public class TextMessageDlg extends CaveSWTDialog {
} }
}); });
} }
} }