Issue #1287 Changes for non-blocking but modal DisplayAttributesDialog.

Change-Id: I57df579cd29ffa2bb54589bf5862121857abedb0

Former-commit-id: 04053afeb7 [formerly 8152c49231] [formerly b0c5e6472b [formerly 4dca1f343e38090c21e27f0470cc68042c22c811]]
Former-commit-id: b0c5e6472b
Former-commit-id: 8ac665a0ca
This commit is contained in:
Roger Ferrel 2012-10-22 15:34:21 -05:00
parent d7fe430a7e
commit f96c5a1e28
2 changed files with 18 additions and 8 deletions

View file

@ -27,7 +27,7 @@ import com.raytheon.viz.gfe.rsc.GFEResource;
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction; import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
/** /**
* TODO Add Description * Action to bring up the Dispaly attributes dialog.
* *
* <pre> * <pre>
* *
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jan 13, 2009 mschenke Initial creation * Jan 13, 2009 mschenke Initial creation
* Oct 22, 2012 1287 rferrel Changes for non-blocking DisplayAttributesDialog.
* *
* </pre> * </pre>
* *
@ -46,6 +47,8 @@ public class DisplayAttributesAction extends AbstractRightClickAction {
private GFEResource rsc; private GFEResource rsc;
private DisplayAttributesDialog dialog;
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -53,14 +56,18 @@ public class DisplayAttributesAction extends AbstractRightClickAction {
*/ */
@Override @Override
public void run() { public void run() {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
.getShell(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
rsc = ((GFEResource) this.getSelectedRsc()); rsc = ((GFEResource) this.getSelectedRsc());
DisplayAttributesDialog dad = new DisplayAttributesDialog(shell, rsc); dialog = new DisplayAttributesDialog(shell, rsc);
dad.setBlockOnOpen(true); dialog.setBlockOnOpen(false);
dad.open(); dialog.open();
} else {
dialog.bringToTop();
}
} }
/* /*

View file

@ -51,6 +51,8 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jun 11, 2008 Eric Babin Initial Creation * Jun 11, 2008 Eric Babin Initial Creation
* Oct 22, 2012 1287 rferrel Make dialog application modal
* and non-blocking.
* *
* </pre> * </pre>
* *
@ -84,7 +86,7 @@ public class DisplayAttributesDialog extends CaveJFACEDialog {
public DisplayAttributesDialog(Shell parent, GFEResource rsc) { public DisplayAttributesDialog(Shell parent, GFEResource rsc) {
super(parent); super(parent);
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE); this.setShellStyle(SWT.TITLE | SWT.APPLICATION_MODAL | SWT.CLOSE);
this.parm = rsc.getParm(); this.parm = rsc.getParm();
@ -100,6 +102,7 @@ public class DisplayAttributesDialog extends CaveJFACEDialog {
startImageTypes = null; startImageTypes = null;
startGraphicTypes = null; startGraphicTypes = null;
setBlockOnOpen(false);
} }
@Override @Override