当前位置: 首页>>代码示例>>Java>>正文


Java ProductionContentFolderTypeProvider类代码示例

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


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


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