Court documents detail criminal history of man accused in Brookline shooting