Omaha #5541 - Fix issues with hide/restore for dialogs during perspective switching.

Change-Id: I8bdca9c14bc4b6c950f398a9fb0a96eff6d6c378

Former-commit-id: 9bd669e8216ea8b169ea8e802c19b22010b1c187
This commit is contained in:
David Gillingham 2016-04-20 16:25:23 -05:00
parent df2e022ddb
commit c732313e20

View file

@ -36,6 +36,7 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 28, 2010 mschenke Initial creation
* Apr 20, 2016 5541 dgilling Fix issues with hide/restore and perspective switching.
*
* </pre>
*
@ -86,8 +87,14 @@ public class AbstractMPEDialog extends Dialog implements
@Override
public final void hide() {
if (shell != null && shell.isDisposed() == false) {
wasVisible = shell.isVisible();
hide(false);
}
@Override
public final void hide(boolean isPerspectiveSwitch) {
Shell shell = getShell();
if ((shell != null) && (!shell.isDisposed())) {
wasVisible = shell.isVisible() && isPerspectiveSwitch;
lastLocation = shell.getLocation();
shell.setVisible(false);
}
@ -95,10 +102,17 @@ public class AbstractMPEDialog extends Dialog implements
@Override
public final void restore() {
if (shell != null && shell.isDisposed() == false) {
shell.setVisible(wasVisible);
restore(false);
}
@Override
public final void restore(boolean isPerspectiveSwitch) {
Shell shell = getShell();
if ((shell != null) && (!shell.isDisposed())) {
if ((isPerspectiveSwitch && wasVisible) || (!isPerspectiveSwitch)) {
shell.setVisible(true);
shell.setLocation(lastLocation);
}
}
}
}