Dear JT,
What a 7 year - old is told depends on a number of things, such as his/her maturity level, the circumstances, the need to know, the collaboration between parents, the possible outcomes of court, etc.
Certainly no child should have to bear the burden of figuring out all the adult problems. Nor, should he have to be part of the solution. However, when one parent puts the child in this situation the child instantly matures. Thus, your need to say a little more. Try not to speak poorly of your X, but rather explain the situation - including the role of the judge to help everyone get fair and equal chance to be apart of his life.
Try to let your child know, he is loved so very much and sometimes love panics and does dumb things. Assure him you will always be there for him. I would tell a 7 y.o. "I will do the worrying, you be the child .... if you need to worry I'll let you know>" End that with a big hug.
Best of luck.
DR. D