7.1. Getting Started with Eclipse

This section gives a short introduction to the elements of the Eclipse UI before introducing the pure::variants UI. Readers with Eclipse experience may skip this section.

Eclipse is based around the concepts of workspaces and projects . Workspaces are used by Eclipse to refer to enclosed projects, preferences and other kinds of meta-data. A user may have any number of workspaces for different purposes. Outside of Eclipse, workspaces are represented as a directory in the file system with a subdirectory .meta-data where all workspace-related information is stored. A workspace may only be used by a single Eclipse instance at a time. Projects are structures for representing a related set of resources (e.g. the source code of a library or application). The contents and structure of a project depends on the nature of the project. A project may have more than one nature. For example, Java projects have a Java nature in addition to any project-specific natures they may have. Natures are used by Eclipse to determine the type of the project and to provide specialised behaviour. Project-specific meta information is stored in a .project file inside the project directory. This directory could be located anywhere in the file system, but projects are often placed inside a workspace directory. Projects may be used in more than one workspace by importing them using ( File->Import->Import Existing Project ).

Figure 7.1, “Eclipse workbench elements” shows an Eclipse workbench window. A perspective determines the layout of this window. A perspective is a (preconfigured) collection of menu items, toolbar entries and sub-windows ( views and editors ). For instance this figure shows the standard layout of the Resource perspective. Perspectives are designed for performing a specific set of tasks (e.g. the Java perspective is used for developing Java programs). Users may change the layout of a perspective according to their needs by placing views or editors in different locations, by adding or closing views or editors, menu items and so on. These custom layouts may be saved as new perspectives and reopened later. The standard layout of a perspective may be restored using Window->Reset Perspective .

Editors represent resources, such as files, that are in the process of being changed by the user. A single resource cannot be open in more than one editor at a time. A resource is normally opened by double-clicking on it in a Navigator view or by using a context menu. When there are several suitable editors for a given resource type the context menu allows the desired one to be chosen. The figure below shows some of the main User Interface elements:

Figure 7.1. Eclipse workbench elements

Eclipse workbench elements

Eclipse uses Views to represent any kind of information. Despite their name, data in some types of view may be changed. Only one instance of a specific type of view, such as the Outline view, may be shown in the workbench at a time. All available views are accessible via Windows->Show View->Other.