␡
- 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
This chapter is from the book
Generating JavaBeans Component Code
The IDE has a few levels of support for creating JavaBeans components. You can use the following features:
- Code completion. When you have a field in your class without a corresponding get or set method, you can generate that method by pressing Ctrl-Space and choosing the method from the code completion box.
- Refactor | Encapsulate Fields command. You can use this command to generate get and set methods, change the field's access modifier, and update code that directly accesses the field to use the getters and setters instead.
-
Bean Patterns node. In the Projects window, each class has a subnode called Bean Patterns as shown in Figure 5-9. You can right-click this node and choose from a variety of commands that enable you to generate code for bean properties, property change support, and event listening. In addition, you can generate BeanInfo classes.
Figure 5-9 Bean Patterns node and menu