Merge "Issue #1287 Changes for non-blocking SaveDeleteEditAreaGroupDialog." into development

Former-commit-id: 4a6571efa6 [formerly 1ba83795cd] [formerly be67d7c72e [formerly 5e0e3cf640c1be96937562dd176226752e6b8bbc]]
Former-commit-id: be67d7c72e
Former-commit-id: b46d3ef692
This commit is contained in:
Lee Venable 2012-10-24 16:21:05 -05:00 committed by Gerrit Code Review
commit b2fa80a987
2 changed files with 32 additions and 17 deletions

View file

@ -92,6 +92,7 @@ import com.vividsolutions.jts.geom.MultiPolygon;
* 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 Code clean up for non-blocking dialog.
* Oct 24, 2012 1287 rferrel Changes for non-blocking SaveDeleteRefDialog. * Oct 24, 2012 1287 rferrel Changes for non-blocking SaveDeleteRefDialog.
* Oct 24, 2012 1287 rferrel Changes for non-blocking SaveDeleteEditAreaGroupDialog.
* *
* </pre> * </pre>
* *
@ -168,6 +169,10 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
private SaveDeleteRefDialog saveDlg; private SaveDeleteRefDialog saveDlg;
private SaveDeleteEditAreaGroupDialog deleteGroupDlg;
private SaveDeleteEditAreaGroupDialog saveGroupDlg;
public DefineRefSetDialog(Shell parent, DataManager dataManager) { public DefineRefSetDialog(Shell parent, DataManager dataManager) {
super(parent); super(parent);
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS); this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
@ -1029,18 +1034,28 @@ public class DefineRefSetDialog extends CaveJFACEDialog implements
} }
private void saveGroupCB() { private void saveGroupCB() {
SaveDeleteEditAreaGroupDialog dialog = new SaveDeleteEditAreaGroupDialog( if (deleteGroupDlg == null || deleteGroupDlg.getShell() == null
getShell(), this.refSetMgr, "Save"); || deleteGroupDlg.isDisposed()) {
dialog.setBlockOnOpen(true); deleteGroupDlg = new SaveDeleteEditAreaGroupDialog(getShell(),
dialog.open(); this.refSetMgr, "Save");
deleteGroupDlg.setBlockOnOpen(false);
deleteGroupDlg.open();
} else {
deleteGroupDlg.bringToTop();
}
} }
private void deleteGroupCB() { private void deleteGroupCB() {
SaveDeleteEditAreaGroupDialog dialog = new SaveDeleteEditAreaGroupDialog( if (saveGroupDlg == null || saveGroupDlg.getShell() == null
getShell(), this.refSetMgr, "Delete"); || saveGroupDlg.isDisposed()) {
dialog.setBlockOnOpen(true); saveGroupDlg = new SaveDeleteEditAreaGroupDialog(getShell(),
dialog.open(); this.refSetMgr, "Delete");
saveGroupDlg.setBlockOnOpen(false);
saveGroupDlg.open();
} else {
saveGroupDlg.bringToTop();
}
} }
private void addToQueryField(String s) { private void addToQueryField(String s) {

View file

@ -38,7 +38,6 @@ import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell; 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.StatusConstants;
import com.raytheon.uf.common.dataplugin.gfe.reference.GroupID; import com.raytheon.uf.common.dataplugin.gfe.reference.GroupID;
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceID; 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;
@ -46,20 +45,20 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
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.core.IReferenceSetManager; import com.raytheon.viz.gfe.core.IReferenceSetManager;
import com.raytheon.viz.gfe.ui.AccessMgr; import com.raytheon.viz.gfe.ui.AccessMgr;
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 ListTypeDialog.java Mar 11, 2008 * Dialog to perform a save or delete of an Edit Area Group.
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
* 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 Code clean part of non-blocking dialog.
* *
* </pre> * </pre>
* *
@ -68,7 +67,8 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
*/ */
public class SaveDeleteEditAreaGroupDialog extends CaveJFACEDialog { public class SaveDeleteEditAreaGroupDialog extends CaveJFACEDialog {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SaveDeleteEditAreaGroupDialog.class); private final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(SaveDeleteEditAreaGroupDialog.class);
private IReferenceSetManager refSetManager; private IReferenceSetManager refSetManager;
@ -160,8 +160,8 @@ public class SaveDeleteEditAreaGroupDialog extends CaveJFACEDialog {
groupList = new List(leftGroup, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL); groupList = new List(leftGroup, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
layoutData = new GridData(SWT.DEFAULT, SWT.FILL, false, true); layoutData = new GridData(SWT.DEFAULT, SWT.FILL, false, true);
groupList.setLayoutData(layoutData); groupList.setLayoutData(layoutData);
groupList.setItems(this.groupNames groupList
.toArray(new String[groupNames.size()])); .setItems(this.groupNames.toArray(new String[groupNames.size()]));
groupList.select(0); groupList.select(0);
groupList.deselectAll(); groupList.deselectAll();
groupList.addSelectionListener(new SelectionAdapter() { groupList.addSelectionListener(new SelectionAdapter() {
@ -271,7 +271,7 @@ public class SaveDeleteEditAreaGroupDialog extends CaveJFACEDialog {
String groupName = identifer.getText(); String groupName = identifer.getText();
String[] areas = areaListbox.getSelection(); String[] areas = areaListbox.getSelection();
statusHandler.handle(Priority.DEBUG, "Save Edit Area Group: " statusHandler.handle(Priority.DEBUG, "Save Edit Area Group: "
+ groupName + " sel:" + areas); + groupName + " sel:" + areas);
if (!groupName.isEmpty() && !groupName.equals("Misc") if (!groupName.isEmpty() && !groupName.equals("Misc")
&& !protectedGroupNames.contains(groupName)) { && !protectedGroupNames.contains(groupName)) {
@ -298,8 +298,8 @@ public class SaveDeleteEditAreaGroupDialog extends CaveJFACEDialog {
java.util.List<String> areas = refSetManager java.util.List<String> areas = refSetManager
.getGroupData(groupName); .getGroupData(groupName);
statusHandler.handle(Priority.DEBUG, statusHandler.handle(Priority.DEBUG, "Delete Edit Area Group: "
"Delete Edit Area Group: " + groupName); + groupName);
refSetManager.deleteGroup(groupName); refSetManager.deleteGroup(groupName);
// Delete areas within the group if desired // Delete areas within the group if desired