Java Code Examples for com.intellij.openapi.util.ThrowableComputable#getClass()

The following examples show how to use com.intellij.openapi.util.ThrowableComputable#getClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseApplication.java    From consulo with Apache License 2.0 6 votes vote down vote up
@RequiredUIAccess
@Override
public <T, E extends Throwable> T runWriteAction(@Nonnull ThrowableComputable<T, E> computation) throws E {
  Class<? extends ThrowableComputable> clazz = computation.getClass();

  boolean needUnlock = startWriteUI(clazz);
  try {
    return computation.compute();
  }
  finally {
    endWrite(clazz);
    if(needUnlock) {
      releaseWriteIntentLock();
    }
  }
}
 
Example 2
Source File: BaseApplication.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public <T, E extends Throwable> T runWriteActionNoIntentLock(@Nonnull ThrowableComputable<T, E> computation) throws E {
  Class<? extends ThrowableComputable> clazz = computation.getClass();

  startWrite(clazz);
  try {
    return computation.compute();
  }
  finally {
    endWrite(clazz);
  }
}