/** @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(); }
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); }
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); }
@Override public boolean isDumbAware() { return ((PossiblyDumbAware)myDelegate).isDumbAware(); }
public static boolean isDumbAware(@NotNull FileEditor editor) { return Boolean.TRUE.equals(editor.getUserData(DUMB_AWARE)) && (!(editor instanceof PossiblyDumbAware) || ((PossiblyDumbAware)editor).isDumbAware()); }
public static boolean isDumbAware(FileEditor editor) { return Boolean.TRUE.equals(editor.getUserData(DUMB_AWARE)) && (!(editor instanceof PossiblyDumbAware) || ((PossiblyDumbAware)editor).isDumbAware()); }