Java Code Examples for com.intellij.openapi.vfs.newvfs.events.VFileEvent#getPath()

The following examples show how to use com.intellij.openapi.vfs.newvfs.events.VFileEvent#getPath() . 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: ExternalSystemAutoImporter.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public void after(@Nonnull List<? extends VFileEvent> events) {
  boolean scheduleRefresh = false;
  for (VFileEvent event : events) {
    String changedPath = event.getPath();
    for (MyEntry entry : myAutoImportAware) {
      String projectPath = entry.aware.getAffectedExternalProjectPath(changedPath, myProject);
      if (projectPath == null) {
        continue;
      }
      ExternalProjectSettings projectSettings = entry.systemSettings.getLinkedProjectSettings(projectPath);
      if (projectSettings != null && projectSettings.isUseAutoImport()) {
        addPath(entry.externalSystemId, projectPath);
        scheduleRefresh = true;
        break;
      }
    }
  }
  if (scheduleRefresh) {
    myVfsAlarm.cancelAllRequests();
    myVfsAlarm.addRequest(myFilesRequest, ExternalSystemConstants.AUTO_IMPORT_DELAY_MILLIS);
  }
}
 
Example 2
Source File: VcsRootScanner.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void after(@Nonnull List<? extends VFileEvent> events) {
  for (VFileEvent event : events) {
    String filePath = event.getPath();
    for (VcsRootChecker checker : myCheckers) {
      if (checker.isVcsDir(filePath)) {
        scheduleScan();
        break;
      }
    }
  }
}