import org.eclipse.swt.widgets.Shell;
/** Generic lightweight dialog, not based on JFace. */
+@Deprecated
public class LightweightDialog {
private final static Log log = LogFactory.getLog(LightweightDialog.class);
});
if (block) {
- try {
- runEventLoop(foregoundShell);
- } catch (ThreadDeath t) {
- returnCode = CANCEL;
- if (log.isTraceEnabled())
- log.error("Thread death, canceling dialog", t);
- } catch (Throwable t) {
- returnCode = CANCEL;
- log.error("Cannot open blocking lightweight dialog", t);
- }
+ block();
}
if (returnCode == null)
returnCode = OK;
return returnCode;
}
+ public void block() {
+ try {
+ runEventLoop(foregoundShell);
+ } catch (ThreadDeath t) {
+ returnCode = CANCEL;
+ if (log.isTraceEnabled())
+ log.error("Thread death, canceling dialog", t);
+ } catch (Throwable t) {
+ returnCode = CANCEL;
+ log.error("Cannot open blocking lightweight dialog", t);
+ }
+ }
+
private boolean hasChildShells() {
if (foregoundShell == null)
return false;
if (!display.readAndDispatch()) {
display.sleep();
}
+ } catch (UnsupportedOperationException e) {
+ throw e;
} catch (Throwable e) {
handleException(e);
}