IV    The Kenya/Java Editor

Editor Layout

The editor consists mainly of two parts. One is where you type Kenya code, the other is where you can view the corresponding Java code (provided your code is error-free). To switch between the views, all you have to do is use the tabs at the bottom of the editor.

Multieditor screenshot

The editor highlights comments, keywords, Strings etc in different colours as you type. It will also highlight errors while you type. The following picture shows a compilation error. In this example the function 'paint' is not defined.

Compilation error annotations

There are four areas of attention in this screenshot:

Annotation Ruler

The annotation ruler shows icons for different annotations. These could be errors, warnings, bookmarks, breakpoints, etc., some of which will be covered later. Clicking on the icon will normally highlight the portion of code that is relevant to the annotation.

Overview Ruler

The overview ruler shows small coloured blocks with different colours for different types of annotations, similar to the annotation ruler. The difference is that the overview ruler is scaled to the size of the document. This means that, while the annotation ruler's visibility is limited to the current part of the code you are looking at, the overview ruler always has the same scale, so you can use it to quickly navigate to an annotation that is not showing on the screen right now.

Change Ruler

The change ruler gives an indication of what has changed in the document since the last time it was saved. This can be quite powerful when trying to track changes that broke the functionality of the program.

Hovering over each of these rulers will give you more information about why they exist. They might contain an error message or the contents of a bookmarked section of code.

Right-clicking allows you to access some settings, add bookmarks, tasks, etc. these actions are also available from the Edit menu item.

The three rulers will be of importance again, when we consider advanced editor features.

The Problem View

Problems also have a place in their own view, which resides at the bottom of the screen:

Problem view

Errors are displayed here even if the file is closed and can be used for quick navigation.