Refactor selestion event processing in IdeCodeListener