1 11 package org.eclipse.ui.internal.dialogs; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 import org.eclipse.core.runtime.IStatus; 15 import org.eclipse.jface.dialogs.IDialogBlockedHandler; 16 import org.eclipse.swt.widgets.Shell; 17 import org.eclipse.ui.internal.progress.BlockedJobsDialog; 18 19 23 public class WorkbenchDialogBlockedHandler implements IDialogBlockedHandler { 24 IProgressMonitor outerMonitor; 25 26 int nestingDepth = 0; 27 28 31 public WorkbenchDialogBlockedHandler() { 32 } 34 35 40 public void clearBlocked() { 41 if (nestingDepth == 0) { 42 return; 43 } 44 45 nestingDepth--; 46 47 if (nestingDepth <= 0) { 48 BlockedJobsDialog.clear(outerMonitor); 49 outerMonitor = null; 50 nestingDepth = 0; 51 } 52 53 } 54 55 62 public void showBlocked(Shell parentShell, 63 IProgressMonitor blockingMonitor, IStatus blockingStatus, 64 String blockedName) { 65 66 nestingDepth++; 67 if (outerMonitor == null) { 68 outerMonitor = blockingMonitor; 69 if (blockedName == null && parentShell != null) { 71 blockedName = parentShell.getText(); 72 } 73 BlockedJobsDialog.createBlockedDialog(parentShell, blockingMonitor, 74 blockingStatus, blockedName); 75 } 76 77 } 78 79 85 public void showBlocked(IProgressMonitor blocking, IStatus blockingStatus, 86 String blockedName) { 87 showBlocked(null, blocking, blockingStatus, blockedName); 88 } 89 } 90 | Popular Tags |