Java Code Examples for com.intellij.openapi.util.SimpleModificationTracker

The following are top voted examples for showing how to use com.intellij.openapi.util.SimpleModificationTracker. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: consulo   File: PsiModificationTrackerImpl.java   View source code 6 votes vote down vote up
@Nonnull
private static SimpleModificationTracker wrapped(RegistryValue value, SimpleModificationTracker fallback, boolean testMode) {
  if (testMode) {
    return new SimpleModificationTracker();
  }
  return new SimpleModificationTracker() {
    @Override
    public long getModificationCount() {
      return value.asBoolean() ? super.getModificationCount() : fallback.getModificationCount();
    }

    @Override
    public void incModificationCount() {
      if (value.asBoolean()) super.incModificationCount();
      //else fallback.incModificationCount();
    }
  };
}
 
Example 2
Project: intellij-ce-playground   File: FacetModificationTrackingServiceImpl.java   View source code 5 votes vote down vote up
private Pair<SimpleModificationTracker, EventDispatcher<ModificationTrackerListener>> getFacetInfo(final Facet facet) {
  Pair<SimpleModificationTracker, EventDispatcher<ModificationTrackerListener>> pair = myModificationsTrackers.get(facet);
  if (pair == null) {
    pair = Pair.create(new SimpleModificationTracker(), EventDispatcher.create(ModificationTrackerListener.class));
    myModificationsTrackers.put(facet, pair);
  }
  return pair;
}
 
Example 3
Project: intellij-ce-playground   File: FacetModificationTrackingServiceImpl.java   View source code 5 votes vote down vote up
@Override
public void facetConfigurationChanged(@NotNull final Facet facet) {
  final Pair<SimpleModificationTracker, EventDispatcher<ModificationTrackerListener>> pair = myModificationsTrackers.get(facet);
  if (pair != null) {
    pair.first.incModificationCount();
    pair.second.getMulticaster().modificationCountChanged(facet);
  }
}
 
Example 4
Project: intellij   File: BlazeSourceJarNavigationPolicy.java   View source code 5 votes vote down vote up
private Result<PsiFile> notFound(ClsFileImpl file) {
  // A "not-found" result is null, but depends on the project sync tracker, so it will expire
  // after the next blaze sync. This means we'll run this check again after every sync for files
  // that don't have source jars, but it's not a huge deal because checking for the source jar
  // only takes a few microseconds.
  projectSyncTrackers.putIfAbsent(file.getProject(), new SimpleModificationTracker());
  return Result.create(null, projectSyncTrackers.get(file.getProject()));
}
 
Example 5
Project: intellij   File: BlazeSourceJarNavigationPolicy.java   View source code 5 votes vote down vote up
@Override
public void afterSync(
    Project project, BlazeContext context, SyncMode syncMode, SyncResult syncResult) {
  SimpleModificationTracker modificationTracker = projectSyncTrackers.get(project);
  if (modificationTracker != null) {
    modificationTracker.incModificationCount();
  }
}
 
Example 6
Project: intellij-ce-playground   File: ClassInnerStuffCache.java   View source code 4 votes vote down vote up
public ClassInnerStuffCache(@NotNull PsiExtensibleClass aClass) {
  myClass = aClass;
  myTracker = new SimpleModificationTracker();
}
 
Example 7
Project: intellij-ce-playground   File: MockDumbService.java   View source code 4 votes vote down vote up
@Override
public ModificationTracker getModificationTracker() {
  return new SimpleModificationTracker();
}
 
Example 8
Project: intellij-ce-playground   File: FacetModificationTrackingServiceImpl.java   View source code 4 votes vote down vote up
@Override
public void incFacetModificationTracker(@NotNull final Facet facet) {
  final Pair<SimpleModificationTracker, EventDispatcher<ModificationTrackerListener>> pair = getFacetInfo(facet);
  pair.first.incModificationCount();
  pair.second.getMulticaster().modificationCountChanged(facet);
}
 
Example 9
Project: consulo   File: MockDumbService.java   View source code 4 votes vote down vote up
@Override
public ModificationTracker getModificationTracker() {
  return new SimpleModificationTracker();
}
 
Example 10
Project: consulo   File: PsiModificationTrackerImpl.java   View source code 4 votes vote down vote up
public void incLanguageModificationCount(@Nullable Language language) {
  if (language == null) return;
  ((SimpleModificationTracker)myLanguageTrackers.get(language)).incModificationCount();
}
 
Example 11
Project: consulo-java   File: ClassInnerStuffCache.java   View source code 4 votes vote down vote up
public ClassInnerStuffCache(@NotNull PsiExtensibleClass aClass)
{
	myClass = aClass;
	myTracker = new SimpleModificationTracker();
}