X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.eclipse.ui%2Fsrc%2Forg%2Fargeo%2Feclipse%2Fui%2Fdialogs%2FLightweightDialog.java;h=d00365bf2c7e8ad1aa6547ffae2a326a6d8ecfd8;hb=c53fec78daddb69c489686844188036b04e1615a;hp=c34979e38f1bac0be065a3777bd08e271477e2b3;hpb=71196c25959b53964edf87aeb4387ed8b11b4868;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java index c34979e38..d00365bf2 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java @@ -18,6 +18,7 @@ import org.eclipse.swt.widgets.Display; 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); @@ -116,22 +117,26 @@ public class LightweightDialog { }); 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; @@ -214,6 +219,8 @@ public class LightweightDialog { if (!display.readAndDispatch()) { display.sleep(); } + } catch (UnsupportedOperationException e) { + throw e; } catch (Throwable e) { handleException(e); }