本文整理汇总了Java中com.intellij.openapi.application.RuntimeInterruptedException类的典型用法代码示例。如果您正苦于以下问题:Java RuntimeInterruptedException类的具体用法?Java RuntimeInterruptedException怎么用?Java RuntimeInterruptedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeInterruptedException类属于com.intellij.openapi.application包,在下文中一共展示了RuntimeInterruptedException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkLogging
import com.intellij.openapi.application.RuntimeInterruptedException; //导入依赖的package包/类
private static void checkLogging() {
// if no logging preference saved, make the user select one
final PropertiesComponent props = PropertiesComponent.getInstance();
final String name = "com.eddysystems.Props.checkedLogging";
String checked = props.getValue(name);
log("logging state: " + checked);
if (checked == null || !checked.equals("true")) {
// we haven't checked before, check now and save to Preferences
final Object done = new Object();
final Runnable showRunner = new Runnable() {
@Override
public void run() {
final TOSDialog d = new TOSDialog();
d.showAndGet();
Preferences.getData().setLogPreference(d.logging());
Preferences.save();
synchronized (done) {
done.notifyAll();
}
}
};
// go to dispatch to show dialog
if (!ApplicationManager.getApplication().isDispatchThread()) {
// we have to wait manually, because getting the current modality isn't a thing that 13 lets us do outside of
// dispatch
ApplicationManager.getApplication().invokeLater(showRunner);
try {
synchronized (done) {
done.wait();
}
} catch (InterruptedException e) {
throw new RuntimeInterruptedException(e);
}
} else {
showRunner.run();
}
props.setValue(name, "true");
}
}