Home > Java > javaTutorial > How to put away code in eclipse

How to put away code in eclipse

下次还敢
Release: 2024-05-05 19:15:22
Original
473 people have browsed it

Code can be collapsed in Eclipse by: clicking the triangle icon next to the code block name in the tree navigator; placing the cursor on the code line and holding down the Ctrl and - keys; selecting the code block and click the Collapse button in the toolbar.

How to put away code in eclipse

How to fold code in Eclipse

Folding code allows you to hide unnecessary information, making your code more Concise and easy to read. Eclipse provides several ways to fold code, and this article will introduce the most commonly used methods.

Method 1: Use the tree navigator

  • In the tree navigator (Package Explorer), find the code block you want to collapse.
  • Click the triangle icon next to the code block name.
  • The icon will be rotated 90 degrees to indicate that the code is collapsed.

Method 2: Use the shortcut key

  • to place the cursor on the line of code you want to collapse.
  • Hold Ctrl and press - (Windows and Linux) or Option and - ( Mac).

Method 3: Use the "Collapse" toolbar button

  • There is a "Collapse" button in the Eclipse toolbar (the icon is a minus sign) .
  • Select the code block you want to collapse and click the button.

Expand collapsed code

To expand collapsed code, use the opposite method of collapsing:

  • In the tree In the Navigator, click the rotated triangle icon next to the code block name.
  • Hold Ctrl and press (Windows and Linux) or Option and (Mac) .
  • Click the "Expand" button in the toolbar (the icon is a plus sign).

The above is the detailed content of How to put away code in eclipse. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template