Java code for AmsEditor