< Day Day Up > |
Recipe 1.3 Understanding Your Workspace1.3.1 ProblemWhat's meant by the term workspace? And what's a plug-in? 1.3.2 SolutionAlthough you might think of Eclipse as a Java IDE, it comprises a number of components that act together behind the scenes in Eclipse's workspace. A plug-in is a software tool that accomplishes a specific task in Eclipse, such as allowing you to edit an Ant file, compile a Java file, or drag and drop GUI elements. The workspace, along with the Eclipse workbench, the team component, and the help component, are all parts of the overall Eclipse platform, and serve as the foundation for plug-ins to interact with the Eclipse core software. 1.3.3 DiscussionThe Java IDE you work with is the Java Development Toolkit, or JDT. The JDT is not an integral part of Eclipse; it's a plug-in. Eclipse is really composed of the Eclipse Platform, which provides support for other tools. These tools are implemented as plug-ins, allowing the platform itself to be a relatively small software package. Eclipse comes with a number of plug-ins, including the JDT. Another important plug-in is the Plug-in Development Environment (PDE), which enables you to develop your own plug-ins. If you want to develop in a language other than Java, you get the corresponding plug-in for that language, and many are available.
Knowing the parts of Eclipse is essential to working with it for anything but the most casual use. If you don't have at least an idea of what parts do what, you'll end up confused when you encounter the barriers between these components, which can make Eclipse's behavior seem inconsistent. For example, when you know that the JDT is different from other plug-ins, you won't be surprised when options available in the JDT aren't available in other plug-ins. The Eclipse Platform consists of several components: the platform kernel, the workspace, the workbench, the team component, and the help component. You can see an overview of these components in Figure 1-3. Plug-ins are loaded when Eclipse starts; the plug-ins also appear in Figure 1-3. Figure 1-3. Eclipse components and plug-ins1.3.3.1 The Eclipse platform kernelEverything starts with the platform kernel. The platform kernel is written in native code, and its job is to load the rest of Eclipse; the kernel warns you if it can't find a workable Java installation to run the rest of the application. The kernel also loads the Eclipse plug-ins. 1.3.3.2 The workbench componentThe workbench is Eclipse at its most basic. The workbench window displays the menus and toolbars you saw in Figure 1-2 (the menu and toolbar items that are displayed are put there by the perspective you're currently viewing). Although you load different plug-ins, each with different windows and menu systems, the workbench is what displays them. The workbench is designed to look like a native application, targeted to your operating system. In Linux, it looks like a Linux application, in Windows, a Windows application, and so on.
1.3.3.3 The workspace componentThe workspace component in Eclipse manages your resources, including what you store on disk. Eclipse manages your resources in projects, and by default each project is managed by the workspace component in the Eclipse workspace directory. You'll learn more about projects later in this chapter in Recipe 1.5.
The workspace component manages all the resources in a project, including your code. It also manages changes to your code and to other files, giving you access to a stored history of the changes and even enabling you to compare those changes graphically. The workspace also communicates with plug-ins such as the JDT, making history and file information accessible. 1.3.3.4 The team componentThe team component gives you version control for your code, and it supports file sharing. If you've developed software in a corporate environment, you might already have worked with source code control and repositories. Code is stored in a repository and checked in or out as needed, which means the changes to the software can be tracked. Coordinating changes that teams make to the code means you can avoid the kind of random overlapping changes that will cause utter chaos otherwise. Eclipse integrates well with the Concurrent Versions System (CVS), the de facto standard for version control (except perhaps in Microsoft shops, where Visual SourceSafe still reigns supreme). In fact, the team component can act as a CVS client, which interacts with a CVS server that maintains the code repository from which team members can retrieve code. We're going to take a look at how this works in Chapter 6. 1.3.3.5 The help componentThe help component is Eclipse's documentation system for providing help. It's an extensible help system; plug-ins can provide their own help, in XML-formatted form, to tell the help system how to navigate their documentation. 1.3.3.6 Plug-insEclipse is extendible via plug-ins. Plug-ins can set up their own perspectives, editors, views, wizards, and more. For example, the JDT is a plug-in that adds its functionality to what the workbench already provides. Besides using some of the more than 450 plug-ins available for Eclipse, we're also going to build our own starting in Chapter 12. |
< Day Day Up > |