blob: 628d57d42f1f7e04a34fdea2051ed74e06cf9229 [file]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
<title>
Generate Getter and Setter
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
</head>
<body>
<h1>
Create getter and setter
</h1>
<p>
This dialog lets select the Getter and Setter methods to create.
</p>
<p>
Use <strong>Generate Getter and Setter</strong> from the <a href="ref-menu-source.htm">Source menu</a> or the context menu on a selected field or type, or a text selection in
a type to open the dialog.
The Generate Getter and Setter dialog shows Getter and Setters for all fields of the selected type. The methods are grouped by the type's fields.
</p>
<p>
The names of the getting and setting methods are derived from the field name. If you use a prefix or suffix for fields (e.g. fValue, _value, val_m), you can specify the
suffixes and prefixes in the <a href="ref-preferences-code-generation.htm">Code Generation preference page</a> (Windows &gt; Preferences &gt; Java &gt; Code Generation).
</p>
<p>
When pressing&nbsp;<strong>OK</strong>, all selected Getter and Setters are created
</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%">
<tr>
<th>
<p>
Option
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr>
<tr>
<td valign="top">
<p>
<strong>Select methods to create</strong>
</p>
</td>
<td valign="top">
<p>
Tree containing Getter and Setter methods that can be created. Getter and Setters are grouped by field.&nbsp;
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>
<strong>Select All</strong>
</p>
</td>
<td valign="top">
<p>
Select all Getters and Setter methods
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>
<strong>Deselect All</strong>
</p>
</td>
<td valign="top">
<p>
Deselect all Getters and Setter methods
</p>
</td>
</tr>
</table>
<p>
You can control whether Javadoc comments are added to the created methods
with the <strong>Automatically add comments for new methods and types</strong> option
on the <strong>Code and Comments</strong> tab of the <a href="ref-preferences-code-generation.htm">Code Generation preference page</a>.
<strong>(Window &gt; Preferences &gt; Java &gt; Code Generation)</strong>
<p>
<img src="../images/ngrelt.gif" alt="Related tasks" border="0" height="27" width="159"><br>
<a href="../tasks/tasks-57.htm">Generating getters and setters</a><br>
<a href="../reference/ref-menu-source.htm">Source actions</a>
</p>
<p>
<a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" alt="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved." border="0" width="324" height="14"></a>
</p>
</body>
</html>