You can quickly select Java code syntactically using the Structured Selection feature. Highlight the text and press Alt+Shift+Arrow Up or select Edit > Expands Selection To > Enclosing Element from the menu bar - the selection will be expanded to the smallest Java-syntax element that contains the selection. You can then further expand the selection by invoking the action again.