use of java.awt.Dialog.ModalityType in project vcell by virtualcell.
the class LWNamespace method getEquivalentModality.
/**
* @param dialog not null
* @return {@link LWModality} that best matches current dialog swing modality
*/
public static LWModality getEquivalentModality(Dialog dialog) {
Objects.requireNonNull(dialog);
final Logger lg = LGHolder.LG;
ModalityType awtModality = dialog.getModalityType();
switch(awtModality) {
case MODELESS:
return LWModality.MODELESS;
case DOCUMENT_MODAL:
return LWModality.PARENT_ONLY;
default:
if (lg.isEnabledFor(Level.WARN)) {
lg.warn(ExecutionTrace.justClassName(dialog) + " titled " + dialog.getTitle() + " using unsupported modality " + awtModality);
}
return LWModality.PARENT_ONLY;
}
}
Aggregations