Eclipse SDK Concepts


When people use Eclipse for the first time, they often find it slightly confusing because of their unfamiliarity with the concepts. This was the case with me, as well. However, I found that I needed to understand only three to five basic concepts about Eclipse to instantly become productive with this tool. So, let's review these here. Note that I have intentionally provided brief descriptions here because we will look at these concepts in practice when we set up Time Expression in Eclipse.

Disclaimer: Screenshots of Eclipse in This Chapter

Almost all the screenshots of the Eclipse SDK are taken in 800x600 resolution in this chapter for the sake of legibility. However, most developers prefer a higher resolution, such as 1024x768. I use 1600x1050, for example. Therefore, the screenshots here do not do Eclipse justice because I'm unable to show how one would practically use Eclipsethat is, with lots of editors and views stacked in the workbench at one time.


Workspace

Considering how vital the term workspace is to Eclipse, let's begin with this concept first.

Simply put, a workspace is a directory for your projects. It is essentially the top-level (parent) directory under which your project-related files (.java files, for example) are organized. In my personal case, I used C:\anil\rapidjava, as you will see later in the chapter. So, everything under this directory (timex/ and the various subdirectories, that is) is considered part of the same workspace.

Workbench, Perspectives, Editors, and Views

The Eclipse workbench is the first thing we see when we start Eclipse. In other words, it essentially is the Eclipse platform plus some basic functionality such as management of projects. The actual work, such as editing and viewing, is handled by the plug-ins (the JDT, for example).

A workbench contains an arrangement of editors and corresponding views; this task-specific arrangement is called a perspective. Figure 8.2 shows a representation of how a user can switch between one perspective to another, using a single click or shortcut key combination (Ctrl+F8, for example).

Figure 8.2. Diagrammatic representation of the Eclipse SDK.


Perspectives

A perspective is a collection of views and editors arranged in the fashion you like. A workbench can consists of several perspectives, but only one can be visible at time; however, we can quickly switch between perspectives with the click of a button or by using Ctrl+F8 (COMMAND+F8 on Mac OS X). Perspectives provide a nice way to arrange task-specific views and editors of your choice. For example, in the Debug perspective, it makes sense to have the Breakpoints view, whereas in the Java Browsing view, it doesn't. Note that the views can be arranged as attached (tiled or stacked as tabs) and detached windows.

There are some predefined perspectives such as Java, Java Browsing, Debug, and others. Furthermore, we can create custom perspectives. For example, I tend to create my own perspective using an existing perspective (such as Java), altering it by adding/removing views and then saving it as a perspective named Anil (I know, not the most creative name but it certainly doesn't conflict with the prepackaged perspective names). Figure 8.3 shows Eclipse using my own custom perspective, and Figure 8.4 shows a predefined Debug perspective.

Figure 8.3. Custom perspective (Anil).


Figure 8.4. Predefined Debug perspective.


Editors and Views

Editors, as you would expect, allow us to open, edit, save, and close files. By the end of this chapter, we will have editors for plain text, .java files, .jsp files, XML files, and more.

Views supplement editors by providing read-only information, typically about the file being edited in the editor. For example, the Outline view provides a list of methods for the Java file being edited. However, for an XML file, you would see the various XML elements and attributes for the file being edited.

The Eclipse platform, combined with the JDT, comes prepackaged with various views such as Ant, Console, Breakpoints, Package Explorer, and so on. Others include Bookmarks, Properties, Tasks, Problems, Progress, Call Hierarchy, and many more.

Several editors and views can be grouped together using tabs. For example, Figure 8.4 shows the Console and Task view with tabs grouped together at the bottom part of the screen.

Project

A project is a collection of your files that you manipulate, such as .java, .xml, and so on. In addition, Eclipse provides the capability to work with multiple projects of different types (for example, simple Java versus a web application) under the same workspace, each with project-specific configuration versus a default, workbenchwide configuration.

Because we will be setting up Time Expression in Eclipse shortly, we will edit all the Time Expression files from a single place by navigating the files and directories with the help of the Package Explorer or Navigator views. In other words, we can work with all our .java, .xml, .properties, .jsp, and other files from a single place.

Plug-ins

Plug-ins are applications (programs) that can easily be installed and used inside the Eclipse platform/workbench. For example, the JDT itself is a plug-in. However, when many people think of plug-ins, they think mini or simple programs. This is not the case with Eclipse, as you will most definitely see later in this chapter when we discuss the JDT in-depth and install and use the Eclipse Web Tools Platform (WTP) set of plug-ins.

Wizards

As we begin to work with Eclipse more and more, you will notice that there are wizards galore in Eclipse! Figure 8.5 shows a partial list of wizards you see when we select the File, New, Other option (or when we use the OS-specific hot key, such as Ctrl+N on Microsoft Windows). By the time we are done with this chapter, we will have approximately 100 wizards available to us, including plug-ins for setting up Tomcat, creating Hibernate configuration and mapping files, working with Spring application context files, managing HSQLDB, and even others not applicable to Time Expression, such as creating EJBs, web services, and many more!

Figure 8.5. Eclipse wizards.




Agile Java Development with Spring, Hibernate and Eclipse
Agile Java Development with Spring, Hibernate and Eclipse
ISBN: 0672328968
EAN: 2147483647
Year: 2006
Pages: 219

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net