- Opening the Source Editor
- Managing Automatic Insertion of Closing Characters
- Displaying Line Numbers
- Generating Code Snippets without Leaving the Keyboard
- Using Code Completion
- Inserting Snippets from Code Templates
- Using Editor Hints to Generate Missing Code
- Matching Other Words in a File
- Generating Methods to Implement and Override
- Generating JavaBeans Component Code
- Creating and Using Macros
- Creating and Customizing File Templates
- Handling Imports
- Displaying Javadoc Documentation While Editing
- Formatting Code
- Text Selection Shortcuts
- Navigating within the Current Java File
- Navigating from the Source Editor
- Searching and Replacing
- Deleting Code Safely
- Changing a Method's Signature
- Encapsulating a Field
- Moving a Class to a Different Package
- Moving Class Members to Other Classes
- Creating a Method from Existing Statements
- Creating an Interface from Existing Methods
- Extracting a Superclass to Consolidate Common Methods
- Changing References to Use a Supertype
- Unnesting Classes
- Tracking Notes to Yourself in Your Code
- Comparing Differences Between Two Files
- Splitting the Source Editor
- Maximizing Space for the Source Editor
- Changing Source Editor Keyboard Shortcuts
Text Selection Shortcuts
To enable you to keep both hands on the keyboard, a number of shortcuts allow you to select text, deselect text, and change the text that is selected. See Table 5-4 for a selection of these shortcuts.
Table 5-4. Text Selection Shortcuts
Description |
Shortcut |
Selects the current identifier or other word that the insertion point is on. |
Alt-J |
Selects all the text between a set of parentheses, brackets, or curly braces. The insertion point must be resting immediately after either the opening or closing parenthesis/bracket/brace. |
Ctrl-Shift-[ |
Selects the current code element. Upon subsequent pressings, incrementally increases the size of the selection to include surrounding code elements. For example, if you press Alt-Shift-S once, the current word is selected. If you press it again, the rest of the expression might be selected. Pressing a third time might select the whole statement. Pressing a fourth time might select the whole method. |
Alt-Shift-S |
Selects the next (previous) character or extends the selection one character. |
Shift-Right (Shift-Left) |
Selects the next (previous) word or extends the selection one word. |
Ctrl-Shift-Right (Ctrl-Shift-Left) |
Creates or extends the text selection one line down (up). |
Shift-Down (Shift-Up) |
Creates or extends the text selection to the end (beginning) of the line. |
Shift-End (Shift-Home) |
Creates or extends the text selection to the end (beginning) of the document. |
Ctrl-Shift-End (Ctrl-Shift-Home) |
Creates or extends the text selection one page down (up). |
Shift-Page Down (Shift-Page Up) |