private void addFacetNode(Facet facet) {
   MasterDetailsComponent.MyNode moduleNode =
       myStructureConfigurable.findModuleNode(facet.getModule());
   if (moduleNode == null) return;
   addFacetNode(facet, moduleNode);
   final FacetStructureConfigurable facetStructureConfigurable =
       FacetStructureConfigurable.getInstance(myStructureConfigurable.getProject());
   final MasterDetailsComponent.MyNode facetTypeNode =
       facetStructureConfigurable.getOrCreateFacetTypeNode(facet.getType());
   LOG.assertTrue(facetTypeNode != null, "Cannot found node for " + facet.getType());
   facetStructureConfigurable.addFacetNodes(facetTypeNode, Collections.singletonList(facet), this);
 }
 @Nullable
 private Facet getSelectedFacet() {
   final Object selectedObject = myStructureConfigurable.getSelectedObject();
   if (selectedObject instanceof Facet) {
     return (Facet) selectedObject;
   }
   return null;
 }
 public FacetConfigurable getOrCreateConfigurable(final Facet facet) {
   FacetConfigurable configurable = myConfigurables.get(facet);
   if (configurable == null) {
     configurable =
         new FacetConfigurable(facet, myStructureConfigurable.getContext(), myTreeUpdater);
     myConfigurables.put(facet, configurable);
   }
   return configurable;
 }
 @Nullable
 private Module getSelectedModule() {
   final Object selected = myStructureConfigurable.getSelectedObject();
   if (selected instanceof Module) {
     return (Module) selected;
   }
   if (selected instanceof Facet) {
     return ((Facet) selected).getModule();
   }
   return null;
 }
  private MasterDetailsComponent.MyNode addFacetNode(
      final Facet facet, final MasterDetailsComponent.MyNode moduleNode) {
    final MasterDetailsComponent.MyNode existing = findFacetNode(facet, moduleNode);
    if (existing != null) return existing;

    final FacetConfigurable facetConfigurable = getOrCreateConfigurable(facet);
    final MasterDetailsComponent.MyNode facetNode =
        new MasterDetailsComponent.MyNode(facetConfigurable);
    myNodes.put(facet, facetNode);
    MasterDetailsComponent.MyNode parent = moduleNode;
    final Facet underlyingFacet = facet.getUnderlyingFacet();
    if (underlyingFacet != null) {
      parent = myNodes.get(underlyingFacet);
      LOG.assertTrue(parent != null);
    }
    myStructureConfigurable.addNode(facetNode, parent);
    return facetNode;
  }
 private ProjectFacetsConfigurator getFacetConfigurator() {
   return myStructureConfigurable.getFacetConfigurator();
 }