projects
/
lgpl
/
argeo-commons.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve UX
[lgpl/argeo-commons.git]
/
swt
/
org.argeo.cms.swt
/
src
/
org
/
argeo
/
cms
/
swt
/
dialogs
/
LightweightDialog.java
diff --git
a/swt/org.argeo.cms.swt/src/org/argeo/cms/swt/dialogs/LightweightDialog.java
b/swt/org.argeo.cms.swt/src/org/argeo/cms/swt/dialogs/LightweightDialog.java
index d74be6aa20c59c3ba4348c56f680f438a3514987..3aec22a14eb791843c912c11057acb810081dacc 100644
(file)
--- a/
swt/org.argeo.cms.swt/src/org/argeo/cms/swt/dialogs/LightweightDialog.java
+++ b/
swt/org.argeo.cms.swt/src/org/argeo/cms/swt/dialogs/LightweightDialog.java
@@
-1,6
+1,7
@@
package org.argeo.cms.swt.dialogs;
import org.argeo.api.cms.CmsLog;
package org.argeo.cms.swt.dialogs;
import org.argeo.api.cms.CmsLog;
+import org.argeo.cms.ux.widgets.CmsDialog;
import org.argeo.eclipse.ui.EclipseUiException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
import org.argeo.eclipse.ui.EclipseUiException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
@@
-20,11
+21,6
@@
import org.eclipse.swt.widgets.Shell;
public class LightweightDialog {
private final static CmsLog log = CmsLog.getLog(LightweightDialog.class);
public class LightweightDialog {
private final static CmsLog log = CmsLog.getLog(LightweightDialog.class);
- // must be the same value as org.eclipse.jface.window.Window#OK
- public final static int OK = 0;
- // must be the same value as org.eclipse.jface.window.Window#CANCEL
- public final static int CANCEL = 1;
-
private Shell parentShell;
private Shell backgroundShell;
private Shell foregoundShell;
private Shell parentShell;
private Shell backgroundShell;
private Shell foregoundShell;
@@
-88,7
+84,7
@@
public class LightweightDialog {
if (hasChildShells())
return;
if (returnCode == null)// not yet closed
if (hasChildShells())
return;
if (returnCode == null)// not yet closed
- closeShell(CANCEL);
+ closeShell(C
msDialog.C
ANCEL);
}
@Override
}
@Override
@@
-113,7
+109,7
@@
public class LightweightDialog {
if (hasChildShells())
return;
if (returnCode == null)// not yet closed
if (hasChildShells())
return;
if (returnCode == null)// not yet closed
- closeShell(CANCEL);
+ closeShell(C
msDialog.C
ANCEL);
}
});
backgroundShell.addDisposeListener((event) -> onClose());
}
});
backgroundShell.addDisposeListener((event) -> onClose());
@@
-122,7
+118,7
@@
public class LightweightDialog {
block();
}
if (returnCode == null)
block();
}
if (returnCode == null)
- returnCode = OK;
+ returnCode =
CmsDialog.
OK;
return returnCode;
}
return returnCode;
}
@@
-130,11
+126,11
@@
public class LightweightDialog {
try {
runEventLoop(foregoundShell);
} catch (ThreadDeath t) {
try {
runEventLoop(foregoundShell);
} catch (ThreadDeath t) {
- returnCode = CANCEL;
+ returnCode = C
msDialog.C
ANCEL;
if (log.isTraceEnabled())
log.error("Thread death, canceling dialog", t);
} catch (Throwable t) {
if (log.isTraceEnabled())
log.error("Thread death, canceling dialog", t);
} catch (Throwable t) {
- returnCode = CANCEL;
+ returnCode = C
msDialog.C
ANCEL;
log.error("Cannot open blocking lightweight dialog", t);
}
}
log.error("Cannot open blocking lightweight dialog", t);
}
}
@@
-162,13
+158,13
@@
public class LightweightDialog {
private synchronized void notifyClose() {
if (returnCode == null)
private synchronized void notifyClose() {
if (returnCode == null)
- returnCode = CANCEL;
+ returnCode = C
msDialog.C
ANCEL;
notifyAll();
}
protected void closeShell(int returnCode) {
this.returnCode = returnCode;
notifyAll();
}
protected void closeShell(int returnCode) {
this.returnCode = returnCode;
- if (CANCEL == returnCode)
+ if (C
msDialog.C
ANCEL == returnCode)
onCancel();
if (foregoundShell != null && !foregoundShell.isDisposed()) {
foregoundShell.close();
onCancel();
if (foregoundShell != null && !foregoundShell.isDisposed()) {
foregoundShell.close();