To enable escaping of pasted text open the Preferences panel ('Window' menu -> 'Preferences...' option), then choose: 'Java' -> 'Editor' -> 'Typing' and tick the box which says "Escape text when pasting in a string literal":

Now whenever you post in text which is broken over multiple lines, Eclipse will insert the relevant quotes of Java to make Eclipse happy.
source:
http://blog.andrewbeacock.com/2009/06/how-to-escape-text-when-pasting-into.html
No comments:
Post a Comment