• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ProductionContentFolderTypeProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中consulo.roots.impl.ProductionContentFolderTypeProvider的典型用法代码示例。如果您正苦于以下问题:Java ProductionContentFolderTypeProvider类的具体用法?Java ProductionContentFolderTypeProvider怎么用?Java ProductionContentFolderTypeProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProductionContentFolderTypeProvider类属于consulo.roots.impl包,在下文中一共展示了ProductionContentFolderTypeProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateCustomPathToFile

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
private void updateCustomPathToFile() {
  if (myCustomPathCheckBox.isSelected()) {
    myPathToFileTextField.setText(FileUtil.toSystemDependentName(customPathToFile));
  }
  else if (getSelectedModule() != null) {
    final HaxeModuleSettings settings = HaxeModuleSettings.getInstance(getSelectedModule());
    final ModuleCompilerPathsManager compilerPathsManager = ModuleCompilerPathsManager.getInstance(getSelectedModule());

    final String url = compilerPathsManager.getCompilerOutputUrl(ProductionContentFolderTypeProvider.getInstance()) + "/" + settings.getOutputFileName();
    myPathToFileTextField.setText(FileUtil.toSystemDependentName(VfsUtil.urlToPath(url)));
  }
  else {
    myPathToFileTextField.setText("");
  }
  myPathToFileTextField.setEnabled(myCustomPathCheckBox.isSelected());
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:17,代码来源:HaxeRunConfigurationEditorForm.java


示例2: findFileByRelativePath

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@Nullable
private static File findFileByRelativePath(final CompileContext context, final Module module, final String relativePath)
{
	VirtualFile output = context.getOutputForFile(module, ProductionContentFolderTypeProvider.getInstance());

	File file = output != null ? getFileByRelativeOrNull(output.getPath(), relativePath) : null;
	if(file == null)
	{
		final VirtualFile testsOutput = context.getOutputForFile(module, TestContentFolderTypeProvider.getInstance());
		if(testsOutput != null && !testsOutput.equals(output))
		{
			file = getFileByRelativeOrNull(testsOutput.getPath(), relativePath);
		}
	}
	return file;
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:17,代码来源:Form2ByteCodeCompiler.java


示例3: addModule

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
public static Module addModule(final Project project, final String name, final VirtualFile root) {
  return new WriteCommandAction<Module>(project) {
    @Override
    protected void run(Result<Module> result) throws Throwable {
      final ModifiableModuleModel moduleModel = ModuleManager.getInstance(project).getModifiableModel();
      String moduleName = moduleModel.newModule(name, root.getPath()).getName();
      moduleModel.commit();

      final Module dep = ModuleManager.getInstance(project).findModuleByName(moduleName);
      final ModifiableRootModel model = ModuleRootManager.getInstance(dep).getModifiableModel();
      final ContentEntry entry = model.addContentEntry(root);
      entry.addFolder(root, ProductionContentFolderTypeProvider.getInstance());

      model.commit();
      result.setResult(dep);
    }
  }.execute().getResultObject();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:PsiTestUtil.java


示例4: getModuleOutputDirectory

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
/**
 * @param module
 * @param forTestClasses true if directory for test sources, false - for sources.
 * @return a directory to which the sources (or test sources depending on the second partameter) should be compiled.
 *         Null is returned if output directory is not specified or is not valid
 */
@Nullable
public static VirtualFile getModuleOutputDirectory(final Module module, boolean forTestClasses) {
  final ModuleCompilerPathsManager manager = ModuleCompilerPathsManager.getInstance(module);
  VirtualFile outPath;
  if (forTestClasses) {
    final VirtualFile path = manager.getCompilerOutput(TestContentFolderTypeProvider.getInstance());
    if (path != null) {
      outPath = path;
    }
    else {
      outPath = manager.getCompilerOutput(ProductionContentFolderTypeProvider.getInstance());
    }
  }
  else {
    outPath = manager.getCompilerOutput(ProductionContentFolderTypeProvider.getInstance());
  }
  if (outPath == null) {
    return null;
  }
  if (!outPath.isValid()) {
    LOGGER.info("Requested output path for module " + module.getName() + " is not valid");
    return null;
  }
  return outPath;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:32,代码来源:CompilerPathsImpl.java


示例5: getModuleOutputPath

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
/**
 * The same as {@link #getModuleOutputDirectory} but returns String.
 * The method still returns a non-null value if the output path is specified in Settings but does not exist on disk.
 */
@Nullable
@Deprecated
public static String getModuleOutputPath(final Module module, final boolean forTestClasses) {
  final String outPathUrl;
  final Application application = ApplicationManager.getApplication();
  final ModuleCompilerPathsManager pathsManager = ModuleCompilerPathsManager.getInstance(module);

  if (application.isDispatchThread()) {
    outPathUrl = pathsManager.getCompilerOutputUrl(
      forTestClasses ? TestContentFolderTypeProvider.getInstance() : ProductionContentFolderTypeProvider.getInstance());
  }
  else {
    outPathUrl = application.runReadAction(new Computable<String>() {
      @Override
      public String compute() {
        return pathsManager.getCompilerOutputUrl(
          forTestClasses ? TestContentFolderTypeProvider.getInstance() : ProductionContentFolderTypeProvider.getInstance());
      }
    });
  }

  return outPathUrl != null ? VirtualFileManager.extractPath(outPathUrl) : null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:CompilerPathsImpl.java


示例6: moduleCompileOutputChanged

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@Override
public void moduleCompileOutputChanged(final String baseUrl, final String moduleName) {
  ModuleCompilerPathsManager moduleCompilerPathsManager = ModuleCompilerPathsManager.getInstance(getModule());
  if (moduleCompilerPathsManager.isInheritedCompilerOutput()) {
    if (baseUrl != null) {
      myOutputPathPanel.setText(FileUtil.toSystemDependentName(
              VfsUtilCore.urlToPath(moduleCompilerPathsManager.getCompilerOutputUrl(ProductionContentFolderTypeProvider.getInstance()))));
      myTestsOutputPathPanel.setText(FileUtil.toSystemDependentName(
              VfsUtilCore.urlToPath(moduleCompilerPathsManager.getCompilerOutputUrl(TestContentFolderTypeProvider.getInstance()))));
      myResourcesOutputPathPanel.setText(FileUtil.toSystemDependentName(
              VfsUtilCore.urlToPath(moduleCompilerPathsManager.getCompilerOutputUrl(ProductionResourceContentFolderTypeProvider.getInstance()))));
      myTestResourcesOutputPathPanel.setText(FileUtil.toSystemDependentName(
              VfsUtilCore.urlToPath(moduleCompilerPathsManager.getCompilerOutputUrl(TestResourceContentFolderTypeProvider.getInstance()))));
    }
    else {
      myOutputPathPanel.setText(null);
      myTestsOutputPathPanel.setText(null);
      myResourcesOutputPathPanel.setText(null);
      myTestResourcesOutputPathPanel.setText(null);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:BuildElementsEditor.java


示例7: testCreationOfSourceFolderWithFile

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
public void testCreationOfSourceFolderWithFile() throws IOException {
  VirtualFile dir = root.createChildDirectory(null, "src");
  String url = dir.getUrl();

  ContentFolder f = entry.addFolder(dir, ProductionContentFolderTypeProvider.getInstance());
  assertEquals(dir, f.getFile());
  assertEquals(url, f.getUrl());

  dir.delete(null);
  assertNull(f.getFile());
  assertEquals(url, f.getUrl());

  dir = root.createChildDirectory(null, "src");
  assertEquals(dir, f.getFile());
  assertEquals(url, f.getUrl());
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:ManagingContentRootFoldersTest.java


示例8: replaceSourceRoot

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
private void replaceSourceRoot(final VirtualFile newSourceRoot) {
  ApplicationManager.getApplication().runWriteAction(
      new Runnable() {
        @Override
        public void run() {
          final ModifiableRootModel rootModel = ModuleRootManager.getInstance(myModule).getModifiableModel();
          final ContentEntry[] content = rootModel.getContentEntries();
          boolean contentToChangeFound = false;
          for (ContentEntry contentEntry : content) {
            final ContentFolder[] sourceFolders = contentEntry.getFolders(ContentFolderScopes.of(ProductionContentFolderTypeProvider.getInstance()));
            for (ContentFolder sourceFolder : sourceFolders) {
              contentEntry.removeFolder(sourceFolder);
            }
            final VirtualFile contentRoot = contentEntry.getFile();
            if (contentRoot != null && VfsUtilCore.isAncestor(contentRoot, newSourceRoot, false)) {
              contentEntry.addFolder(newSourceRoot, ProductionContentFolderTypeProvider.getInstance());
              contentToChangeFound = true;
            }
          }
          assertTrue(contentToChangeFound);
          rootModel.commit();
        }
      }
  );
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:SrcRepositoryUseTest.java


示例9: patch

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@Override
public void patch(@NotNull ModifiableRootModel model, @NotNull Set<ContentFolderTypeProvider> set)
{
	HaxeModuleExtension extension = model.getExtension(HaxeModuleExtension.class);
	if(extension != null)
	{
		set.add(ProductionContentFolderTypeProvider.getInstance());
	}
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:10,代码来源:HaxeContentFolderSupportPatcher.java


示例10: patch

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@Override
public void patch(@NotNull ModifiableRootModel model, @NotNull Set<ContentFolderTypeProvider> set)
{
	DotNetModuleExtension extension = model.getExtension(DotNetModuleExtension.class);
	if(extension != null && extension.isAllowSourceRoots())
	{
		set.add(ProductionContentFolderTypeProvider.getInstance());
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:10,代码来源:DotNetContentFolderSupportPatcher.java


示例11: getFiles

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@NotNull
@Override
public VirtualFile[] getFiles(@NotNull ModuleRootModel moduleRootModel, @NotNull Predicate<ContentFolderTypeProvider> predicate)
{
	if(predicate.apply(ProductionContentFolderTypeProvider.getInstance()))
	{
		return moduleRootModel.getContentRoots();
	}
	return VirtualFile.EMPTY_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:11,代码来源:DotNetModuleRootsProcessor.java


示例12: getUrls

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@NotNull
@Override
public String[] getUrls(@NotNull ModuleRootModel moduleRootModel, @NotNull Predicate<ContentFolderTypeProvider> predicate)
{
	if(predicate.apply(ProductionContentFolderTypeProvider.getInstance()))
	{
		return moduleRootModel.getContentRootUrls();
	}
	return ArrayUtil.EMPTY_STRING_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:11,代码来源:DotNetModuleRootsProcessor.java


示例13: addSourceContentToRoots

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
public static void addSourceContentToRoots(final Module module, @Nonnull final VirtualFile vDir, final boolean testSource) {
  new WriteCommandAction.Simple(module.getProject()) {
    @Override
    protected void run() throws Throwable {
      final ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
      final ModifiableRootModel rootModel = rootManager.getModifiableModel();
      final ContentEntry contentEntry = rootModel.addContentEntry(vDir);
      contentEntry.addFolder(vDir, testSource ? TestContentFolderTypeProvider.getInstance() : ProductionContentFolderTypeProvider.getInstance());
      rootModel.commit();
    }
  }.execute().throwException();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:PsiTestUtil.java


示例14: addSourceRoot

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
public static void addSourceRoot(final Module module, final VirtualFile vDir, final boolean isTestSource) {
  new WriteCommandAction.Simple(module.getProject()) {
    @Override
    protected void run() throws Throwable {
      final ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
      final ModifiableRootModel rootModel = rootManager.getModifiableModel();
      ContentEntry entry = findContentEntry(rootModel, vDir);
      if (entry == null) entry = rootModel.addContentEntry(vDir);
      entry.addFolder(vDir, isTestSource ? TestContentFolderTypeProvider.getInstance() : ProductionContentFolderTypeProvider.getInstance());
      rootModel.commit();
    }
  }.execute().throwException();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:PsiTestUtil.java


示例15: getModuleOutputDirectory

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@Override
public VirtualFile getModuleOutputDirectory(final Module module) {
  return ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile>() {
    @Override
    public VirtualFile compute() {
      return ModuleCompilerPathsManager.getInstance(module)
        .getCompilerOutput(ProductionContentFolderTypeProvider.getInstance());
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:DummyCompileContext.java


示例16: buildOutputRootsLayout

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
private TIntObjectHashMap<Pair<Integer, Integer>> buildOutputRootsLayout(ProjectRef projRef) {
  final TIntObjectHashMap<Pair<Integer, Integer>> map = new TIntObjectHashMap<Pair<Integer, Integer>>();
  for (Module module : ModuleManager.getInstance(projRef.get()).getModules()) {
    ModuleCompilerPathsManager moduleCompilerPathsManager = ModuleCompilerPathsManager.getInstance(module);

    final VirtualFile output = moduleCompilerPathsManager.getCompilerOutput(ProductionContentFolderTypeProvider.getInstance());
    final int first = output != null ? Math.abs(getFileId(output)) : -1;
    final VirtualFile testsOutput = moduleCompilerPathsManager.getCompilerOutput(TestContentFolderTypeProvider.getInstance());
    final int second = testsOutput != null ? Math.abs(getFileId(testsOutput)) : -1;
    map.put(getModuleId(module), new Pair<Integer, Integer>(first, second));
  }
  return map;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:TranslatingCompilerFilesMonitorImpl.java


示例17: recalculateOutputDirs

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@Override
public void recalculateOutputDirs() {
  final Module[] allModules = ModuleManager.getInstance(myProject).getModules();

  final Set<VirtualFile> allDirs = new OrderedSet<VirtualFile>();
  final Set<VirtualFile> testOutputDirs = new java.util.HashSet<VirtualFile>();
  final Set<VirtualFile> productionOutputDirs = new java.util.HashSet<VirtualFile>();

  for (Module module : allModules) {
    ModuleCompilerPathsManager moduleCompilerPathsManager = ModuleCompilerPathsManager.getInstance(module);

    final VirtualFile output = moduleCompilerPathsManager.getCompilerOutput(ProductionContentFolderTypeProvider.getInstance());
    if (output != null && output.isValid()) {
      allDirs.add(output);
      productionOutputDirs.add(output);
    }

    final VirtualFile testsOutput = moduleCompilerPathsManager.getCompilerOutput(TestContentFolderTypeProvider.getInstance());
    if (testsOutput != null && testsOutput.isValid()) {
      allDirs.add(testsOutput);
      testOutputDirs.add(testsOutput);
    }
  }
  myOutputDirectories = VfsUtil.toVirtualFileArray(allDirs);
  // need this to ensure that the sent contains only _dedicated_ test output dirs
  // Directories that are configured for both test and production classes must not be added in the resulting set
  testOutputDirs.removeAll(productionOutputDirs);
  myTestOutputDirectories = Collections.unmodifiableSet(testOutputDirs);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:CompileContextImpl.java


示例18: getOutputForFile

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
@Override
public VirtualFile getOutputForFile(Module module, VirtualFile virtualFile) {
  ContentFolderTypeProvider contentFolderTypeForFile = myProjectFileIndex.getContentFolderTypeForFile(virtualFile);
  if (contentFolderTypeForFile == null) {
    contentFolderTypeForFile = ProductionContentFolderTypeProvider.getInstance();
  }

  return getOutputForFile(module, contentFolderTypeForFile);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:CompileContextImpl.java


示例19: syncPaths

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
private static void syncPaths(@Nonnull Module module, @Nonnull ModuleData data) {
  ModuleCompilerPathsManager compilerPathsManager = ModuleCompilerPathsManager.getInstance(module);
  compilerPathsManager.setInheritedCompilerOutput(data.isInheritProjectCompileOutputPath());
  if (!data.isInheritProjectCompileOutputPath()) {
    String compileOutputPath = data.getCompileOutputPath(ExternalSystemSourceType.SOURCE);
    if (compileOutputPath != null) {
      compilerPathsManager.setCompilerOutputUrl(ProductionContentFolderTypeProvider.getInstance(), VfsUtilCore.pathToUrl(compileOutputPath));
    }
    String testCompileOutputPath = data.getCompileOutputPath(ExternalSystemSourceType.TEST);
    if (testCompileOutputPath != null) {
      compilerPathsManager.setCompilerOutputUrl(TestContentFolderTypeProvider.getInstance(), VfsUtilCore.pathToUrl(testCompileOutputPath));
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:ModuleDataService.java


示例20: toField

import consulo.roots.impl.ProductionContentFolderTypeProvider; //导入依赖的package包/类
private CommitableFieldPanel toField(ContentFolderTypeProvider contentFolderTypeProvider) {
  if (contentFolderTypeProvider == ProductionContentFolderTypeProvider.getInstance()) {
    return myOutputPathPanel;
  }
  else if (contentFolderTypeProvider == ProductionResourceContentFolderTypeProvider.getInstance()) {
    return myResourcesOutputPathPanel;
  }
  else if (contentFolderTypeProvider == TestContentFolderTypeProvider.getInstance()) {
    return myTestsOutputPathPanel;
  }
  else if (contentFolderTypeProvider == TestResourceContentFolderTypeProvider.getInstance()) {
    return myTestResourcesOutputPathPanel;
  }
  throw new IllegalArgumentException(contentFolderTypeProvider.getId());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:BuildElementsEditor.java



注:本文中的consulo.roots.impl.ProductionContentFolderTypeProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AuthorizationException类代码示例发布时间:2022-05-22
下一篇:
Java IParticleInitializer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap