use of com.intellij.facet.impl.ui.FacetEditorImpl in project intellij-community by JetBrains.
the class ProjectFacetsConfigurator method applyEditors.
public void applyEditors() throws ConfigurationException {
for (Map.Entry<Facet, FacetEditorImpl> entry : myEditors.entrySet()) {
final FacetEditorImpl editor = entry.getValue();
if (editor.isModified()) {
myChangedFacets.add(entry.getKey());
}
editor.apply();
}
}
use of com.intellij.facet.impl.ui.FacetEditorImpl in project intellij-community by JetBrains.
the class ProjectFacetsConfigurator method getOrCreateEditor.
@NotNull
public FacetEditorImpl getOrCreateEditor(Facet facet) {
FacetEditorImpl editor = myEditors.get(facet);
if (editor == null) {
final Facet underlyingFacet = facet.getUnderlyingFacet();
final FacetEditorContext parentContext = underlyingFacet != null ? getOrCreateEditor(underlyingFacet).getContext() : null;
final FacetEditorContext context = createContext(facet, parentContext);
editor = new FacetEditorImpl(context, facet.getConfiguration());
editor.getComponent();
editor.reset();
myEditors.put(facet, editor);
}
return editor;
}
use of com.intellij.facet.impl.ui.FacetEditorImpl in project intellij-community by JetBrains.
the class ProjectFacetsConfigurator method removeFacet.
public List<Facet> removeFacet(Facet facet) {
FacetTreeModel treeModel = getTreeModel(facet.getModule());
FacetInfo facetInfo = myFacet2Info.get(facet);
if (facetInfo == null)
return Collections.emptyList();
final List<Facet> removed = new ArrayList<>();
List<FacetInfo> childrenList = treeModel.getChildren(facetInfo);
FacetInfo[] children = childrenList.toArray(new FacetInfo[childrenList.size()]);
for (FacetInfo child : children) {
Facet childInfo = myInfo2Facet.get(child);
if (childInfo != null) {
removed.addAll(removeFacet(childInfo));
}
}
treeModel.removeFacetInfo(facetInfo);
getOrCreateModifiableModel(facet.getModule()).removeFacet(facet);
myChangedFacets.remove(facet);
if (myCreatedFacets.contains(facet)) {
Disposer.dispose(facet);
}
final FacetEditorImpl facetEditor = myEditors.remove(facet);
if (facetEditor != null) {
facetEditor.disposeUIResources();
}
myFacet2Info.remove(facet);
myInfo2Facet.remove(facetInfo);
removed.add(facet);
return removed;
}
use of com.intellij.facet.impl.ui.FacetEditorImpl in project intellij-community by JetBrains.
the class ProjectFacetsConfigurator method disposeEditors.
public void disposeEditors() {
for (Facet facet : myFacetsToDispose) {
Disposer.dispose(facet);
}
myFacetsToDispose.clear();
myCreatedFacets.clear();
for (FacetEditorImpl editor : myEditors.values()) {
editor.disposeUIResources();
}
myProjectData = null;
}
use of com.intellij.facet.impl.ui.FacetEditorImpl in project intellij-community by JetBrains.
the class ProjectFacetsConfigurator method commitFacets.
public void commitFacets() {
for (ModifiableFacetModel model : myModifiableModels.values()) {
model.commit();
}
for (Map.Entry<Facet, FacetEditorImpl> entry : myEditors.entrySet()) {
entry.getValue().onFacetAdded(entry.getKey());
}
myModifiableModels.clear();
for (Facet facet : myChangedFacets) {
Module module = facet.getModule();
if (!module.isDisposed()) {
module.getMessageBus().syncPublisher(FacetManager.FACETS_TOPIC).facetConfigurationChanged(facet);
}
}
myChangedFacets.clear();
}
Aggregations