COpied change from 1.4 branch where the setMode method is protected.
Authored by: keess 2008-06-11
Parent: [r2043]
Child: [r2045]