本文整理汇总了Java中com.intellij.openapi.roots.RootProvider类的典型用法代码示例。如果您正苦于以下问题:Java RootProvider类的具体用法?Java RootProvider怎么用?Java RootProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RootProvider类属于com.intellij.openapi.roots包,在下文中一共展示了RootProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: PythonSdkPathCache
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
public PythonSdkPathCache(@NotNull final Project project, @NotNull final Sdk sdk) {
myProject = project;
mySdk = sdk;
sdk.getRootProvider().addRootSetChangedListener(new RootProvider.RootSetChangedListener() {
@Override
public void rootSetChanged(RootProvider wrapper) {
clearCache();
if (!project.isDisposed()) {
final Module[] modules = ModuleManager.getInstance(project).getModules();
for (Module module : modules) {
PythonModulePathCache.getInstance(module).clearCache();
}
}
myBuiltins.set(null);
}
}, this);
VirtualFileManager.getInstance().addVirtualFileListener(new MyVirtualFileAdapter(), this);
if (!project.isDisposed()) {
project.getMessageBus().connect(this).subscribe(ProjectJdkTable.JDK_TABLE_TOPIC, new ProjectJdkTable.Adapter() {
@Override
public void jdkRemoved(Sdk jdk) {
if (jdk == sdk) {
Disposer.dispose(PythonSdkPathCache.this);
}
}
});
Disposer.register(project, this);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:PythonSdkPathCache.java
示例2: getSdkClasspath
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
/**
* 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;
}
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:23,代码来源:HaxelibClasspathUtils.java
示例3: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Override
protected RootProvider getRootProvider() {
Sdk sdk = getSdk();
if(sdk == null) {
return null;
}
return sdk.getRootProvider();
}
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:ModuleExtensionWithSdkOrderEntryImpl.java
示例4: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@NotNull
@Override
public RootProvider getRootProvider() {
return mySdk.getRootProvider();
}
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:6,代码来源:KahluaSdk.java
示例5: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@NotNull
public RootProvider getRootProvider() {
return myDelegate.getRootProvider();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MockJdkWrapper.java
示例6: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@NotNull
RootProvider getRootProvider();
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:Sdk.java
示例7: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@NotNull
@Override
public RootProvider getRootProvider() {
return myRootProvider;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:JpsLibraryDelegate.java
示例8: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Override
@NotNull
public RootProvider getRootProvider() {
return myRootProvider;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ProjectJdkImpl.java
示例9: getRootFiles
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Override
public VirtualFile[] getRootFiles(@NotNull OrderRootType type) {
RootProvider rootProvider = getRootProvider();
return rootProvider != null ? rootProvider.getFiles(type) : VirtualFile.EMPTY_ARRAY;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:LibraryOrderEntryBaseImpl.java
示例10: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Nullable
protected abstract RootProvider getRootProvider();
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:LibraryOrderEntryBaseImpl.java
示例11: getRootUrls
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Override
@NotNull
public String[] getRootUrls(@NotNull OrderRootType type) {
RootProvider rootProvider = getRootProvider();
return rootProvider == null ? ArrayUtil.EMPTY_STRING_ARRAY : rootProvider.getUrls(type);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:LibraryOrderEntryBaseImpl.java
示例12: resubscribe
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
private void resubscribe(RootProvider wrapper) {
unsubscribe();
subscribe(wrapper);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:LibraryOrderEntryBaseImpl.java
示例13: subscribe
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
private void subscribe(@Nullable RootProvider wrapper) {
if (wrapper != null) {
myProjectRootManagerImpl.subscribeToRootProvider(this, wrapper);
}
myCurrentlySubscribedRootProvider = wrapper;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:LibraryOrderEntryBaseImpl.java
示例14: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Override
protected RootProvider getRootProvider() {
return myJdk == null ? null : myJdk.getRootProvider();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ModuleJdkOrderEntryImpl.java
示例15: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@NotNull
@Override
public RootProvider getRootProvider() {
return null;
}
开发者ID:eli1982,项目名称:intellij-perl-plugin,代码行数:6,代码来源:PerlSdk.java
示例16: testModification
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
public void testModification() throws Exception {
final LibraryTable libraryTable = LibraryTablesRegistrar.getInstance().getLibraryTable();
final Library library = libraryTable.createLibrary("NewLibrary");
final boolean[] listenerNotifiedOnChange = new boolean[1];
library.getRootProvider().addRootSetChangedListener(new RootProvider.RootSetChangedListener() {
@Override
public void rootSetChanged(RootProvider wrapper) {
listenerNotifiedOnChange[0] = true;
}
});
final Library.ModifiableModel modifyableModel = library.getModifiableModel();
modifyableModel.addRoot("file://x.jar", OrderRootType.CLASSES);
modifyableModel.addRoot("file://x-src.jar", OrderRootType.SOURCES);
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
modifyableModel.commit();
}
});
assertTrue(listenerNotifiedOnChange[0]);
listenerNotifiedOnChange[0] = false;
final Library.ModifiableModel modifyableModel1 = library.getModifiableModel();
modifyableModel1.setName("library");
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
modifyableModel1.commit();
}
});
assertFalse(listenerNotifiedOnChange[0]);
final Element element = new Element("root");
library.writeExternal(element);
assertEquals("<root><library name=\"library\"><CLASSES><root url=\"file://x.jar\" /></CLASSES><JAVADOC /><SOURCES><root url=\"file://x-src.jar\" /></SOURCES></library></root>",
new XMLOutputter().outputString(element));
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
libraryTable.removeLibrary(library);
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:47,代码来源:LibraryTest.java
示例17: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Nullable
@Override
public RootProvider getRootProvider()
{
return myRootProvider;
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:7,代码来源:DotNetLibraryOrderEntryImpl.java
示例18: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Override
@Nonnull
public RootProvider getRootProvider() {
return myRootProvider;
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:SdkImpl.java
示例19: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Nonnull
RootProvider getRootProvider();
开发者ID:consulo,项目名称:consulo,代码行数:3,代码来源:Sdk.java
示例20: getRootProvider
import com.intellij.openapi.roots.RootProvider; //导入依赖的package包/类
@Override
@Nonnull
public RootProvider getRootProvider() {
return myDelegate.getRootProvider();
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:MockSdkWrapper.java
注:本文中的com.intellij.openapi.roots.RootProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论