本文整理汇总了Java中com.intellij.openapi.roots.ui.LightFilePointer类的典型用法代码示例。如果您正苦于以下问题:Java LightFilePointer类的具体用法?Java LightFilePointer怎么用?Java LightFilePointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LightFilePointer类属于com.intellij.openapi.roots.ui包,在下文中一共展示了LightFilePointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFiles
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Override
public VirtualFile[] getFiles(OrderRootType rootType) {
List<VirtualFile> result = new ArrayList<VirtualFile>();
for (LightFilePointer pointer : myRoots.get(rootType)) {
final VirtualFile file = pointer.getFile();
if (file == null) {
continue;
}
if (file.isDirectory()) {
final String url = file.getUrl();
if (myJarDirectories.contains(rootType, url)) {
LibraryImpl.collectJarFiles(file, result, myJarDirectories.isRecursive(rootType, url));
continue;
}
}
result.add(file);
}
return VfsUtil.toVirtualFileArray(result);
}
示例2: pointersToUrls
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
private static String[] pointersToUrls(Collection<LightFilePointer> pointers) {
List<String> urls = new ArrayList<String>(pointers.size());
for (LightFilePointer pointer : pointers) {
urls.add(pointer.getUrl());
}
return ArrayUtil.toStringArray(urls);
}
示例3: removeRoot
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Override
public void removeRoot(String url, OrderRootType rootType) {
myRoots.remove(rootType, new LightFilePointer(url));
Iterator<LightFilePointer> iterator = myExcludedRoots.iterator();
while (iterator.hasNext()) {
LightFilePointer pointer = iterator.next();
if (!isUnderRoots(pointer.getUrl())) {
iterator.remove();
}
}
myJarDirectories.remove(rootType, url);
}
示例4: isUnderRoots
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
private boolean isUnderRoots(@NotNull String url) {
for (LightFilePointer pointer : myRoots.values()) {
if (VfsUtilCore.isEqualOrAncestor(pointer.getUrl(), url)) {
return true;
}
}
return false;
}
示例5: isValid
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Override
public boolean isValid(String url, OrderRootType orderRootType) {
final Collection<LightFilePointer> pointers = myRoots.get(orderRootType);
for (LightFilePointer pointer : pointers) {
if (pointer.getUrl().equals(url)) {
return pointer.isValid();
}
}
return false;
}
示例6: applyTo
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
public void applyTo(LibraryEx.ModifiableModelEx model) {
model.setProperties(myProperties);
for (OrderRootType type : myRoots.keySet()) {
for (LightFilePointer pointer : myRoots.get(type)) {
if (!myJarDirectories.contains(type, pointer.getUrl())) {
model.addRoot(pointer.getUrl(), type);
}
}
}
for (OrderRootType rootType : myJarDirectories.getRootTypes()) {
for (String url : myJarDirectories.getDirectories(rootType)) {
model.addJarDirectory(url, myJarDirectories.isRecursive(rootType, url), rootType);
}
}
}
示例7: getUrls
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Override
public String[] getUrls(OrderRootType rootType) {
final Collection<LightFilePointer> pointers = myRoots.get(rootType);
List<String> urls = new ArrayList<String>();
for (LightFilePointer pointer : pointers) {
urls.add(pointer.getUrl());
}
return ArrayUtil.toStringArray(urls);
}
示例8: getCompilerOutputPointer
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Override
public VirtualFilePointer getCompilerOutputPointer() {
if (myOutputDirPointer == null) {
return new LightFilePointer(getCompilerOutputUrl());
}
return myOutputDirPointer;
}
示例9: getCompilerOutputPointer
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Nonnull
@Override
public VirtualFilePointer getCompilerOutputPointer(@Nonnull ContentFolderTypeProvider contentFolderType) {
if (myInheritOutput) {
throw new IllegalArgumentException("Then module is inherit output dir - output virtual file pointer not exists");
}
else {
VirtualFilePointer virtualFilePointer = myVirtualFilePointers.get(contentFolderType.getId());
if (virtualFilePointer != null) {
return virtualFilePointer;
}
return new LightFilePointer(myCompilerConfiguration.getCompilerOutputUrl() + "/" + contentFolderType.getId().toLowerCase() + "/" + myModule.getName());
}
}
示例10: createLight
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Nonnull
public static HistoryEntry createLight(@Nonnull VirtualFile file,
@Nonnull FileEditorProvider[] providers,
@Nonnull FileEditorState[] states,
@Nonnull FileEditorProvider selectedProvider) {
VirtualFilePointer pointer = new LightFilePointer(file);
HistoryEntry entry = new HistoryEntry(pointer, selectedProvider, null);
for (int i = 0; i < providers.length; i++) {
entry.putState(providers[i], states[i]);
}
return entry;
}
示例11: pointersToUrls
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
private static String[] pointersToUrls(Collection<LightFilePointer> pointers) {
List<String> urls = new ArrayList<String>();
for (LightFilePointer pointer : pointers) {
urls.add(pointer.getUrl());
}
return ArrayUtil.toStringArray(urls);
}
示例12: isUnderRoots
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
private boolean isUnderRoots(@Nonnull String url) {
for (LightFilePointer pointer : myRoots.values()) {
if (VfsUtilCore.isEqualOrAncestor(pointer.getUrl(), url)) {
return true;
}
}
return false;
}
示例13: NewLibraryEditor
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
public NewLibraryEditor(@Nullable LibraryType type, @Nullable LibraryProperties properties) {
myType = type;
myProperties = properties;
myRoots = new MultiMap<OrderRootType, LightFilePointer>();
myExcludedRoots = new LinkedHashSet<LightFilePointer>();
}
示例14: addRoot
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Override
public void addRoot(VirtualFile file, OrderRootType rootType) {
myRoots.putValue(rootType, new LightFilePointer(file));
}
示例15: addExcludedRoot
import com.intellij.openapi.roots.ui.LightFilePointer; //导入依赖的package包/类
@Override
public void addExcludedRoot(@NotNull String url) {
myExcludedRoots.add(new LightFilePointer(url));
}