Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2008. 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">
    <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" summary="Source menu commands">
      <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>
              Comment or uncomment 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/preferences/java/codestyle/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="preferences/java/codestyle/ref-preferences-formatter.htm">Code Formatter preference page</a>.
            </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="preferences/java/codestyle/ref-preferences-formatter.htm">Code Formatter preference page</a>.
            </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="preferences/java/codestyle/ref-preferences-organize-imports.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="preferences/java/codestyle/ref-preferences-organize-imports.htm">Organize Imports preference page</a>. 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 the
              <a href="./preferences/java/appearance/ref-preferences-member-sort-order.htm">Member Sort Order preference page</a>
            </p>
          </td>
          <td>&nbsp;
            
          </td>
        </tr>
        <tr>
          <td align="left" valign="top">
            <p>
              Clean Up
            </p>
          </td>
          <td align="left" valign="top">
            <p>
            Performs various changes in order to clean up your code according to the settings specified in the
            <a href="./preferences/java/codestyle/ref-preferences-cleanup.htm">Clean Up preference page</a>
            </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 and types with fields.
          </td>
          <td>&nbsp;
            
          </td>
        </tr>
        <tr align="left" valign="top">
          <td>
            Generate hashCode() and equals()
          </td>
          <td>
            Opens the Generate HashCode and Equals dialog that allows you to start
			  and control the generation of hashCode and equals methods in the
			  current type.
          </td>
          <td>&nbsp;
            
          </td>
        </tr>
        <tr align="left" valign="top">
          <td>
            Generate toString()
          </td>
          <td>
            Opens the <a href="ref-dialog-tostring.htm">Generate toString() dialog</a> that allows you to start
			  and control the generation of a toString() method 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="preferences/java/editor/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>
			  Searches for broken externalized strings in a selected property file, package, project or set of projects.
          </td>
          <td>&nbsp;
            
          </td>
        </tr>
      </tbody>
    </table>
    <p>
       <img  src="../images/ngrelc.png" alt="Related concepts" border="0"></p>
       <p>
    <a href="../concepts/concept-java-editor.htm">Java editor</a><br>
     <a href="../concepts/concept-string-externalization.htm">String externalization</a><br>
     <a href="../concepts/concept-jdt.htm">Java development tools (JDT)</a></p>
    <p>
       <img border="0"  src="../images/ngrelt.png" alt="Related tasks"></p>
       <p>
      <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="views/ref-java-editor.htm">Java editor</a><br>
       <a href="preferences/java/ref-preferences-editor.htm">Java editor preferences</a><br>
       <a href="views/ref-view-outline.htm">Java outline</a><br>
       <a href="views/ref-viewsandeditors.htm">Views and editors</a>
    </p>
    
  </body>
</html>

New to GrepCode? Check out our FAQ X