Backported Print class from ide-1.5.x branch

Close #1951