Java 类com.intellij.openapi.project.PossiblyDumbAware 实例源码

项目:intellij-ce-playground    文件:SMTestProxy.java   
/** @deprecated use {@link #setLocator(SMTestLocator)} (to be removed in IDEA 16) */
@SuppressWarnings("deprecation")
public void setLocator(@NotNull final TestLocationProvider locator) {
  class Adapter implements SMTestLocator, PossiblyDumbAware {
    @NotNull
    @Override
    public List<Location> getLocation(@NotNull String protocol, @NotNull String path, @NotNull Project project, @NotNull GlobalSearchScope scope) {
      return locator.getLocation(protocol, path, project);
    }

    @Override
    public boolean isDumbAware() {
      return DumbService.isDumbAware(locator);
    }
  }

  myLocator = new Adapter();
}
项目:intellij-ce-playground    文件:DisposeAwareRunnable.java   
private static Runnable create(@NotNull Runnable delegate, @Nullable Object disposable) {
  if (disposable == null) {
    return delegate;
  }

  if (delegate instanceof DumbAware) {
    return new DumbAwareRunnable(delegate, disposable);
  }

  if (delegate instanceof PossiblyDumbAware) {
    return new PossiblyDumbAwareRunnable(delegate, disposable);
  }

  return new DisposeAwareRunnable(delegate, disposable);
}
项目:tools-idea    文件:DisposeAwareRunnable.java   
private static Runnable create(@NotNull Runnable delegate, @Nullable Object disposable) {
  if (disposable == null) {
    return delegate;
  }

  if (delegate instanceof DumbAware) {
    return new DumbAwareRunnable(delegate, disposable);
  }

  if (delegate instanceof PossiblyDumbAware) {
    return new PossiblyDumbAwareRunnable(delegate, disposable);
  }

  return new DisposeAwareRunnable(delegate, disposable);
}
项目:consulo    文件:DisposeAwareRunnable.java   
private static Runnable create(@Nonnull Runnable delegate, @Nullable Object disposable) {
  if (disposable == null) {
    return delegate;
  }

  if (delegate instanceof DumbAware) {
    return new DumbAwareRunnable(delegate, disposable);
  }

  if (delegate instanceof PossiblyDumbAware) {
    return new PossiblyDumbAwareRunnable(delegate, disposable);
  }

  return new DisposeAwareRunnable(delegate, disposable);
}
项目:intellij-ce-playground    文件:DisposeAwareRunnable.java   
@Override
public boolean isDumbAware() {
  return ((PossiblyDumbAware)myDelegate).isDumbAware();
}
项目:intellij-ce-playground    文件:FileEditorManagerImpl.java   
public static boolean isDumbAware(@NotNull FileEditor editor) {
  return Boolean.TRUE.equals(editor.getUserData(DUMB_AWARE)) &&
         (!(editor instanceof PossiblyDumbAware) || ((PossiblyDumbAware)editor).isDumbAware());
}
项目:tools-idea    文件:DisposeAwareRunnable.java   
@Override
public boolean isDumbAware() {
  return ((PossiblyDumbAware)myDelegate).isDumbAware();
}
项目:tools-idea    文件:FileEditorManagerImpl.java   
public static boolean isDumbAware(FileEditor editor) {
  return Boolean.TRUE.equals(editor.getUserData(DUMB_AWARE)) &&
         (!(editor instanceof PossiblyDumbAware) || ((PossiblyDumbAware)editor).isDumbAware());
}
项目:consulo    文件:DisposeAwareRunnable.java   
@Override
public boolean isDumbAware() {
  return ((PossiblyDumbAware)myDelegate).isDumbAware();
}