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


Java Facet类代码示例

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


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

示例1: remove

import com.intellij.facet.Facet; //导入依赖的package包/类
@Override
public boolean remove(@NotNull Collection<Module> modules) {
  ModulesConfigurator modulesConfigurator = myContext.myModulesConfigurator;
  List<Module> deleted = modulesConfigurator.deleteModules(modules);
  if (deleted.isEmpty()) {
    return false;
  }
  for (Module module : deleted) {
    List<Facet> removed = modulesConfigurator.getFacetsConfigurator().removeAllFacets(module);
    FacetStructureConfigurable.getInstance(myProject).removeFacetNodes(removed);
    myContext.getDaemonAnalyzer().removeElement(new ModuleProjectStructureElement(myContext, module));

    for (final ModuleStructureExtension extension : ModuleStructureExtension.EP_NAME.getExtensions()) {
      extension.moduleRemoved(module);
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ModuleStructureConfigurable.java

示例2: showFacetSettingsDialog

import com.intellij.facet.Facet; //导入依赖的package包/类
public static boolean showFacetSettingsDialog(@NotNull final Facet facet,
                                              @Nullable final String tabNameToSelect) {
  final Project project = facet.getModule().getProject();
  final ProjectStructureConfigurable config = ProjectStructureConfigurable.getInstance(project);
  return ShowSettingsUtil.getInstance().editConfigurable(project, config, new Runnable() {
    @Override
    public void run() {
      final ModuleStructureConfigurable modulesConfig = config.getModulesConfig();
      config.select(facet, true).doWhenDone(new Runnable() {
        @Override
        public void run() {
          if (tabNameToSelect != null) {
            FacetEditorImpl facetEditor = modulesConfig.getFacetConfigurator().getOrCreateEditor(facet);
            facetEditor.setSelectedTabName(tabNameToSelect);
          }
        }
      });
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ModulesConfigurator.java

示例3: addRootsFromModule

import com.intellij.facet.Facet; //导入依赖的package包/类
private static void addRootsFromModule(Module module, Collection<String> pythonPathList) {

    // for Jython
    final CompilerModuleExtension extension = CompilerModuleExtension.getInstance(module);
    if (extension != null) {
      final VirtualFile path = extension.getCompilerOutputPath();
      if (path != null) {
        pythonPathList.add(path.getPath());
      }
      final VirtualFile pathForTests = extension.getCompilerOutputPathForTests();
      if (pathForTests != null) {
        pythonPathList.add(pathForTests.getPath());
      }
    }

    //additional paths from facets (f.e. buildout)
    final Facet[] facets = FacetManager.getInstance(module).getAllFacets();
    for (Facet facet : facets) {
      if (facet instanceof PythonPathContributingFacet) {
        List<String> more_paths = ((PythonPathContributingFacet)facet).getAdditionalPythonPath();
        if (more_paths != null) pythonPathList.addAll(more_paths);
      }
    }
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PythonCommandLineState.java

示例4: createAllFacetsEditor

import com.intellij.facet.Facet; //导入依赖的package包/类
@Nullable
private MultipleFacetSettingsEditor createAllFacetsEditor() {
  ProjectFacetsConfigurator facetsConfigurator = myContext.myModulesConfigurator.getFacetsConfigurator();
  List<Facet> facets = new ArrayList<Facet>();
  for (Module module : myContext.getModules()) {
    facets.addAll(facetsConfigurator.getFacetsByType(module, myFacetType.getId()));
  }
  if (!facets.isEmpty()) {
    final FacetEditor[] editors = new FacetEditor[facets.size()];
    for (int i = 0; i < facets.size(); i++) {
      editors[i] = facetsConfigurator.getOrCreateEditor(facets.get(i));
    }
    return myFacetType.createMultipleConfigurationsEditor(myProject, editors);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FacetTypeEditor.java

示例5: BuildoutFacet

import com.intellij.facet.Facet; //导入依赖的package包/类
public BuildoutFacet(@NotNull final FacetType facetType,
                     @NotNull final Module module,
                     @NotNull final String name,
                     @NotNull final BuildoutFacetConfiguration configuration, Facet underlyingFacet) {
  super(facetType, module, name, configuration, underlyingFacet);

  VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
    @Override
    public void contentsChanged(@NotNull VirtualFileEvent event) {
      if (Comparing.equal(event.getFile(), getScript())) {
        updatePaths();
        attachLibrary(module);
      }
    }
  }, this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:BuildoutFacet.java

示例6: getSortedFacets

import com.intellij.facet.Facet; //导入依赖的package包/类
@Override
@NotNull
public Facet[] getSortedFacets() {
  if (mySortedFacets == null) {
    final Facet[] allFacets = getAllFacets();
    if (allFacets.length == 0) {
      mySortedFacets = Facet.EMPTY_ARRAY;
    }
    else {
      LinkedHashSet<Facet> facets = new LinkedHashSet<Facet>();
      for (Facet facet : allFacets) {
        addUnderlyingFacets(facets, facet);
      }
      mySortedFacets = facets.toArray(new Facet[facets.size()]);
    }
  }
  return mySortedFacets;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:FacetModelBase.java

示例7: setMuleFacet

import com.intellij.facet.Facet; //导入依赖的package包/类
public void setMuleFacet(Module module) {
    MuleFacetType type = (MuleFacetType)FacetTypeRegistry.getInstance().findFacetType(MuleFacet.ID);
    MuleFacetConfiguration configuration = type.createDefaultConfiguration();
    configuration.setPathToSdk(MuleSdkManager.getInstance().findFromVersion(muleVersion).getMuleHome());
    Facet facet = type.createFacet(module, type.getPresentableName(), configuration, null);
    ModifiableFacetModel model = FacetManager.getInstance(module).createModifiableModel();
    model.addFacet(facet);
    model.commit();
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:10,代码来源:MuleMavenModuleBuilder.java

示例8: MuleFacet

import com.intellij.facet.Facet; //导入依赖的package包/类
public MuleFacet(FacetType facetType,
                 Module module,
                 String name,
                 MuleFacetConfiguration configuration,
                 Facet underlyingFacet) {
    super(facetType, module, name, configuration, underlyingFacet);
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:8,代码来源:MuleFacet.java

示例9: findLuaSdk

import com.intellij.facet.Facet; //导入依赖的package包/类
public static Sdk findLuaSdk(Module module) {
    if (module == null) return null;
    final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
    if (sdk != null && sdk.getSdkType() instanceof LuaSdkType) return sdk;
    final Facet[] facets = FacetManager.getInstance(module).getAllFacets();
    for (Facet facet : facets) {
        final FacetConfiguration configuration = facet.getConfiguration();
        if (configuration instanceof LuaFacetConfiguration) {
            return ((LuaFacetConfiguration)configuration).getSdk();
        }
    }
    return null;
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:14,代码来源:LuaSdkType.java

示例10: actionPerformed

import com.intellij.facet.Facet; //导入依赖的package包/类
public void actionPerformed(AnActionEvent event) {
    Project project = event.getData(PlatformDataKeys.PROJECT);
    String pluginName = project.getName();
    String sourceRootsList = "";
    VirtualFile[] VFiles = ProjectRootManager.getInstance(project).getContentSourceRoots();
    for (int i = 0; i <= VFiles.length - 1; i++) {
        sourceRootsList += VFiles[i].getUrl() + "\n";

    }
    //System.out.println("sourceRootsList"+sourceRootsList);
    //   Messages.showInfoMessage("Source roots for the " + pluginName + " plugin:\n" + sourceRootsList, "Project Properties");


    Module[] allModules = ModuleManager.getInstance(project).getModules();
    String modulesList = "List of modules and module files in the " + project.getName() + " plugin:\n\n";
    for (int i = 0; i <= allModules.length - 1; i++) {
        modulesList += allModules[i].getName() + " " + allModules[i].getModuleFilePath() + "\n";
    }
    //System.out.println("modulesList"+modulesList);



    // Get a list of all modules the specified project includes
    String facetsList = "List of facets for modules in the " + project.getName() + " plugin:\n\n";
    for (int i = 0; i <= allModules.length - 1; i++) {
        // Get a list of all facets the module allModules[i] includes
        Facet[] facets = DefaultFacetsProvider.INSTANCE.getAllFacets(allModules[i]);
        facetsList += "Facets in the " + allModules[i].getName() + " module:\n";
        for (int j=0; j<= facets.length-1; j++){
            facetsList += facets[j].getName() + "\n";


        }


    }

    //System.out.println("facetsList"+facetsList);

}
 
开发者ID:sergenes,项目名称:AllProjects,代码行数:41,代码来源:AllProjects.java

示例11: select

import com.intellij.facet.Facet; //导入依赖的package包/类
public ActionCallback select(@Nullable final Facet facetToSelect, final boolean requestFocus) {
  Place place = createModulesPlace();
  if (facetToSelect != null) {
    place = place.putPath(ModuleStructureConfigurable.TREE_OBJECT, facetToSelect);
  }
  return navigateTo(place, requestFocus);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ProjectStructureConfigurable.java

示例12: createFacet

import com.intellij.facet.Facet; //导入依赖的package包/类
@NotNull
@Override
public AndroidGradleFacet createFacet(@NotNull Module module,
                                      @NotNull String name,
                                      @NotNull AndroidGradleFacetConfiguration configuration,
                                      @Nullable Facet underlyingFacet) {
  return new AndroidGradleFacet(module, name, configuration);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AndroidGradleFacetType.java

示例13: removeFacetNodes

import com.intellij.facet.Facet; //导入依赖的package包/类
protected void removeFacetNodes(@NotNull List<Facet> facets) {
  for (Facet facet : facets) {
    MyNode node = findNodeByObject(myRoot, facet);
    if (node != null) {
      removePaths(TreeUtil.getPathFromRoot(node));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BaseStructureConfigurable.java

示例14: getProjectStructureElementFor

import com.intellij.facet.Facet; //导入依赖的package包/类
@Nullable
public static ProjectStructureElement getProjectStructureElementFor(PackagingElement<?> packagingElement,
                                                                     final StructureConfigurableContext context,
                                                                     final ArtifactsStructureConfigurableContext artifactsStructureContext) {
  if (packagingElement instanceof ModuleOutputPackagingElement) {
    final Module module = ((ModuleOutputPackagingElement)packagingElement).findModule(artifactsStructureContext);
    if (module != null) {
      return new ModuleProjectStructureElement(context, module);
    }
  }
  else if (packagingElement instanceof LibraryPackagingElement) {
    final Library library = ((LibraryPackagingElement)packagingElement).findLibrary(artifactsStructureContext);
    if (library != null) {
      return new LibraryProjectStructureElement(context, library);
    }
  }
  else if (packagingElement instanceof ArtifactPackagingElement) {
    final Artifact usedArtifact = ((ArtifactPackagingElement)packagingElement).findArtifact(artifactsStructureContext);
    if (usedArtifact != null) {
      return artifactsStructureContext.getOrCreateArtifactElement(usedArtifact);
    }
  }
  else if (packagingElement instanceof FacetBasedPackagingElement) {
    Facet facet = ((FacetBasedPackagingElement)packagingElement).findFacet(artifactsStructureContext);
    if (facet != null) {
      return new FacetProjectStructureElement(context, facet);
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ArtifactProjectStructureElement.java

示例15: ProjectConfigurableContext

import com.intellij.facet.Facet; //导入依赖的package包/类
public ProjectConfigurableContext(final @NotNull Facet facet, final boolean isNewFacet,
                                  @Nullable FacetEditorContext parentContext,
                                  final ModuleConfigurationState state, final UserDataHolder sharedModuleData,
                                  final UserDataHolder sharedProjectData) {
  super(facet, parentContext, state.getFacetsProvider(), state.getModulesProvider(), sharedModuleData, sharedProjectData);
  myModuleConfigurationState = state;
  myNewFacet = isNewFacet;
  myModule = facet.getModule();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ProjectConfigurableContext.java


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