本文整理汇总了Java中consulo.dotnet.dll.DotNetModuleFileType类的典型用法代码示例。如果您正苦于以下问题:Java DotNetModuleFileType类的具体用法?Java DotNetModuleFileType怎么用?Java DotNetModuleFileType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DotNetModuleFileType类属于consulo.dotnet.dll包,在下文中一共展示了DotNetModuleFileType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolve
import consulo.dotnet.dll.DotNetModuleFileType; //导入依赖的package包/类
@NotNull
@RequiredReadAction
static AssemblyModule resolve(@NotNull PsiElement element)
{
Module module = ModuleUtilCore.findModuleForPsiElement(element);
if(module != null)
{
return new ConsuloModuleAsAssemblyModule(module);
}
VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element);
if(virtualFile != null)
{
VirtualFile rootFile = ArchiveVfsUtil.getVirtualFileForArchive(virtualFile);
if(rootFile != null && rootFile.getFileType() == DotNetModuleFileType.INSTANCE)
{
return new DotNetModuleAsAssemblyModule(element.getProject(), rootFile);
}
}
return UnknownAssemblyModule.INSTANCE;
}
示例2: detectRoots
import consulo.dotnet.dll.DotNetModuleFileType; //导入依赖的package包/类
@NotNull
@Override
public Collection<VirtualFile> detectRoots(@NotNull VirtualFile rootCandidate, @NotNull ProgressIndicator progressIndicator)
{
if(rootCandidate.getFileSystem() instanceof ArchiveFileSystem)
{
VirtualFile localFile = ArchiveVfsUtil.getVirtualFileForArchive(rootCandidate);
if(localFile == null || localFile.getFileType() != DotNetModuleFileType.INSTANCE)
{
return Collections.emptyList();
}
String docFilePath = localFile.getParent().getPath() + "/" + localFile.getNameWithoutExtension() + XmlFileType.DOT_DEFAULT_EXTENSION;
VirtualFile docFile = LocalFileSystem.getInstance().findFileByIoFile(new File(docFilePath));
if(docFile != null)
{
return Collections.singletonList(docFile);
}
}
else if(rootCandidate.getFileType() == XmlFileType.INSTANCE)
{
return Collections.singletonList(rootCandidate);
}
return Collections.emptyList();
}
示例3: registerFileTypes
import consulo.dotnet.dll.DotNetModuleFileType; //导入依赖的package包/类
@Override
public void registerFileTypes(Consumer<FileType> consumer)
{
consumer.accept(DotNetModuleFileType.INSTANCE);
consumer.accept(CSharpFileType.INSTANCE);
consumer.accept(JavaScriptFileType.INSTANCE);
}
示例4: notifyAboutPluginFile
import consulo.dotnet.dll.DotNetModuleFileType; //导入依赖的package包/类
@RequiredReadAction
private static void notifyAboutPluginFile(@NotNull final Project project)
{
Unity3dRootModuleExtension moduleExtension = Unity3dModuleExtensionUtil.getRootModuleExtension(project);
if(moduleExtension == null)
{
return;
}
Unity3dDefineByVersion unity3dDefineByVersion = Unity3dProjectImportUtil.getUnity3dDefineByVersion(moduleExtension.getSdk());
final String pluginFileName = unity3dDefineByVersion.getPluginFileName();
if(pluginFileName == null)
{
return;
}
File pluginPath = PluginManager.getPluginPath(UnityPluginFileValidator.class);
final File unityPluginFile = new File(pluginPath, "UnityEditorConsuloPlugin/" + pluginFileName);
if(!unityPluginFile.exists())
{
return;
}
VirtualFile baseDir = project.getBaseDir();
if(baseDir == null)
{
return;
}
List<VirtualFile> targetFiles = new SmartList<>();
VirtualFile fileByRelativePath = baseDir.findFileByRelativePath(ourPath);
if(fileByRelativePath != null)
{
VirtualFile[] children = fileByRelativePath.getChildren();
for(VirtualFile child : children)
{
CharSequence nameSequence = child.getNameSequence();
if(StringUtil.startsWith(nameSequence, "UnityEditorConsuloPlugin") && child.getFileType() == DotNetModuleFileType.INSTANCE)
{
targetFiles.add(child);
}
}
}
if(targetFiles.isEmpty())
{
showNotify(project, pluginFileName, unityPluginFile, "Consulo plugin for UnityEditor is missing<br><a href=\"update\">Install</a>", Collections.emptyList());
}
else
{
VirtualFile firstItem = targetFiles.size() == 1 ? targetFiles.get(0) : null;
if(firstItem != null && VfsUtilCore.virtualToIoFile(firstItem).lastModified() == unityPluginFile.lastModified())
{
return;
}
String title = "Outdated Consulo plugin(s) for UnityEditor can create <a href=\"info\">issues</a>. <a href=\"update\">Update</a> are recommended";
showNotify(project, pluginFileName, unityPluginFile, title, targetFiles);
}
}
示例5: getInstance
import consulo.dotnet.dll.DotNetModuleFileType; //导入依赖的package包/类
@NotNull
public static DotNetArchiveFileSystem getInstance()
{
return (DotNetArchiveFileSystem) VirtualFileManager.getInstance().getFileSystem(DotNetModuleFileType.PROTOCOL);
}
示例6: DotNetArchiveFileSystem
import consulo.dotnet.dll.DotNetModuleFileType; //导入依赖的package包/类
public DotNetArchiveFileSystem()
{
super(DotNetModuleFileType.PROTOCOL);
}