Previous Topic Next topic Print topic


Editing

It is worth highlighting the following editing features in Eclipse:

Block Edit

Clicking the Block Edit icon on the toolbar,Block edit ,switches the current editor into block edit mode.

In this mode, if a multi-line area is selected then an insert or delete operation performed, the operation is performed for each of the lines selected.

Selecting a zero-width multi-line block, then inserting spaces can be a handy way of indenting a whole block.

Go to Line

If you want to go to a particular line of code, either type Ctrl+L or double-click the line number in the status bar at the bottom, then enter the line number.

Status bar

Go to Line

If you have an error in the Problems view, double-clicking that takes you directly to the line of code. Similarly, double-clicking on a search result takes you to the line concerned.

Alternative Editors

Most of the time, the default editor used when you double-click a file is the editor that is required to edit the file. However, when it is not, you can right-click the file and click Open With to select one of the other available editors.

One of the more commonly-used non-default editors is the COBOL Copy View editor, which shows the entire COBOL program with all the COPY statements resolved along with the effects of any REPLACE or COPY REPLACING statements. COBOL Copy View is a read-only editor, and you can open it by pressing F4 while in the COBOL editor or by selecting Open in COBOL Copy View from the context menu of the editor. To navigate back to the standard editor, press F4 again.

Multiple Editors

In Eclipse you can have the same file opened in two or more separate editors at the same time. For example, you can have both a standard COBOL editor open and the COBOL Copy View, and changes made in the standard editor are reflected in the COBOL Copy View as you type.

A file can be opened in as many editors as you like - Eclipse can cope with more than 100 editors. To view multiple editors at the same time, you can rearrange the editor window - click on the editor tab that is currently visible and drag it to the edge of the editor area - a highlighted frame shows how the window will be repositioned when you drop it.

Outlines

You can use the following outline views:

  • The Outline view shows you a structural outline of your program in the current file.
  • The Program Outline view does the same but shows elements of other files that are in the same program.

    Program Outline

  • Quick outline - while the cursor is in the editor, pressing Ctrl+O gives you a quick outline view - the dialog box goes away as soon as focus is lost. Pressing Ctrl+O again causes a quick view of the Program Outline to be shown.

    The quick outline views allow filtering of data and procedure items so can be useful for quick navigation around the program - clicking on an item in an outline takes you to that item in an editor.

    Quick Outline

Hyperlinks

Holding down the Ctrl button while hovering over a name in an editor treats that name as a hyperlink, which when clicked, moves the cursor to the definition of the item in the editor.

Hyperlinks

Content Assist

Eclipse can accelerate the edit experience by offering a list of possible completions when you press Ctrl+Space. In some editors, it also offers templates of code - code snippets.

Content Assist

Previous Topic Next topic Print topic