From 5b7fd51d7546a6abebf3da717af8e412ccf4d32f Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Wed, 3 Dec 2014 14:29:52 -0600 Subject: [PATCH] Omaha #3549 fix frozen time sizing Change-Id: I5f17f3bb840d689e8bdba1b52971287cf7279141 Former-commit-id: d26ba30c88235c3db891864432e810f3d715871d [formerly 5d4601f7c15323a9f926a325656843e5092e23bb] Former-commit-id: e78c319329888e19bc74487fbac9206507425420 --- .../dialogs/procedures/ProcedureListDlg.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/dialogs/procedures/ProcedureListDlg.java b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/dialogs/procedures/ProcedureListDlg.java index caa5de2bdf..ee5ab1ce57 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/dialogs/procedures/ProcedureListDlg.java +++ b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/dialogs/procedures/ProcedureListDlg.java @@ -74,6 +74,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * from magically appearing, removed dead code, * and other code clean up. * 03 Jul 2014 #3348 rferrel Handle Enter event. + * 03 Dec 2014 3549 njensen Fix spacing/sizing of buttonComp * * * @@ -135,14 +136,14 @@ public class ProcedureListDlg extends CaveSWTDialog { */ public static enum Mode { SAVE, OPEN, DELETE - }; + } /** * Enumeration to determine what procedures should be shown. */ public static enum ShowType { MINE, ALL_USERS, ALL - }; + } protected ShowType selectedShowType = ShowType.MINE; @@ -389,6 +390,7 @@ public class ProcedureListDlg extends CaveSWTDialog { enableControls(false); Job job = new Job("Populating procedures...") { + @Override protected org.eclipse.core.runtime.IStatus run( org.eclipse.core.runtime.IProgressMonitor monitor) { fileTree = populateDataList(); @@ -500,12 +502,11 @@ public class ProcedureListDlg extends CaveSWTDialog { private void createButtonComp(Composite mainComp) { // Add buttom comp Composite buttonComp = new Composite(mainComp, SWT.NONE); - buttonComp.setLayout(new RowLayout(SWT.VERTICAL)); + buttonComp.setLayout(new GridLayout(1, false)); GridData gd = new GridData(SWT.CENTER, SWT.FILL, false, false); - gd.widthHint = 100; buttonComp.setLayoutData(gd); - RowData rd = new RowData(80, SWT.DEFAULT); + GridData rd = new GridData(80, SWT.DEFAULT); okBtn = new Button(buttonComp, SWT.PUSH); okBtn.setText("Ok"); okBtn.setLayoutData(rd); @@ -517,7 +518,7 @@ public class ProcedureListDlg extends CaveSWTDialog { } }); - rd = new RowData(80, SWT.DEFAULT); + rd = new GridData(80, SWT.DEFAULT); cancelBtn = new Button(buttonComp, SWT.PUSH); cancelBtn.setText("Cancel"); cancelBtn.setLayoutData(rd); @@ -529,10 +530,8 @@ public class ProcedureListDlg extends CaveSWTDialog { }); if (mode == Mode.SAVE) { - rd = new RowData(100, SWT.DEFAULT); frozenChk = new Button(buttonComp, SWT.CHECK); frozenChk.setText("Freeze time"); - frozenChk.setLayoutData(rd); frozenChk.setSelection(frozen); frozenChk.addSelectionListener(new SelectionAdapter() { @Override @@ -645,7 +644,7 @@ public class ProcedureListDlg extends CaveSWTDialog { if (tmp != null) { // it must be a procedure tree, that is what the content // provider uses internally - LocalizationFile selectedFile = ((ProcedureTree) tmp).getFile(); + LocalizationFile selectedFile = tmp.getFile(); if (selectedFile == null) { displayOpenErrorDialog(); @@ -672,8 +671,7 @@ public class ProcedureListDlg extends CaveSWTDialog { if (tmp != null) { // it must be a procedure tree, that is what the content // provider uses internally - LocalizationFile selectedFile = ((ProcedureTree) tmp) - .getFile(); + LocalizationFile selectedFile = tmp.getFile(); setReturnValue(selectedFile); } close();