public void insertCriterion(final Criterion criterion) {
    final TreePath path = jtree.getCurrentCriterionPath();

    if (path == null) {
      return;
    }

    criterion.addListener(internalCriterionListener);

    final AbstractCriterionTreeNode node = (AbstractCriterionTreeNode) path.getLastPathComponent();
    final ICriterionTreeNode insertNode = findNode(ctree.getRoot(), node.getCriterion());

    ctree.insertNode(insertNode, new CriterionTreeNode(criterion));
  }
This class provides the basic operations of the expression, which are remove, insert and append
criterion.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/dialogs/criteriadialog/expressiontree/ExpressionTreeActionProvider.java