Issue #1287 Code changes for non-blocking SaveDeleteRefDialog.
Change-Id: I6bf23b8f3d9bac171f9a296e3d47b86851a3e1e0 Former-commit-id:c2def88db1
[formerlyc2def88db1
[formerly 085fc755257ed8728a293d59670a79f79293dcbb]] Former-commit-id:347ad433ef
Former-commit-id:56515fc4d6
This commit is contained in:
parent
823e1099e9
commit
f0867f4c40
2 changed files with 39 additions and 26 deletions
|
@ -91,6 +91,7 @@ import com.vividsolutions.jts.geom.MultiPolygon;
|
|||
* Mar 11, 2008 Eric Babin Initial Creation
|
||||
* 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>
|
||||
*
|
||||
|
@ -163,6 +164,10 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
|||
|
||||
private String[] initialGroups;
|
||||
|
||||
private SaveDeleteRefDialog deleteDlg;
|
||||
|
||||
private SaveDeleteRefDialog saveDlg;
|
||||
|
||||
public DefineRefSetDialog(Shell parent, DataManager dataManager) {
|
||||
super(parent);
|
||||
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
|
||||
|
@ -999,19 +1004,28 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
|
|||
|
||||
private void saveAreaCB() {
|
||||
|
||||
SaveDeleteRefDialog dialog = new SaveDeleteRefDialog(getShell(),
|
||||
this.refSetMgr, "Save");
|
||||
|
||||
dialog.open();
|
||||
|
||||
if (saveDlg == null || saveDlg.getShell() == null
|
||||
|| saveDlg.isDisposed()) {
|
||||
saveDlg = new SaveDeleteRefDialog(getShell(), this.refSetMgr,
|
||||
"Save");
|
||||
saveDlg.setBlockOnOpen(false);
|
||||
saveDlg.open();
|
||||
} else {
|
||||
saveDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteAreaCB() {
|
||||
|
||||
SaveDeleteRefDialog dialog = new SaveDeleteRefDialog(this.getShell(),
|
||||
refSetMgr, "Delete");
|
||||
dialog.open();
|
||||
|
||||
if (deleteDlg == null || deleteDlg.getShell() == null
|
||||
|| deleteDlg.isDisposed()) {
|
||||
deleteDlg = new SaveDeleteRefDialog(this.getShell(), refSetMgr,
|
||||
"Delete");
|
||||
deleteDlg.setBlockOnOpen(false);
|
||||
deleteDlg.open();
|
||||
} else {
|
||||
deleteDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
private void saveGroupCB() {
|
||||
|
|
|
@ -42,20 +42,18 @@ import org.eclipse.swt.widgets.Shell;
|
|||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
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.ReferenceID;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
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.ui.dialogs.CaveJFACEDialog;
|
||||
import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Dialog for performing a save or delete of an Edit Area.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -63,6 +61,7 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 10, 2010 randerso Initial creation
|
||||
* Oct 24, 2012 1287 rferrel Code clean up part of non-blocking dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -71,11 +70,12 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
|||
*/
|
||||
|
||||
public class SaveDeleteRefDialog extends CaveJFACEDialog {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SaveDeleteRefDialog.class);
|
||||
private static final Pattern pythonVariable = Pattern
|
||||
.compile("\\p{Alpha}\\w*");
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SaveDeleteRefDialog.class);
|
||||
|
||||
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;
|
||||
|
||||
|
@ -156,9 +156,9 @@ public class SaveDeleteRefDialog extends CaveJFACEDialog {
|
|||
editAreaList = new org.eclipse.swt.widgets.List(areaFrame, SWT.BORDER
|
||||
| SWT.V_SCROLL | SWT.SINGLE);
|
||||
|
||||
Rectangle rect = editAreaList.computeTrim(0, 0, this
|
||||
.convertWidthInCharsToPixels(24), editAreaList.getItemHeight()
|
||||
* NUM_ITEMS);
|
||||
Rectangle rect = editAreaList.computeTrim(0, 0,
|
||||
this.convertWidthInCharsToPixels(24),
|
||||
editAreaList.getItemHeight() * NUM_ITEMS);
|
||||
layoutData = new GridData(GridData.FILL_BOTH);
|
||||
layoutData.minimumWidth = rect.width;
|
||||
layoutData.heightHint = rect.height;
|
||||
|
@ -207,10 +207,9 @@ public class SaveDeleteRefDialog extends CaveJFACEDialog {
|
|||
|
||||
groupListBox = new ToggleSelectList(groupFrame, SWT.BORDER
|
||||
| SWT.V_SCROLL | SWT.MULTI);
|
||||
rect = groupListBox.computeTrim(0, 0, this
|
||||
.convertWidthInCharsToPixels(24), groupListBox
|
||||
.getItemHeight()
|
||||
* NUM_ITEMS);
|
||||
rect = groupListBox.computeTrim(0, 0,
|
||||
this.convertWidthInCharsToPixels(24),
|
||||
groupListBox.getItemHeight() * NUM_ITEMS);
|
||||
layoutData = new GridData(GridData.FILL_BOTH);
|
||||
layoutData.minimumWidth = rect.width;
|
||||
layoutData.heightHint = rect.height;
|
||||
|
@ -282,8 +281,8 @@ public class SaveDeleteRefDialog extends CaveJFACEDialog {
|
|||
// Check that name is a legal Python variable so
|
||||
// it can be used subsequently in queries
|
||||
if (!pythonVariable.matcher(name).matches()) {
|
||||
statusHandler.handle(
|
||||
Priority.SIGNIFICANT,
|
||||
statusHandler
|
||||
.handle(Priority.SIGNIFICANT,
|
||||
"Illegal Name: Must begin with a letter and be alphanumeric or '_'. Please rename.");
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue