private void remove() {
    final SimpleNode[] nodes = myTree.getSelectedNodesIfUniform();
    for (final SimpleNode node : nodes) {

      if (node instanceof FileSetNode) {
        final OfbizFileSet fileSet = ((FileSetNode) node).mySet;
        if (fileSet.getFiles().isEmpty()) {
          myBuffer.remove(fileSet);
          return;
        }

        final int result =
            Messages.showYesNoDialog(
                myPanel,
                String.format("Remove File Set '%s' ?", fileSet.getName()),
                "Confirm removal",
                Messages.getQuestionIcon());
        if (result == DialogWrapper.OK_EXIT_CODE) {
          if (fileSet.isAutodetected()) {
            fileSet.setRemoved(true);
            myBuffer.add(fileSet);
          } else {
            myBuffer.remove(fileSet);
          }
        }
      } else if (node instanceof ConfigFileNode) {
        final VirtualFilePointer filePointer = ((ConfigFileNode) node).myFilePointer;
        final OfbizFileSet fileSet = ((FileSetNode) node.getParent()).mySet;
        fileSet.removeFile(filePointer);
      }
    }
  }
 @Nullable
 private FileSetNode getCurrentFileSetNode() {
   final SimpleNode selectedNode = myTree.getSelectedNode();
   if (selectedNode == null) {
     return null;
   }
   if (selectedNode instanceof FileSetNode) {
     return (FileSetNode) selectedNode;
   } else if (selectedNode.getParent() instanceof FileSetNode) {
     return (FileSetNode) selectedNode.getParent();
   } else {
     final SimpleNode parent = selectedNode.getParent();
     if (parent != null && parent.getParent() instanceof FileSetNode) {
       return (FileSetNode) selectedNode.getParent().getParent();
     }
   }
   return null;
 }
 @Override
 public boolean shouldBeShowing(SimpleNode node) {
   if (myFiltered != null) {
     Configurable configurable = getConfigurable(node);
     if (configurable != null) {
       if (!myFiltered.contains(configurable)) {
         if (myHits != null) {
           Set<Configurable> configurables = myHits.getNameFullHits();
           while (node != null) {
             if (configurable != null) {
               if (configurables.contains(configurable)) {
                 return true;
               }
             }
             node = node.getParent();
             configurable = getConfigurable(node);
           }
         }
         return false;
       }
     }
   }
   return true;
 }