blob: e6b8bbf45c54ddb6d1fbd02180eb54af6ef2c07d [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<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.76 [en] (Windows NT 5.0; U) [Netscape]">
<title>
Source actions
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
</head>
<body>
<h1>
Source actions
</h1>
<p>
Source menu commands:
</p>
<table border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<th>
<p>
Name
</p>
</th>
<th>
<p>
Function
</p>
</th>
<td>
<strong>Keyboard Shortcut</strong>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" valign="top">
<p>
Toggle Comment
</p>
</td>
<td align="left" valign="top">
<p>
Comments or uncomments all lines containing the current selection.
</p>
</td>
<td>
Ctrl + /
</td>
</tr>
<tr align="left" valign="top">
<td align="left" valign="top">
<p>
Add Block Comment
</p>
</td>
<td align="left" valign="top">
<p>
Adds a block comment around all lines containing the current selection.
</p>
</td>
<td>
Ctrl + Shift + /
</td>
</tr>
<tr>
<td align="left" valign="top">
<p>
Remove Block Comment
</p>
</td>
<td align="left" valign="top">
<p>
Removes a block comment from all lines containing the current selection.
</p>
</td>
<td>
Ctrl + Shift + \
</td>
</tr>
<tr>
<td>
Generate Element Comment
</td>
<td>
Adds a comment to the selected element. See the <a href="../reference/ref-preferences-code-templates.htm">Code templates preference page</a>
to specify the format of the generated comments. Available on types, fields, constructors, and methods.
</td>
<td>
Alt + Shift + J
</td>
</tr>
<tr>
<td align="left" valign="top">
<p>
Shift Right
</p>
</td>
<td align="left" valign="top">
<p>
Increments the level of indentation of the currently select lines. Only activated when the selection covers multiple lines or a single whole line.
</p>
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<p>
Shift Left
</p>
</td>
<td align="left" valign="top">
<p>
Decrements the level of indentation of the currently select lines. Only activated when the selection covers multiple lines or a single whole line.
</p>
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<p>
Correct Indentation
</p>
</td>
<td align="left" valign="top">
<p>
Corrects the indentation of the lines denoted by the current text selection.
</p>
</td>
<td>
Ctrl + I
</td>
</tr>
<tr>
<td align="left" valign="top">
<p>
Format
</p>
</td>
<td align="left" valign="top">
<p>
Uses the code formatter to format the current text selection. The formatting options are configured on the <a href="ref-17.htm">Code Formatter preference page</a>
(Window &gt; Preferences &gt; Java &gt; Code Style &gt; Formatter)
</p>
</td>
<td>
Ctrl + Shift + F
</td>
</tr>
<tr>
<td align="left" valign="top">
<p>
Format Element
</p>
</td>
<td align="left" valign="top">
<p>
Uses the code formatter to format the Java element comprising the current text selection. The Format Element action works on method and type level. The formatting options are configured on the <a href="ref-17.htm">Code Formatter preference page</a>
(Window &gt; Preferences &gt; Java &gt; Code Style &gt; Formatter)
</p>
</td>
<td>&nbsp;
</td>
</tr>
<tr align="left" valign="top">
<td>
Add Import
</td>
<td>
Creates an import declaration for a type reference currently selected. If the type reference if qualified, the qualification will be removed if possible. If the
referenced type name can not be mapped uniquely to a type of the current project you will be prompted to specify the correct type. Add Import tries to follow the
import order as specified in the <a href="ref-22.htm">Organize Import preference page</a>
</td>
<td>
Ctrl + Shift + M
</td>
</tr>
<tr>
<td>
Organize Imports
</td>
<td>
Organizes the import declarations in the compilation unit currently open or selected. Unnecessary import declarations are removed, and required import declarations are
ordered as specified in the <a href="ref-22.htm">Organize Imports preference page</a> (Window &gt; Preferences &gt; Java &gt; Organize Imports). Organize imports can be
executed on incomplete source and will prompt you when a referenced type name can not be mapped uniquely to a type in the current project.<br>
You can also organize multiple compilation units by invoking the action on a package or selecting a set of compilation units.
</td>
<td>
Ctrl + Shift + O
</td>
</tr>
<tr>
<td align="left" valign="top">
<p>
Sort Members
</p>
</td>
<td align="left" valign="top">
<p>
Sorts the members of a type according to the sorting order specified in
(Window &gt; Preferences &gt; Java &gt; Appearance &gt; Members Sort Order)
</p>
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<p>
Clean up
</p>
</td>
<td align="left" valign="top">
<p>
Shows a dialog which enables you to perform various changes in
order to clean up your code.
</p>
</td>
<td>&nbsp;
</td>
</tr>
<tr align="left" valign="top">
<td>
Override/Implement Methods
</td>
<td>
Opens the <a href="ref-dialog-override-method.htm">Override Method dialog</a> that allows you to override or implement a method in the current type. Available on types
or on a text selection inside a type.
</td>
<td>&nbsp;
</td>
</tr>
<tr align="left" valign="top">
<td>
Generate Getter and Setter
</td>
<td>
Opens the <a href="ref-dialog-gettersetter.htm">Generate Getters and Setters dialog</a> that allows you to create Getters and Setters for fields in the current type.
Available on fields and types or on a text selection inside a type.
</td>
<td>&nbsp;
</td>
</tr>
<tr align="left" valign="top">
<td>
Generate Delegate Methods
</td>
<td>
Opens the Generate Delegate Methods dialog that allows you to create method delegates for fields
in the current type. Available on fields.
</td>
<td>&nbsp;
</td>
</tr>
</tr>
<tr align="left" valign="top">
<td>
Generate hashCode() and equals()
</td>
<td>
Opens the Generate HashCode and Equals dialog that allows you to create
and control the generation of hashCode and equals methods in the
current type.
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
Generate Constructor using Fields
</td>
<td>
Adds constructors which initialize fields for the currently selected types. Available on types, fields or on a text selection inside a type.
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
Add Constructor from Superclass
</td>
<td>
Adds constructors as defined in the super class for the currently selected types. Available on types or on a text selection inside a type.
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
Surround With
</td>
<td>
Surround the selected statements with a code template. Create your
own templates on the <a href="ref-preferences-templates.htm">template preference page</a>.
Further, you can use&nbsp;<em>Expand
Selection to</em> from the <a href="ref-menu-edit.htm">Edit</a> menu to get a valid selection range.
</td>
<td>
Alt + Shift + Z
</td>
</tr>
<tr>
<td>
Externalize Strings
</td>
<td>
Opens the Externalize strings wizard. This wizards allows you to replace all strings in the code by statements accessing a property file.
</td>
<td>&nbsp;
</td>
</tr>
<tr align="left" valign="top">
<td>
Find Broken Externalized Strings
</td>
<td>
&nbsp;
</td>
<td>&nbsp;
</td>
</tr>
</tbody>
</table>
<p>
<img src="../images/ngrelc.png" alt="Related concepts" border="0"></p>
<p>
<a href="../concepts/concepts-7.htm">Java editor</a><br>
<a href="../concepts/cnls.htm">String externalization</a><br>
<a href="../concepts/concepts-1.htm">Java development tools (JDT)</a></p>
<p>
<img border="0" src="../images/ngrelt.png" alt="Related tasks"></p>
<p>
<a href="../tasks/tasks-54.htm">Using the Java editor</a><br>
<a href="../tasks/tasks-206.htm">Externalizing Strings</a>
</p>
<p>
<img border="0" src="../images/ngrelr.png" alt="Related reference"></p>
<p>
<a href="ref-java-editor.htm">Java editor</a><br>
<a href="ref-21.htm">Java editor preferences</a><br>
<a href="ref-view-outline.htm">Java outline</a><br>
<a href="views/ref-viewsandeditors.htm">Views and editors</a>
</p>
</body>
</html>