@Override
  public void setModalBlocked(Dialog blocker, boolean blocked) {
    synchronized (getPeerTreeLock()) {
      if (blocked && blocker.getPeer() instanceof LWWindowPeer) {
        this.blocker = (LWWindowPeer) blocker.getPeer();
      } else {
        this.blocker = null;
      }
    }

    platformWindow.setModalBlocked(blocked);
  }
 @SuppressWarnings("deprecation")
 public void setModalBlocked(Dialog dialog, boolean blocked) {
   synchronized (
       ((Component) getTarget()).getTreeLock()) // State lock should always be after awtLock
   {
     // use WWindowPeer instead of WDialogPeer because of FileDialogs and PrintDialogs
     WWindowPeer blockerPeer = (WWindowPeer) dialog.getPeer();
     if (blocked) {
       modalBlocker = blockerPeer;
       // handle native dialogs separately, as they may have not
       // got HWND yet; modalEnable/modalDisable is called from
       // their setHWnd() methods
       if (blockerPeer instanceof WFileDialogPeer) {
         ((WFileDialogPeer) blockerPeer).blockWindow(this);
       } else if (blockerPeer instanceof WPrintDialogPeer) {
         ((WPrintDialogPeer) blockerPeer).blockWindow(this);
       } else {
         modalDisable(dialog, blockerPeer.getHWnd());
       }
     } else {
       modalBlocker = null;
       if (blockerPeer instanceof WFileDialogPeer) {
         ((WFileDialogPeer) blockerPeer).unblockWindow(this);
       } else if (blockerPeer instanceof WPrintDialogPeer) {
         ((WPrintDialogPeer) blockerPeer).unblockWindow(this);
       } else {
         modalEnable(dialog);
       }
     }
   }
 }