Merge branch 'development' of ssh://lightning.omaha.us.ray.com:29418/AWIPS2_baseline into development

Former-commit-id: 4f96a60d66 [formerly 4f96a60d66 [formerly 3dbff4250960727aca52be2cd6f047592ea9fc5d]]
Former-commit-id: 765124eb11
Former-commit-id: 92dbb44f69
This commit is contained in:
Steve Harris 2012-10-24 15:16:14 -05:00
commit 1ca27ce012
11 changed files with 141 additions and 89 deletions

View file

@ -47,6 +47,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 2009-12-02 vkorolev Initial creation. * 2009-12-02 vkorolev Initial creation.
* 2010-01-21 4268 vkorolev Fixed Trend Plot * 2010-01-21 4268 vkorolev Fixed Trend Plot
* 2012-10-15 1229 vkorolev Changes for non-blocking TrendPlotDlg
* </pre> * </pre>
* *
* @author vkorolev * @author vkorolev
@ -65,9 +66,12 @@ public class TrendPlotDlg extends CaveSWTDialog {
public Date curdate; public Date curdate;
public String var;
public TrendPlotDlg(Shell parent, String selectedZone, String station, public TrendPlotDlg(Shell parent, String selectedZone, String station,
ArrayList<String> product, String dataName) { ArrayList<String> product, String dataName) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE); super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK
| CAVE.INDEPENDENT_SHELL);
setText(getTrendPlotName(product) + " Trend Plot for " + station + "#" setText(getTrendPlotName(product) + " Trend Plot for " + station + "#"
+ dataName); + dataName);
@ -89,13 +93,13 @@ public class TrendPlotDlg extends CaveSWTDialog {
@Override @Override
protected void initializeComponents(Shell shell) { protected void initializeComponents(Shell shell) {
setReturnValue(false); setReturnValue(product);
// Initialize all layouts // Initialize all layouts
Iterator<String> prodVar = product.iterator(); Iterator<String> prodVar = product.iterator();
while (prodVar.hasNext()) { while (prodVar.hasNext()) {
String varname = prodVar.next(); String var = prodVar.next();
new TrendPlotCanvas(shell, selectedZone, station, varname, new TrendPlotCanvas(shell, selectedZone, station, var, dataName,
dataName, obData); obData);
} }
addCloseBtn(); addCloseBtn();
} }

View file

@ -29,13 +29,14 @@ import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.dialogs.BreakLockDialog; import com.raytheon.viz.gfe.dialogs.BreakLockDialog;
/** /**
* TODO Add Description ShowBreakLock.java Jun 17, 2008 * Action class to bring up the break locck dialog.
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jun 17, 2008 Eric Babin Initial Creation * Jun 17, 2008 Eric Babin Initial Creation
* Oct 27, 2012 1287 rferrel Changes for non-blocking BreakLockDialog.
* *
* </pre> * </pre>
* *
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.BreakLockDialog;
*/ */
public class ShowBreakLock extends AbstractHandler { public class ShowBreakLock extends AbstractHandler {
private BreakLockDialog dialog;
/* /*
* (non-Javadoc) * (non-Javadoc)
@ -59,12 +61,16 @@ public class ShowBreakLock extends AbstractHandler {
return null; return null;
} }
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
.getShell(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
BreakLockDialog dialog = new BreakLockDialog(shell, dm); dialog = new BreakLockDialog(shell, dm);
dialog.setBlockOnOpen(true); dialog.setBlockOnOpen(false);
dialog.open(); dialog.open();
} else {
dialog.bringToTop();
}
return null; return null;
} }

View file

@ -38,6 +38,7 @@ import com.raytheon.viz.gfe.dialogs.CopyGridsDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 27, 2008 Eric Babin Initial Creation * Feb 27, 2008 Eric Babin Initial Creation
* Oct 23, 2012 1287 rferrel Changes for non-blocking CopyGridsDialog.
* *
* </pre> * </pre>
* *
@ -47,9 +48,16 @@ import com.raytheon.viz.gfe.dialogs.CopyGridsDialog;
public class ShowCopyGridsDialog extends AbstractHandler { public class ShowCopyGridsDialog extends AbstractHandler {
private static IUFStatusHandler statusHandler = UFStatus private IUFStatusHandler statusHandler = UFStatus
.getHandler(ShowCopyGridsDialog.class); .getHandler(ShowCopyGridsDialog.class);
/**
* The active dialog. This assumes the dialog is modal. If the dialog is not
* modal then the current logic will bring the active dialog back to the top
* no matter which option is selected.
*/
private CopyGridsDialog dialog;
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -64,27 +72,32 @@ public class ShowCopyGridsDialog extends AbstractHandler {
return null; return null;
} }
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
.getShell(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
boolean isSelected; boolean isSelected;
String selectedOrAll = event.getParameter("selectedOrAll"); String selectedOrAll = event.getParameter("selectedOrAll");
if ("selected".equalsIgnoreCase(selectedOrAll)) { if ("selected".equalsIgnoreCase(selectedOrAll)) {
isSelected = true; isSelected = true;
} else if ("all".equalsIgnoreCase(selectedOrAll)) { } else if ("all".equalsIgnoreCase(selectedOrAll)) {
isSelected = false; isSelected = false;
} else {
statusHandler
.error("Invalid parmeter \""
+ selectedOrAll
+ "\" in ShowCopyGridsDialog. Value must be \"selected\" or \"all\".");
dialog = null;
return null;
}
dialog = new CopyGridsDialog(shell, dm, isSelected);
dialog.setBlockOnOpen(false);
dialog.open();
} else { } else {
statusHandler dialog.bringToTop();
.error("Invalid parmeter \""
+ selectedOrAll
+ "\" in ShowCopyGridsDialog. Value must be \"selected\" or \"all\".");
return null;
} }
CopyGridsDialog dialog = new CopyGridsDialog(shell, dm, isSelected);
dialog.setBlockOnOpen(true);
dialog.open();
return null; return null;
} }

View file

@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 27, 2008 Eric Babin Initial Creation * Feb 27, 2008 Eric Babin Initial Creation
* 04/18/08 #857 bphillip Implemented interaction with server * 04/18/08 #857 bphillip Implemented interaction with server
* Oct 24, 2012 #1287 rferrel Changes for non-blocking CreateFromScratchDialog.
* *
* </pre> * </pre>
* *
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
*/ */
public class ShowCreateFromScratchDialog extends AbstractHandler { public class ShowCreateFromScratchDialog extends AbstractHandler {
private CreateFromScratchDialog dialog;
/* /*
* (non-Javadoc) * (non-Javadoc)
@ -54,12 +56,16 @@ public class ShowCreateFromScratchDialog extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
.getShell(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
CreateFromScratchDialog dialog = new CreateFromScratchDialog(shell); dialog = new CreateFromScratchDialog(shell);
dialog.setBlockOnOpen(true); dialog.setBlockOnOpen(false);
dialog.open(); dialog.open();
} else {
dialog.bringToTop();
}
return null; return null;
} }

View file

@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.DefineRefSetDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 11, 2008 Eric Babin Initial Creation * Mar 11, 2008 Eric Babin Initial Creation
* Oct 24, 2012 1287 rferrel Changes for non-blocking DefineRefSetDialog.
* *
* </pre> * </pre>
* *
@ -63,11 +64,13 @@ public class ShowDefineRefSetDialog extends AbstractHandler {
return null; return null;
} }
if (dialog == null || dialog.getShell() == null) { if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
dialog = new DefineRefSetDialog(shell, dm); dialog = new DefineRefSetDialog(shell, dm);
dialog.setBlockOnOpen(false); dialog.setBlockOnOpen(false);
dialog.open();
} else {
dialog.bringToTop();
} }
dialog.open();
return null; return null;
} }

View file

@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.DefineSamplesViaLatLongDialog;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 15, 2008 Eric Babin Initial Creation * Feb 15, 2008 Eric Babin Initial Creation
* Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager. * Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager.
* Oct 24, 2012 1287 rferrel Changes for non-blocking DefineSamplesViaLatLongDialog.
* *
* </pre> * </pre>
* *
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.DefineSamplesViaLatLongDialog;
*/ */
public class ShowDefineSamplesLatLongAction extends AbstractHandler { public class ShowDefineSamplesLatLongAction extends AbstractHandler {
private DefineSamplesViaLatLongDialog dialog;
/* /*
* (non-Javadoc) * (non-Javadoc)
@ -54,13 +56,16 @@ public class ShowDefineSamplesLatLongAction extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
.getShell(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
DefineSamplesViaLatLongDialog dialog = new DefineSamplesViaLatLongDialog( dialog = new DefineSamplesViaLatLongDialog(shell);
shell); dialog.setBlockOnOpen(false);
dialog.setBlockOnOpen(true); dialog.open();
dialog.open(); } else {
dialog.bringToTop();
}
return null; return null;
} }

View file

@ -46,6 +46,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 26, 2008 Eric Babin Initial Creation * Feb 26, 2008 Eric Babin Initial Creation
* Oct 23, 2012 1287 rferrel Made dialog modal like AWIPS 1.
* *
* </pre> * </pre>
* *
@ -70,7 +71,7 @@ public class CopyGridsDialog extends CaveJFACEDialog {
super(parent); super(parent);
this.dataManager = dataManager; this.dataManager = dataManager;
this.parmMgr = dataManager.getParmManager(); this.parmMgr = dataManager.getParmManager();
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE); this.setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
this.isSelected = isSelectedType; this.isSelected = isSelectedType;
} }

View file

@ -46,6 +46,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 26, 2008 Eric Babin Initial Creation * Feb 26, 2008 Eric Babin Initial Creation
* Oct 24, 2012 1287 rferrel Changes for non-blocking dialog.
* *
* </pre> * </pre>
* *
@ -75,7 +76,7 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
public CreateFromScratchDialog(Shell parent) { public CreateFromScratchDialog(Shell parent) {
super(parent); super(parent);
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE); this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
} }
@ -130,8 +131,8 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
intervalLabel = new Label(top, SWT.NONE); intervalLabel = new Label(top, SWT.NONE);
data = new GridData(30, SWT.DEFAULT); data = new GridData(30, SWT.DEFAULT);
intervalLabel.setLayoutData(data); intervalLabel.setLayoutData(data);
intervalLabel.setText(Integer intervalLabel
.toString(intervalScale.getSelection())); .setText(Integer.toString(intervalScale.getSelection()));
} }
@ -157,8 +158,8 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
durationLabel = new Label(top, SWT.NONE); durationLabel = new Label(top, SWT.NONE);
data = new GridData(30, SWT.DEFAULT); data = new GridData(30, SWT.DEFAULT);
durationLabel.setLayoutData(data); durationLabel.setLayoutData(data);
durationLabel.setText(Integer durationLabel
.toString(durationScale.getSelection())); .setText(Integer.toString(durationScale.getSelection()));
} }
} }
@ -167,8 +168,8 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
if (displayDuration) { if (displayDuration) {
durationScale.setSelection(intervalScale.getSelection()); durationScale.setSelection(intervalScale.getSelection());
durationLabel.setText(Integer durationLabel
.toString(durationScale.getSelection())); .setText(Integer.toString(durationScale.getSelection()));
} }
} }
@ -272,7 +273,9 @@ public class CreateFromScratchDialog extends CaveJFACEDialog {
createDuration = durationScale.getSelection(); createDuration = durationScale.getSelection();
} }
DataManager.getCurrentInstance().getParmOp() DataManager
.getCurrentInstance()
.getParmOp()
.createFromScratchSelected(mode, createInterval * 3600, .createFromScratchSelected(mode, createInterval * 3600,
createDuration * 3600); createDuration * 3600);

View file

@ -90,6 +90,8 @@ import com.vividsolutions.jts.geom.MultiPolygon;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 11, 2008 Eric Babin Initial Creation * Mar 11, 2008 Eric Babin Initial Creation
* Jul 15, 2008 njensen Hooked into backend/fixes * Jul 15, 2008 njensen Hooked into backend/fixes
* Oct 24, 2012 1287 rferrel Code clean up for non-blocking dialog.
* Oct 24, 2012 1287 rferrel Changes for non-blocking SaveDeleteRefDialog.
* *
* </pre> * </pre>
* *
@ -101,18 +103,18 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
IReferenceSetChangedListener, IReferenceSetIDChangedListener, IReferenceSetChangedListener, IReferenceSetIDChangedListener,
IReferenceSetInvChangedListener, IDisplayedParmListChangedListener, IReferenceSetInvChangedListener, IDisplayedParmListChangedListener,
IEditAreaGroupInvChangedListener { IEditAreaGroupInvChangedListener {
private static final transient IUFStatusHandler statusHandler = UFStatus private final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(DefineRefSetDialog.class); .getHandler(DefineRefSetDialog.class);
private static final int NUM_ITEMS = 13; private final int NUM_ITEMS = 13;
private static final int CLEAR_QUERY_ID = IDialogConstants.CLIENT_ID + 1; private final int CLEAR_QUERY_ID = IDialogConstants.CLIENT_ID + 1;
private static final int RECALL_QUERY_ID = IDialogConstants.CLIENT_ID + 2; private final int RECALL_QUERY_ID = IDialogConstants.CLIENT_ID + 2;
private static final int UNDO_EDIT_AREA_ID = IDialogConstants.CLIENT_ID + 3; private final int UNDO_EDIT_AREA_ID = IDialogConstants.CLIENT_ID + 3;
private static final int CONVERT_TO_LOCATION_ID = IDialogConstants.CLIENT_ID + 4; private final int CONVERT_TO_LOCATION_ID = IDialogConstants.CLIENT_ID + 4;
private Composite top; private Composite top;
@ -154,10 +156,6 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
{ "3", "" }, { "-", "" }, { "0", "" }, { ".", "" }, { "3", "" }, { "-", "" }, { "0", "" }, { ".", "" },
{ "BS", "BackSpace" }, { "", "" }, { "SP", "Space" }, }; { "BS", "BackSpace" }, { "", "" }, { "SP", "Space" }, };
// private java.util.List<String> gList;
// private HashMap<String, java.util.List<String>> editAreaMap;
private IReferenceSetManager refSetMgr; private IReferenceSetManager refSetMgr;
private IParmManager parmManager; private IParmManager parmManager;
@ -166,9 +164,13 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
private String[] initialGroups; private String[] initialGroups;
private SaveDeleteRefDialog deleteDlg;
private SaveDeleteRefDialog saveDlg;
public DefineRefSetDialog(Shell parent, DataManager dataManager) { public DefineRefSetDialog(Shell parent, DataManager dataManager) {
super(parent); super(parent);
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE); this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
this.dataManager = dataManager; this.dataManager = dataManager;
this.refSetMgr = this.dataManager.getRefManager(); this.refSetMgr = this.dataManager.getRefManager();
this.parmManager = this.dataManager.getParmManager(); this.parmManager = this.dataManager.getParmManager();
@ -1002,19 +1004,28 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
private void saveAreaCB() { private void saveAreaCB() {
SaveDeleteRefDialog dialog = new SaveDeleteRefDialog(getShell(), if (saveDlg == null || saveDlg.getShell() == null
this.refSetMgr, "Save"); || saveDlg.isDisposed()) {
saveDlg = new SaveDeleteRefDialog(getShell(), this.refSetMgr,
dialog.open(); "Save");
saveDlg.setBlockOnOpen(false);
saveDlg.open();
} else {
saveDlg.bringToTop();
}
} }
private void deleteAreaCB() { private void deleteAreaCB() {
SaveDeleteRefDialog dialog = new SaveDeleteRefDialog(this.getShell(), if (deleteDlg == null || deleteDlg.getShell() == null
refSetMgr, "Delete"); || deleteDlg.isDisposed()) {
dialog.open(); deleteDlg = new SaveDeleteRefDialog(this.getShell(), refSetMgr,
"Delete");
deleteDlg.setBlockOnOpen(false);
deleteDlg.open();
} else {
deleteDlg.bringToTop();
}
} }
private void saveGroupCB() { private void saveGroupCB() {

View file

@ -43,6 +43,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 15, 2008 Eric Babin Initial Creation * Feb 15, 2008 Eric Babin Initial Creation
* 04/10/2009 #1290 rjpeter Moved field validation to when ok pressed. * 04/10/2009 #1290 rjpeter Moved field validation to when ok pressed.
* Oct 24, 2012 #1287 rferrel Change shell style.
* </pre> * </pre>
* *
* @author ebabin * @author ebabin
@ -61,7 +62,7 @@ public class DefineSamplesViaLatLongDialog extends CaveJFACEDialog {
public DefineSamplesViaLatLongDialog(Shell parent) { public DefineSamplesViaLatLongDialog(Shell parent) {
super(parent); super(parent);
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE); this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
} }
@Override @Override

View file

@ -42,20 +42,18 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData; import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData;
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceID;
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData.RefType; import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData.RefType;
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceID;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.constants.StatusConstants;
import com.raytheon.viz.gfe.core.IReferenceSetManager; import com.raytheon.viz.gfe.core.IReferenceSetManager;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
import com.raytheon.viz.ui.widgets.ToggleSelectList; import com.raytheon.viz.ui.widgets.ToggleSelectList;
/** /**
* TODO Add Description * Dialog for performing a save or delete of an Edit Area.
* *
* <pre> * <pre>
* *
@ -63,6 +61,7 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Sep 10, 2010 randerso Initial creation * Sep 10, 2010 randerso Initial creation
* Oct 24, 2012 1287 rferrel Code clean up part of non-blocking dialog.
* *
* </pre> * </pre>
* *
@ -71,11 +70,12 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
*/ */
public class SaveDeleteRefDialog extends CaveJFACEDialog { public class SaveDeleteRefDialog extends CaveJFACEDialog {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SaveDeleteRefDialog.class); private final transient IUFStatusHandler statusHandler = UFStatus
private static final Pattern pythonVariable = Pattern .getHandler(SaveDeleteRefDialog.class);
.compile("\\p{Alpha}\\w*");
private static final int NUM_ITEMS = 10; private final Pattern pythonVariable = Pattern.compile("\\p{Alpha}\\w*");
private final int NUM_ITEMS = 10;
private IReferenceSetManager refSetMgr; private IReferenceSetManager refSetMgr;
@ -156,9 +156,9 @@ public class SaveDeleteRefDialog extends CaveJFACEDialog {
editAreaList = new org.eclipse.swt.widgets.List(areaFrame, SWT.BORDER editAreaList = new org.eclipse.swt.widgets.List(areaFrame, SWT.BORDER
| SWT.V_SCROLL | SWT.SINGLE); | SWT.V_SCROLL | SWT.SINGLE);
Rectangle rect = editAreaList.computeTrim(0, 0, this Rectangle rect = editAreaList.computeTrim(0, 0,
.convertWidthInCharsToPixels(24), editAreaList.getItemHeight() this.convertWidthInCharsToPixels(24),
* NUM_ITEMS); editAreaList.getItemHeight() * NUM_ITEMS);
layoutData = new GridData(GridData.FILL_BOTH); layoutData = new GridData(GridData.FILL_BOTH);
layoutData.minimumWidth = rect.width; layoutData.minimumWidth = rect.width;
layoutData.heightHint = rect.height; layoutData.heightHint = rect.height;
@ -207,10 +207,9 @@ public class SaveDeleteRefDialog extends CaveJFACEDialog {
groupListBox = new ToggleSelectList(groupFrame, SWT.BORDER groupListBox = new ToggleSelectList(groupFrame, SWT.BORDER
| SWT.V_SCROLL | SWT.MULTI); | SWT.V_SCROLL | SWT.MULTI);
rect = groupListBox.computeTrim(0, 0, this rect = groupListBox.computeTrim(0, 0,
.convertWidthInCharsToPixels(24), groupListBox this.convertWidthInCharsToPixels(24),
.getItemHeight() groupListBox.getItemHeight() * NUM_ITEMS);
* NUM_ITEMS);
layoutData = new GridData(GridData.FILL_BOTH); layoutData = new GridData(GridData.FILL_BOTH);
layoutData.minimumWidth = rect.width; layoutData.minimumWidth = rect.width;
layoutData.heightHint = rect.height; layoutData.heightHint = rect.height;
@ -282,8 +281,8 @@ public class SaveDeleteRefDialog extends CaveJFACEDialog {
// Check that name is a legal Python variable so // Check that name is a legal Python variable so
// it can be used subsequently in queries // it can be used subsequently in queries
if (!pythonVariable.matcher(name).matches()) { if (!pythonVariable.matcher(name).matches()) {
statusHandler.handle( statusHandler
Priority.SIGNIFICANT, .handle(Priority.SIGNIFICANT,
"Illegal Name: Must begin with a letter and be alphanumeric or '_'. Please rename."); "Illegal Name: Must begin with a letter and be alphanumeric or '_'. Please rename.");
return false; return false;
} }