Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Trong bối cảnh của một báo cáo nếu bạn, tất nhiên, có được các đề xuất khác nhau, chẳng hạn như thêm một elseblock hoặc loại bỏ nếu tuyên bố. Chức năng tương tự đang có sẵn và trong khi khối. Biên tập Java Eclipse đi kèm với nhiều chức năng tiện lợi mà làm cho mã dễ dàng hơn để gõ và đọc. | Effective Programming with Eclipse In the context of an if-statement you will of course get different proposals such as to add an else-block or to remove the if-statement. Similar functions are available for for- and while blocks. Convenience Functions of the Java Editor Eclipse s Java Editor comes with a variety of convenience functions that make code easier to type and to read. In the following sections I will present some of them. Typing Aids Under Preferences Java Editor on the Typing page you can activate or deactivate a variety of typing aids. The Java editor is for example able to close open parentheses or brackets automatically. It can include string literals in quotes automatically and can wrap the text within Javadoc and other comments. The function Wrap Java Strings is also nice. In our HelloWorld example program just place the cursor between Hello and World and press Enter. The result is the syntactically correct expression System.out.println Hello World However these functions are active only when the editor is in the Smart Insert mode. By pressing the Insert key repeatedly or by clicking the corresponding field in the status line you can switch among the Smart Insert Overwrite and Insert modes. By the way you can completely switch off the Overwrite mode for the Java editor Code Folding Another nice function of the Java editor is the possibility to collapse code sections and to expand them again. This is achieved with the help of the small arrows at the second vertical ruler at the left of the editor area see Figure 2.5 . An arrow pointing downward indicates an expanded section of code. When you hover with the mouse above this arrow Eclipse will show how far this section stretches. By clicking the arrow you can collapse this code section. The arrow then changes its shape and points to the right. If you now hover above the arrow a pop-up window shows the content of the collapsed code section. Click the arrow again and the code section expands again. .