com.intellij.facet.Facet Java Examples

The following examples show how to use com.intellij.facet.Facet. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QuarkusProjectDataService.java    From intellij-quarkus with Eclipse Public License 2.0 5 votes vote down vote up
private static void ensureQuarkusFacet(Module module, IdeModifiableModelsProvider modelsProvider, ProjectSystemId externalSystemId) {
    FacetType<QuarkusFacet, QuarkusFacetConfiguration> facetType = QuarkusFacet.getQuarkusFacetType();
    ModifiableFacetModel facetModel = modelsProvider.getModifiableFacetModel(module);
    QuarkusFacet facet = facetModel.getFacetByType(facetType.getId());
    if (facet == null) {
        facet = facetType.createFacet(module, facetType.getDefaultFacetName(), facetType.createDefaultConfiguration(), (Facet)null);
        facetModel.addFacet(facet, ExternalSystemApiUtil.toExternalSource(externalSystemId));
    }
}
 
Example #2
Source File: DemoFacet.java    From intellij-sdk-docs with Apache License 2.0 5 votes vote down vote up
public DemoFacet(FacetType facetType,
                 Module module,
                 String name,
                 DemoFacetConfiguration configuration,
                 Facet underlyingFacet) {
  super(facetType, module, name, configuration, underlyingFacet);
}
 
Example #3
Source File: DWFrameworkSupportConfigurable.java    From intellij-demandware with MIT License 5 votes vote down vote up
@Override
public void addSupport(@NotNull Module module, @NotNull ModifiableRootModel modifiableRootModel, @Nullable Library library) {
    final FacetManager facetManager = FacetManager.getInstance(module);
    ModifiableFacetModel facetModel = facetManager.createModifiableModel();
    DWSettingsProvider dwSettingsProvider = ModuleServiceManager.getService(module, DWSettingsProvider.class);
    dwSettingsProvider.setPasswordKey(UUID.randomUUID().toString());
    dwSettingsProvider.setHostname(dwFrameworkSupportConfigurablePanel.getHostname());
    dwSettingsProvider.setUsername(dwFrameworkSupportConfigurablePanel.getUsername());
    dwSettingsProvider.setPassword(dwFrameworkSupportConfigurablePanel.getPassword());
    dwSettingsProvider.setVersion(dwFrameworkSupportConfigurablePanel.getVersion());
    dwSettingsProvider.setAutoUploadEnabled(dwFrameworkSupportConfigurablePanel.getAutoUploadEnabled());
    Facet facet = FacetManager.getInstance(modifiableRootModel.getModule()).addFacet(DWFacetType.INSTANCE, "Demandware", null);
    facetModel.addFacet(facet);
    facetModel.commit();
}
 
Example #4
Source File: DWFacet.java    From intellij-demandware with MIT License 5 votes vote down vote up
public DWFacet(FacetType facetType,
               Module module,
               String name,
               DWFacetConfiguration configuration,
               Facet underlyingFacet) {
    super(facetType, module, name, configuration, underlyingFacet);
    Disposer.register(this, configuration);
}
 
Example #5
Source File: PolygeneFacet.java    From attic-polygene-java with Apache License 2.0 5 votes vote down vote up
public PolygeneFacet( @NotNull FacetType facetType,
                  @NotNull Module module,
                  String name,
                  @NotNull PolygeneFacetConfiguration configuration,
                  Facet underlyingFacet
)
{
    super( facetType, module, name, configuration, underlyingFacet );
}
 
Example #6
Source File: PolygeneFacetType.java    From attic-polygene-java with Apache License 2.0 5 votes vote down vote up
public final PolygeneFacet createFacet( @NotNull Module module,
                                    String name,
                                    @NotNull PolygeneFacetConfiguration configuration,
                                    @Nullable Facet underlyingFacet )
{
    return new PolygeneFacet( this, module, name, configuration, underlyingFacet );
}
 
Example #7
Source File: MuleMavenModuleBuilder.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #8
Source File: MuleFacet.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
public MuleFacet(FacetType facetType,
                 Module module,
                 String name,
                 MuleFacetConfiguration configuration,
                 Facet underlyingFacet) {
    super(facetType, module, name, configuration, underlyingFacet);
}
 
Example #9
Source File: FlutterModuleUtils.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static boolean isInFlutterAndroidModule(@NotNull Project project, @NotNull VirtualFile file) {
  final Module module = FlutterBuildActionGroup.findFlutterModule(project, file);
  if (module != null) {
    for (Facet<?> facet : FacetManager.getInstance(module).getAllFacets()) {
      if ("Android".equals(facet.getName())) {
        return declaresFlutter(project);
      }
    }
  }
  return false;
}
 
Example #10
Source File: FlutterModuleUtils.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static boolean isInFlutterAndroidModule(@NotNull Project project, @NotNull VirtualFile file) {
  final Module module = FlutterBuildActionGroup.findFlutterModule(project, file);
  if (module != null) {
    for (Facet<?> facet : FacetManager.getInstance(module).getAllFacets()) {
      if ("Android".equals(facet.getName())) {
        return declaresFlutter(project);
      }
    }
  }
  return false;
}
 
Example #11
Source File: BlazePythonSyncPlugin.java    From intellij with Apache License 2.0 5 votes vote down vote up
private static LibraryContributingFacet<?> findPythonFacet(Module module) {
  final Facet<?>[] allFacets = FacetManager.getInstance(module).getAllFacets();
  for (Facet<?> facet : allFacets) {
    if ((facet instanceof LibraryContributingFacet)
        && (facet.getTypeId() == PythonFacetUtil.getFacetId())) {
      return (LibraryContributingFacet<?>) facet;
    }
  }
  return null;
}
 
Example #12
Source File: MindMapFacet.java    From netbeans-mmd-plugin with Apache License 2.0 5 votes vote down vote up
public MindMapFacet(@Nonnull final FacetType facetType, @Nonnull final Module module,
                    @Nonnull final String name, @Nonnull final MindMapFacetConfiguration configuration, final Facet underlyingFacet) {
  super(facetType, module, name, configuration, underlyingFacet);

  if (!this.getConfiguration().isDisableAutoCreateProjectKnowledgeFolder()) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {

      @Override
      public void run() {
        IdeaUtils.findKnowledgeFolderForModule(module, true);
      }

    });
  }
}
 
Example #13
Source File: ThriftFacetType.java    From intellij-thrift with Apache License 2.0 4 votes vote down vote up
@Override
public ThriftFacet createFacet(@NotNull Module module, String name, @NotNull ThriftFacetConf configuration, Facet underlyingFacet) {
  return new ThriftFacet(module, name, configuration, underlyingFacet);
}
 
Example #14
Source File: ThriftFacet.java    From intellij-thrift with Apache License 2.0 4 votes vote down vote up
public ThriftFacet(Module module,
                   String name,
                   ThriftFacetConf configuration, Facet underlyingFacet) {
  super(TYPE, module, name, configuration, underlyingFacet);
}
 
Example #15
Source File: DWFacetType.java    From intellij-demandware with MIT License 4 votes vote down vote up
@Override
public DWFacet createFacet(@NotNull Module module, String name, @NotNull DWFacetConfiguration configuration, Facet underlyingFacet) {
    return new DWFacet(this, module, name, configuration, underlyingFacet);
}
 
Example #16
Source File: MindMapFacetType.java    From netbeans-mmd-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public MindMapFacet createFacet(@Nonnull final Module module, final String name, @Nonnull final MindMapFacetConfiguration configuration, @Nullable final Facet underlyingFacet) {
  return new MindMapFacet(this, module, name, configuration, underlyingFacet);
}
 
Example #17
Source File: SlingModuleFacetType.java    From aem-ide-tooling-4-intellij with Apache License 2.0 4 votes vote down vote up
public SlingModuleFacet createFacet(@NotNull Module module, String name, @NotNull SlingModuleFacetConfiguration configuration, @Nullable Facet underlyingFacet) {
    return new SlingModuleFacet(this, module, name, configuration);
}
 
Example #18
Source File: ORFacetListener.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
private static void showHideDuneToolWindow(Project project, Facet facet) {
 if (facet instanceof DuneFacet) {
   ORToolWindowManager toolWindowManager = ORToolWindowManager.getInstance(project);
   ApplicationManager.getApplication().invokeLater(toolWindowManager::showHideToolWindows);
 }
}
 
Example #19
Source File: ORFacetListener.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
@Override
public void facetConfigurationChanged(@NotNull Facet facet) {}
 
Example #20
Source File: ORFacetListener.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
@Override
public void facetRemoved(@NotNull Facet facet) {
  showHideDuneToolWindow(m_project, facet);
}
 
Example #21
Source File: ORFacetListener.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
@Override
public void beforeFacetRemoved(@NotNull Facet facet) {}
 
Example #22
Source File: ORFacetListener.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
@Override
public void facetAdded(@NotNull Facet facet) {
  showHideDuneToolWindow(m_project, facet);
}
 
Example #23
Source File: DuneFacet.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
DuneFacet(@NotNull FacetType facetType, @NotNull Module module, @NotNull String name, @NotNull DuneFacetConfiguration configuration,
          Facet underlyingFacet) {
    super(facetType, module, name, configuration, underlyingFacet);
}
 
Example #24
Source File: DuneFacetType.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
@Nullable
@Override
public DuneFacet createFacet(@NotNull Module module, @NotNull String name, @NotNull DuneFacetConfiguration configuration, @Nullable Facet underlyingFacet) {
    return new DuneFacet(this, module, name, configuration, underlyingFacet);
}
 
Example #25
Source File: QuarkusFacet.java    From intellij-quarkus with Eclipse Public License 2.0 4 votes vote down vote up
protected QuarkusFacet(FacetType facetType, Module module, String name, QuarkusFacetConfiguration configuration, Facet underlyingFacet) {
    super(facetType, module, name, configuration, underlyingFacet);
}
 
Example #26
Source File: QuarkusFacetType.java    From intellij-quarkus with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public QuarkusFacet createFacet(@NotNull Module module, String name, @NotNull QuarkusFacetConfiguration configuration, @Nullable Facet underlyingFacet) {
    return new QuarkusFacet(this, module, name, configuration, underlyingFacet);
}
 
Example #27
Source File: ThriftFacetSupportProvider.java    From intellij-thrift with Apache License 2.0 2 votes vote down vote up
@Override
protected void setupConfiguration(Facet facet, ModifiableRootModel rootModel, FrameworkVersion version) {

}