Issue #1229 Changes for non-blocking BackgroundColorDialog.
Change-Id: Ie3d72e33a33ebdd12fe0b66047fd211e049474d9 Former-commit-id:d60b4ca396
[formerly59a2dd6a3a
[formerly 23c93af437fa662cc7df98e69a8bd383aabbab41]] Former-commit-id:59a2dd6a3a
Former-commit-id:ac30143335
This commit is contained in:
parent
2a3905d036
commit
947b8762e8
3 changed files with 15 additions and 5 deletions
|
@ -27,6 +27,7 @@ import org.eclipse.swt.widgets.Display;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||||
import com.raytheon.viz.ui.color.IBackgroundColorChangedListener.BGColorMode;
|
import com.raytheon.viz.ui.color.IBackgroundColorChangedListener.BGColorMode;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,6 +39,7 @@ import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 1, 2009 mschenke Initial creation
|
* Sep 1, 2009 mschenke Initial creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Changes for non-blocking BackgroundColorDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -67,12 +69,18 @@ public class SetBackgroundColorAction extends AbstractRightClickAction {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
BackgroundColorDialog dialog = dialogMap.get(container);
|
BackgroundColorDialog dialog = dialogMap.get(container);
|
||||||
if (dialog == null) {
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
dialog = new BackgroundColorDialog(Display.getCurrent()
|
dialog = new BackgroundColorDialog(Display.getCurrent()
|
||||||
.getActiveShell(), container, mode);
|
.getActiveShell(), container, mode);
|
||||||
dialogMap.put(container, dialog);
|
dialogMap.put(container, dialog);
|
||||||
dialog.open();
|
dialog.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
dialogMap.remove(container);
|
dialogMap.remove(container);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
} else {
|
} else {
|
||||||
dialog.bringToTop();
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 7,2008 Dan Fitch Initial Creation
|
* Jan 7,2008 Dan Fitch Initial Creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Changed for non-blocking BackgroundColorDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -50,11 +51,10 @@ public class SetBackgroundColor extends AbstractHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
if (dialog == null) {
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
dialog = new BackgroundColorDialog(
|
dialog = new BackgroundColorDialog(
|
||||||
HandlerUtil.getActiveShell(event), null, BGColorMode.GLOBAL);
|
HandlerUtil.getActiveShell(event), null, BGColorMode.GLOBAL);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
dialog = null;
|
|
||||||
} else {
|
} else {
|
||||||
dialog.bringToTop();
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 1/8/2008 706 Dan Fitch Initial Creation.
|
* 1/8/2008 706 Dan Fitch Initial Creation.
|
||||||
|
* 10/16/2012 1229 rferrel Make dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -108,7 +109,8 @@ public class BackgroundColorDialog extends CaveSWTDialog implements
|
||||||
*/
|
*/
|
||||||
public BackgroundColorDialog(Shell parent, IDisplayPaneContainer container,
|
public BackgroundColorDialog(Shell parent, IDisplayPaneContainer container,
|
||||||
BGColorMode mode) {
|
BGColorMode mode) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.MIN, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM | SWT.MIN, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Set Background Color");
|
setText("Set Background Color");
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
|
|
Loading…
Add table
Reference in a new issue