The courts and judges may issue attachments for contempt, and punish them summarily, only in the cases following:
(2. Violence, or threats of violence, to a judge or officer of the court, or to a juror, witness or party going to, attending or returning from the court, for or in respect of any act or proceeding had or to be had in such court;
(3. Vile, contemptuous or insulting language addressed to or published of a judge for or in respect of any act or proceeding had, or to be had, in such court, or like language used in his presence and intended for his hearing for or in respect of such act or proceeding;
Code 1950, § 18.1-292; 1960, c. 358; 1975, cc. 14, 15.