IDEA-252890 event `pluginUnloaded` should be fired after `forbidGettingServicesToken...
[idea/community.git] / platform / lang-api / src / com / intellij / facet / ModifiableFacetModel.java
index aabd7c4a099d4bcf9bed8eac9f22bef450fac90c..0944f436bebcc9685d2abcfa25883e7aee00168f 100644 (file)
@@ -29,6 +29,13 @@ public interface ModifiableFacetModel extends FacetModel {
   void addFacet(Facet<?> facet, @Nullable ProjectModelExternalSource externalSource);
   void removeFacet(Facet<?> facet);
 
+  /**
+   * Replaces {@code original} facet by {@code replacement}. The only difference with {@code removeFacet(original); addFacet(replacement); }
+   * is that this method preserves order of facets in internal structures to avoid modifications of *.iml files.
+   */
+  @ApiStatus.Internal
+  void replaceFacet(@NotNull Facet<?> original, @NotNull Facet<?> replacement);
+
   void rename(Facet<?> facet, String newName);
 
   @Nullable