当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeInterruptedException类代码示例

本文整理汇总了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");
  }
}
 
开发者ID:eddysystems,项目名称:eddy,代码行数:44,代码来源:EddyPlugin.java


注:本文中的com.intellij.openapi.application.RuntimeInterruptedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。