com.intellij.openapi.roots.RootProvider Java Examples

The following examples show how to use com.intellij.openapi.roots.RootProvider. 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: HaxelibClasspathUtils.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
/**
 * Get the classpath for the given SDK.  This does not include
 * any paths from the project or modules.
 *
 * @param sdk to get path info from.
 * @return a (possibly empty) collection of class paths.  These are NOT
 *         necessarily properly ordered, but they are unique.
 */
@NotNull
public static HaxeClasspath getSdkClasspath(@NotNull Sdk sdk) {
  HaxeClasspath classpath = new HaxeClasspath();
  RootProvider rootProvider = sdk.getRootProvider();
  OrderRootType interestingRootTypes[] = {OrderRootType.SOURCES, OrderRootType.CLASSES};
  for (OrderRootType rootType : interestingRootTypes) {
    for (VirtualFile file : rootProvider.getFiles(rootType)) {
      if (!classpath.containsUrl(file.getUrl())) {
        classpath.add(new HaxelibItem(file.getName(), file.getUrl()));
      }
    }
  }
  return classpath;
}
 
Example #2
Source File: RootsAsVirtualFilePointers.java    From consulo with Apache License 2.0 5 votes vote down vote up
void copyRootsFrom(@Nonnull RootProvider rootContainer) {
  removeAllRoots();
  for (OrderRootType rootType : OrderRootType.getAllTypes()) {
    final String[] newRoots = rootContainer.getUrls(rootType);
    for (String newRoot : newRoots) {
      addRoot(newRoot, rootType);
    }
  }
}
 
Example #3
Source File: ModuleExtensionWithSdkOrderEntryImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected RootProvider getRootProvider() {
  Sdk sdk = getSdk();
  if(sdk == null) {
    return null;
  }
  return sdk.getRootProvider();
}
 
Example #4
Source File: Unity3dPackageOrderEntry.java    From consulo-unity3d with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public RootProvider getRootProvider()
{
	return myRootProvider;
}
 
Example #5
Source File: SdkImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public RootProvider getRootProvider() {
  return myRootProvider;
}
 
Example #6
Source File: LibraryImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public RootProvider getRootProvider() {
  return this;
}
 
Example #7
Source File: Sdk.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
RootProvider getRootProvider();
 
Example #8
Source File: Library.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
RootProvider getRootProvider();
 
Example #9
Source File: MockSdkWrapper.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public RootProvider getRootProvider() {
  return myDelegate.getRootProvider();
}