Java Code Examples for com.intellij.openapi.module.Module#EMPTY_ARRAY

The following examples show how to use com.intellij.openapi.module.Module#EMPTY_ARRAY . These examples are extracted from open source projects. 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 Project: consulo   File: ModuleRootLayerImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Module[] getModuleDependencies(boolean includeTests) {
  final List<Module> result = new ArrayList<>();

  for (OrderEntry entry : getOrderEntries()) {
    if (entry instanceof ModuleOrderEntry) {
      ModuleOrderEntry moduleOrderEntry = (ModuleOrderEntry)entry;
      final DependencyScope scope = moduleOrderEntry.getScope();
      if (!includeTests && !scope.isForProductionCompile() && !scope.isForProductionRuntime()) {
        continue;
      }
      final Module module1 = moduleOrderEntry.getModule();
      if (module1 != null) {
        result.add(module1);
      }
    }
  }

  return result.isEmpty() ? Module.EMPTY_ARRAY : ContainerUtil.toArray(result, new Module[result.size()]);
}
 
Example 2
Source Project: consulo   File: PackageViewPane.java    License: Apache License 2.0 6 votes vote down vote up
private Module[] getModulesFor(PsiDirectory dir) {
  final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
  final VirtualFile vFile = dir.getVirtualFile();
  final Set<Module> modules = new HashSet<Module>();
  final Module module = fileIndex.getModuleForFile(vFile);
  if (module != null) {
    modules.add(module);
  }
  if (fileIndex.isInLibrarySource(vFile) || fileIndex.isInLibraryClasses(vFile)) {
    final List<OrderEntry> orderEntries = fileIndex.getOrderEntriesForFile(vFile);
    if (orderEntries.isEmpty()) {
      return Module.EMPTY_ARRAY;
    }
    for (OrderEntry entry : orderEntries) {
      modules.add(entry.getOwnerModule());
    }
  }
  return modules.toArray(new Module[modules.size()]);
}
 
Example 3
@NotNull
public static Module[] getModules(@NotNull Project project) {
  // A disposed project has no modules.
  if (project.isDisposed()) return Module.EMPTY_ARRAY;

  return ModuleManager.getInstance(project).getModules();
}
 
Example 4
@NotNull
public static Module[] getModules(@NotNull Project project) {
  // A disposed project has no modules.
  if (project.isDisposed()) return Module.EMPTY_ARRAY;

  return ModuleManager.getInstance(project).getModules();
}
 
Example 5
@Nonnull
public Module[] getAffectedModules() {
  final Module module = ModuleUtil.findModuleForFile(myFile, myProject);
  if (module == null) {
    LOG.error("Module is null for file " + myFile.getPresentableUrl());
    return Module.EMPTY_ARRAY;
  }
  return new Module[] {module};
}
 
Example 6
@Override
@Nonnull
public Module[] getModules() {
  ThrowableComputable<Module[],RuntimeException> action = () -> {
    final Module module = getConfigurationModule().getModule();
    return module == null ? Module.EMPTY_ARRAY : new Module[]{module};
  };
  return AccessRule.read(action);
}
 
Example 7
@Override
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 8
@Override
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 9
Source Project: consulo   File: ModulesProvider.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 10
@Override
@Nonnull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 11
Source Project: consulo   File: RuntimeConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 12
Source Project: consulo   File: ToolRunProfile.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 13
Source Project: CppTools   File: CppRunConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@NotNull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}