Encapsulate Fields Dialog Box

Use to specify options for the Encapsulate Fields refactoring command.

Element Description

List of Fields to Encapsulate

Displays a list of fields in the class.

Select the checkbox for each field that you want to encapsulate.

Insert Point

Displays a list containing the six possible points (Default, First Method, Last Method, After About(JFrame Parent), After initComponents() : void, and After closeButtonActionPerformed(java.awt.event.ActionEvent evt)) for inserting a new accessor method.

Sort by

Displays a list containing the three possible options (Getter/Setter pairs, Getters then Setters, and Method names).

Select the option that you want to be used for sorting the fields in the class.

Javadoc

Displays a list containing the three possible options (Copy from field, Create default comments, and None).

Select the option that you want to be used for creating Javadoc

Fields' Visibility

Displays a list containing the four possible accessibility modifiers (default, private, protected, and public).

Select the accessibility modifier that you want the field or fields to have.

Accessor's Visibility.

Drop-down list containing the four possible accessibility modifiers (default, private, protected, and public).

Select the accessibility modifier that you want the accessor (getter and setter) methods to have.

Use Accessors Even When Field Is Accessible

Updates any direct references in your code to the field to use the accessor methods instead. If not selected, any direct references to the fields that you already have in your code are not replaced.

This option only has an impact if both of the following are true:

  • You have direct references to the field in your code.
  • You have set the field's accessor modifier so that the field is visible to the classes with these references.

Generate Property Change Support

Generates the property change support code in addition to the field and methods for the property.

Generate Vetoable change support

Generates the vetoable change listeners for specific properties.


Related Topics

Developing Applications with NetBeans IDE,

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.