use of com.intellij.openapi.application.impl.ModalityStateEx in project intellij-community by JetBrains.
the class AbstractProgressIndicatorBase method setModalityProgress.
@Override
public void setModalityProgress(ProgressIndicator modalityProgress) {
LOG.assertTrue(!isRunning());
myModalityProgress = modalityProgress;
ModalityState currentModality = ApplicationManager.getApplication().getCurrentModalityState();
myModalityState = myModalityProgress != null ? ((ModalityStateEx) currentModality).appendProgress(myModalityProgress) : currentModality;
if (modalityProgress != null) {
((TransactionGuardImpl) TransactionGuard.getInstance()).enteredModality(myModalityState);
}
}
use of com.intellij.openapi.application.impl.ModalityStateEx in project intellij-community by JetBrains.
the class ActivityMonitorTest method testModalityState.
public void testModalityState() {
assertReady(null);
myMonitor.addActivity(new UiActivity("non_modal_1"), ModalityState.NON_MODAL);
assertBusy(null);
LaterInvocator.enterModal("dialog");
try {
assertReady(null);
myMonitor.addActivity(new UiActivity("non_modal2"), ModalityState.NON_MODAL);
assertReady(null);
myMonitor.addActivity(new UiActivity("modal_1"), new ModalityStateEx(new Object[] { "dialog" }));
assertBusy(null);
myMonitor.addActivity(new UiActivity("modal_2"), new ModalityStateEx(new Object[] { "dialog", "popup" }));
assertBusy(null);
} finally {
LaterInvocator.leaveModal("dialog");
}
assertBusy(null);
}
Aggregations