You either need to extend this to also check whether suggestions are enabled, or make the simplifying assumption that all layouts that use the latin IM also need the candidate panel.  I'd prefer to make that assumption and just pass the language to setLanguate().