use of com.intellij.facet.impl.ui.FacetTreeModel in project intellij-community by JetBrains.
the class ProjectFacetsConfigurator method getTreeModel.
public FacetTreeModel getTreeModel(Module module) {
FacetTreeModel treeModel = myTreeModels.get(module);
if (treeModel == null) {
treeModel = new FacetTreeModel();
myTreeModels.put(module, treeModel);
}
return treeModel;
}
use of com.intellij.facet.impl.ui.FacetTreeModel 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.FacetTreeModel in project intellij-community by JetBrains.
the class FacetEditorFacadeImpl method nodeHasFacetOfType.
@Override
public boolean nodeHasFacetOfType(final FacetInfo facet, FacetTypeId typeId) {
final Module selectedModule = getSelectedModule();
if (selectedModule == null) {
return false;
}
final FacetTreeModel facetTreeModel = getFacetConfigurator().getTreeModel(selectedModule);
return facetTreeModel.hasFacetOfType(facet, typeId);
}
use of com.intellij.facet.impl.ui.FacetTreeModel in project intellij-community by JetBrains.
the class ProjectFacetsConfigurator method hasFacetOfType.
public boolean hasFacetOfType(Module module, @Nullable Facet parent, FacetTypeId<?> typeId) {
final FacetTreeModel treeModel = getTreeModel(module);
final FacetInfo parentInfo = getFacetInfo(parent);
return treeModel.hasFacetOfType(parentInfo, typeId);
}
Aggregations