Jump to: navigation, search

Difference between revisions of "The Official Eclipse FAQs"

(48 intermediate revisions by 16 users not shown)
Line 1: Line 1:
The initial contents for these FAQ pages has come from [http://www.eclipsefaq.org The Offical Eclipse 3.0 FAQs].
+
Note that this FAQ is updated less frequently than [[IRC FAQ|this FAQ]]. You may find your answer there before it makes its way here.
Permission to publish that book contents here has been gracefully offered by Addison-Wesley, publishers of the official [http://www.awprofessional.com/series/series.asp?st=44100&rl=1| Eclipse Series].
+
Note that on each of the FAQs originating from that book, you will find the following copyright statement:
+
<ul>
+
<ul>
+
<font face=Arial>
+
  
<b>
+
== Part I  -- The Eclipse Ecosystem ==
This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. <br>
+
Copyright 2004, Pearson Education, Inc. All rights reserved.
+
<br>This text is made available here under the terms of the
+
[http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].
+
</b>
+
  
 +
=== The Eclipse Community ===
  
</font>
+
Eclipse has taken the computing industry by storm. The download data for the Eclipse Software Development Kit (SDK) is astounding and a true ecosystem is forming around this new phenomenon. In this chapter we discuss what Eclipse is and who is involved in it and give you a glimpse of how large a community has put its weight behind this innovative technology.
</ul>
+
</ul>
+
<p>
+
You are strongly encouraged to contribute to this online version of the Official Eclipse FAQs, to correct existing FAQs, and to add new FAQs.
+
Just remember not to rename any FAQ numbers. If you want to add a new FAQ, make sure to add a new unique FAQ number, such as
+
<strong>FAQ 132-A</strong> for an FAQ that follows FAQ 132. Think carefully where you place your FAQ, and what number you give it.
+
People will want to make long-lasting URLs to them, so if your FAQ gets popular you will find it hard to change its name without breaking many bookmarks.
+
</p>
+
  
== Part I The Eclipse Ecosystem ==
+
An open source project would be nothing without a supporting community. The Eclipse ecosystem is a thriving one, with many research projects based on Eclipse, commercial products that ship on top of Eclipse, lively discussions in newsgroups and mailing lists, and a long list of articles and books that address the platform. The following pages will give you a roadmap of the community, so that you will feel more at home as you come to wander its winding streets.
  
 +
:*[[FAQ What is Eclipse?]]
 +
:*[[FAQ What is the Eclipse Platform?]]
 +
:*[[FAQ Where did Eclipse come from?]]
 +
:*[[FAQ What is the Eclipse Foundation?]]
 +
:*[[FAQ How can my users tell where Eclipse ends and a product starts?]]
 +
:*[[FAQ What are Eclipse projects and technologies?]]
 +
:*[[FAQ How do I propose my own project?]]
 +
:*[[FAQ Who is building commercial products based on Eclipse?]]
 +
:*[[FAQ What open source projects are based on Eclipse?]]
 +
:*[[FAQ What academic research projects are based on Eclipse?]]
 +
:*[[FAQ Who uses Eclipse in the classroom?]]
 +
:*[[FAQ What is an Eclipse Innovation Grant?]]
 +
:*[[FAQ What Eclipse newsgroups are available?]]
 +
:*[[FAQ How do I get access to Eclipse newsgroups?]]
 +
:*[[FAQ What Eclipse mailing lists are available?]]
 +
:*[[FAQ What articles on Eclipse have been written?]]
 +
:*[[FAQ What books have been written on Eclipse?]]
 +
:*[[FAQ How do I report a bug in Eclipse?]]
 +
:*[[FAQ How can I search the existing list of bugs in Eclipse?]]
 +
:*[[FAQ What do I do if my feature request is ignored?]]
 +
:*[[FAQ Can I get my documentation in PDF form, please?]]
 +
:*[[FAQ Where do I find documentation for a given extension point?]]
 +
:*[[FAQ How is Eclipse licensed? ]]
  
=== [[FAQ Chapter 1 | Chapter 1 The Eclipse Community]] ===
+
=== Getting Started ===
  
:*[[FAQ 1]] What is Eclipse?
+
Eclipse can be seen as a very advanced Java program. Running Eclipse may sound simple—simply run the included eclipse.exe or eclipse executable—yet in practice, you may want to tweak the inner workings of the platform. First, Eclipse does not come with a Java virtual machine (JVM), so you have to get one yourself. Note that any version later than Eclipse 3.0 needs a 1.4-compatible Java runtime environment (JRE), and the Java 5 JRE is recommended for Eclipse version 3.3.
:*[[FAQ 2]] What is the Eclipse Platform?
+
:*[[FAQ 3]] Where did Eclipse come from?
+
:*[[FAQ 4]] What is the Eclipse Foundation?
+
:*[[FAQ 5]] How can my users tell where Eclipse ends and a product starts?
+
:*[[FAQ 6]] What are Eclipse projects and technologies?
+
:*[[FAQ 7]] How do I propose my own project?
+
:*[[FAQ 8]] Who is building commercial products based on Eclipse?
+
:*[[FAQ 9]] What open source projects are based on Eclipse?
+
:*[[FAQ 10]] What academic research projects are based on Eclipse?
+
:*[[FAQ 11]] Who uses Eclipse in the classroom?
+
:*[[FAQ 12]] What is an Eclipse Innovation Grant?
+
:*[[FAQ 13]] What Eclipse newsgroups are available?
+
:*[[FAQ 14]] How do I get access to Eclipse newsgroups?
+
:*[[FAQ 15]] What Eclipse mailing lists are available?
+
:*[[FAQ 16]] What articles on Eclipse have been written?
+
:*[[FAQ 17]] What books have been written on Eclipse?
+
:*[[FAQ 18]] How do I report a bug in Eclipse?
+
:*[[FAQ 19]] How can I search the existing list of bugs in Eclipse?
+
:*[[FAQ 20]] What do I do if my feature request is ignored?
+
:*[[FAQ 21]] Can I get my documentation in PDF form, please?
+
:*[[FAQ 22]] Where do I find documentation for a given extension point?
+
:*[[FAQ 23]] How is Eclipse licensed?
+
  
 +
To use Eclipse effectively, you will need to learn how to make Eclipse use a specific JRE. In addition, you may want to influence how much heap Eclipse may allocate, where it loads and saves its workspace from, and how you can add more plug-ins to your Eclipse installation.
  
===[[FAQ Chapter 2 | Chapter 2 Getting Started]]===
+
This chapter should get you going. We also included some FAQs for plug-in developers who have already written plug-ins and want to get started with plug-in development for Eclipse 3.0.
  
:*[[FAQ 24]] Where do I get and install Eclipse?
+
:*[[FAQ Where do I get and install Eclipse?]]
:*[[FAQ 25]] How do I run Eclipse?
+
:*[[FAQ How do I run Eclipse?]]
:*[[FAQ 26]] How do I increase the heap size available to Eclipse?
+
:*[[FAQ How do I increase the heap size available to Eclipse?]]
:*[[FAQ 27]] Where can I find that elusive .log file?
+
:*[[FAQ Where can I find that elusive .log file?]]
:*[[FAQ 28]] Does Eclipse run on any Linux distribution?
+
:*[[FAQ Does Eclipse run on any Linux distribution?]]
:*[[FAQ 29]] I unzipped Eclipse, but it won't start. Why?
+
:*[[FAQ I unzipped Eclipse, but it won't start. Why?]]
:*[[FAQ 30]] How do I upgrade Eclipse?
+
:*[[FAQ How do I upgrade Eclipse?]]
:*[[FAQ 31]] How do I install new plug-ins?
+
:*[[FAQ How do I install new plug-ins?]]
:*[[FAQ 32]] Can I install plug-ins outside the main install directory?
+
:*[[FAQ Can I install plug-ins outside the main install directory?]]
:*[[FAQ 33]] How do I remove a plug-in?
+
:*[[FAQ How do I remove a plug-in?]]
:*[[FAQ 34]] How do I find out what plug-ins have been installed?
+
:*[[FAQ How do I find out what plug-ins have been installed?]]
:*[[FAQ 35]] Where do I get help?
+
:*[[FAQ Where do I get help?]]
:*[[FAQ 36]] How do I accommodate project layouts that don't fit the Eclipse model?
+
:*[[FAQ How do I report a bug?]]
:*[[FAQ 37]] What is new in Eclipse 3.0?
+
:*[[FAQ How do I accommodate project layouts that don't fit the Eclipse model?]]
:*[[FAQ 38]] Is Eclipse 3.0 going to break all of my old plug-ins?
+
:*[[FAQ What is new in Eclipse 3.0?]]
:*[[FAQ 39]] How do I prevent my plug-in from being broken when I update Eclipse?  
+
:*[[FAQ Is Eclipse 3.0 going to break all of my old plug-ins?]]
 +
:*[[FAQ How do I prevent my plug-in from being broken when I update Eclipse? ]]
  
 +
=== Java Development in Eclipse ===
  
===[[FAQ Chapter 3 | Chapter 3 Java Development in Eclipse]]===
+
The topic of how to use Eclipse for typical Java development is beyond the scope of this FAQ list. We focus more on the issues Eclipse users may run into when developing new plug-ins for the platform. Also, as a plug-in developer, you need to be familiar with the ways in which Eclipse is used. To achieve seamless integration with the platform, your plug-in must respect common usage patterns and offer the same level of functionality that users of your plug-in have come to expect from the platform. This chapter focuses on user-level issues of interest to plug-in developers as users or as enablers for other users of the platform.
  
:*[[FAQ 40]] How do I show/hide files like classpath in the Navigator?
+
For a comprehensive guide to using Eclipse, refer to other books such as The Java Developer’s Guide to Eclipse (Addison-Wesley, 2003).
:*[[FAQ 41]] How do I link the Navigator with the currently active editor?
+
:*[[FAQ 42]] How do I use the keyboard to traverse between editors?
+
:*[[FAQ 43]] How can I rearrange Eclipse views and editors?
+
:*[[FAQ 44]] Why doesn't my program start when I click the Run button?
+
:*[[FAQ 45]] How do I turn off autobuilding of Java code?
+
:*[[FAQ 46]] How do I hide referenced libraries in the Package Explorer?
+
:*[[FAQ 47]] Where do my class files disappear to?
+
:*[[FAQ 48]] What editor keyboard shortcuts are available?
+
:*[[FAQ 49]] How do I stop the Java editor from showing a single method at once?
+
:*[[FAQ 50]] How do I open a type in a Java editor?
+
:*[[FAQ 51]] How do I control the Java formatter?
+
:*[[FAQ 52]] How do I choose my own compiler?
+
:*[[FAQ 53]] What Java refactoring support is available?
+
:*[[FAQ 54]] How can Content Assist make me the fastest coder ever?
+
:*[[FAQ 55]] How can templates make me the fastest coder ever?
+
:*[[FAQ 56]] What is a Quick Fix?
+
:*[[FAQ 57]] How do I profile my Java program?
+
:*[[FAQ 58]] How do I debug my Java program?
+
:*[[FAQ 59]] How do I find out the command-line arguments of a launched program?
+
:*[[FAQ 60]] What is hot code replace?
+
:*[[FAQ 61]] How do I set a conditional breakpoint?
+
:*[[FAQ 62]] How do I find all Java methods that return a String?
+
:*[[FAQ 63]] What can I view in the Hierarchy view?
+
:*[[FAQ 64]] How do I add an extra library to my project's classpath?
+
:*[[FAQ 65]] What is the advantage of sharing the project file in a repository?
+
:*[[FAQ 66]] What is the function of the .cvsignore file?
+
:*[[FAQ 67]] How do I set up a Java project to share in a repository?
+
:*[[FAQ 68]] Why does the Eclipse compiler create a different serialVersionUID from javac?
+
  
 +
:*[[FAQ How do I get started if I am new to Java and Eclipse?]]
 +
:*[[FAQ How do I show/hide files like classpath in the Navigator?]]
 +
:*[[FAQ How do I link the Navigator with the currently active editor?]]
 +
:*[[FAQ How do I use the keyboard to traverse between editors?]]
 +
:*[[FAQ How can I rearrange Eclipse views and editors?]]
 +
:*[[FAQ Why doesn't my program start when I click the Run button?]]
 +
:*[[FAQ How do I turn off autobuilding of Java code?]]
 +
:*[[FAQ How do I hide referenced libraries in the Package Explorer?]]
 +
:*[[FAQ Where do my class files disappear to?]]
 +
:*[[FAQ What editor keyboard shortcuts are available?]]
 +
:*[[FAQ How do I stop the Java editor from showing a single method at once?]]
 +
:*[[FAQ How do I open a type in a Java editor?]]
 +
:*[[FAQ How do I control the Java formatter?]]
 +
:*[[FAQ How do I choose my own compiler?]]
 +
:*[[FAQ What Java refactoring support is available?]]
 +
:*[[FAQ How can Content Assist make me the fastest coder ever?]]
 +
:*[[FAQ How can templates make me the fastest coder ever?]]
 +
:*[[FAQ What is a Quick Fix?]]
 +
:*[[FAQ How do I profile my Java program?]]
 +
:*[[FAQ How do I debug my Java program?]]
 +
:*[[FAQ How do I find out the command-line arguments of a launched program?]]
 +
:*[[FAQ What is hot code replace?]]
 +
:*[[FAQ How do I set a conditional breakpoint?]]
 +
:*[[FAQ How do I find all Java methods that return a String?]]
 +
:*[[FAQ What can I view in the Hierarchy view?]]
 +
:*[[FAQ How do I add an extra library to my project's classpath?]]
 +
:*[[FAQ What is the advantage of sharing the project file in a repository?]]
 +
:*[[FAQ What is the function of the .cvsignore file?]]
 +
:*[[FAQ How do I set up a Java project to share in a repository?]]
 +
:*[[FAQ Why does the Eclipse compiler create a different serialVersionUID from javac? ]]
  
===[[FAQ Chapter 4 | Chapter 4 Plug-In Development Environment]]===
+
=== Plug-In Development Environment ===
  
:*[[FAQ 69]] How do I create a plug-in?
+
This book is all about extending the Eclipse Platform. The main instrument for extending the platform is a plug-in. Plug-ins solidify certain crucial design criteria underlying Eclipse. Special tooling has been developed as part of Eclipse to support the development of plug-ins. This set of plug-ins is called the Plug-in Development Environment; or PDE. The PDE tools cover the entire lifecycle of plug-in development, from creating them using special wizards to editing them to building them to launching them to exporting and sharing them.
:*[[FAQ 70]] How do I use the plug-in Manifest Editor?
+
:*[[FAQ 71]] Why doesn't my plug-in build correctly?
+
:*[[FAQ 72]] How do I run my plug-in in another instance of Eclipse?
+
:*[[FAQ 73]] What causes my plug-in to build but not to load in a runtime workbench?
+
:*[[FAQ 74]] My runtime workbench runs, but my plug-in does not show. Why?
+
:*[[FAQ 75]] How do I add images and other resources to a runtime JAR file?
+
:*[[FAQ 76]] Can I add icons declared by my plugin.xml in the runtime JAR?
+
:*[[FAQ 77]] When does PDE change a plug-in's Java build path?
+
:*[[FAQ 78]] What is a PDE JUnit test?
+
:*[[FAQ 79]] Where can I find the Eclipse plug-ins?
+
:*[[FAQ 80]] How do I find a particular class from an Eclipse plug-in?
+
:*[[FAQ 81]] Why do I get a 'plug-in was unable to load class' error when I activate a menu or toolbar action?
+
:*[[FAQ 82]] What is the use of the build.xml file?
+
:*[[FAQ 83]] How do I prevent my build.xml file from being overwritten?
+
:*[[FAQ 84]] When is the build.xml script executed?
+
:*[[FAQ 85]] How do I declare my own extension point?
+
:*[[FAQ 86]] How do I find all the plug-ins that contribute to my extension point?
+
:*[[FAQ 87]] Why is the interface for my new extension point not visible?
+
:*[[FAQ 88]] Can my extension point schema contain nested elements?
+
:*[[FAQ 89]] How do I create a feature?
+
:*[[FAQ 90]] How do I synchronize versions between a feature and its plug-in(s)?
+
:*[[FAQ 91]] What is the Update Manager?
+
:*[[FAQ 92]] How do I create an update site (site.xml)?
+
:*[[FAQ 93]] Why does my update site need a license?
+
  
 +
This chapter describes the mechanics of plug-in development, such as creating plug-ins, features, and update sites, and introduces the PDE tooling. We go into much more depth about what plug-ins are in later FAQs. If you want to jump ahead, we suggest that you first visit [[FAQ What is a plug-in?]].
  
== Part II The Rich Client Platform ==
+
:*[[FAQ How do I create a plug-in?]]
 +
:*[[FAQ How do I use the plug-in Manifest Editor?]]
 +
:*[[FAQ Why doesn't my plug-in build correctly?]]
 +
:*[[FAQ How do I run my plug-in in another instance of Eclipse?]]
 +
:*[[FAQ What causes my plug-in to build but not to load in a runtime workbench?]]
 +
:*[[FAQ My runtime workbench runs, but my plug-in does not show. Why?]]
 +
:*[[FAQ How do I add images and other resources to a runtime JAR file?]]
 +
:*[[FAQ Can I add icons declared by my plugin.xml in the runtime JAR?]]
 +
:*[[FAQ When does PDE change a plug-in's Java build path?]]
 +
:*[[FAQ What is a PDE JUnit test?]]
 +
:*[[FAQ Where can I find the Eclipse plug-ins?]]
 +
:*[[FAQ How do I find a particular class from an Eclipse plug-in?]]
 +
:*[[FAQ Why do I get a 'plug-in was unable to load class' error when I activate a menu or toolbar action?]]
 +
:*[[FAQ What is the use of the build.xml file?]]
 +
:*[[FAQ How do I prevent my build.xml file from being overwritten?]]
 +
:*[[FAQ When is the build.xml script executed?]]
 +
:*[[FAQ How do I declare my own extension point?]]
 +
:*[[FAQ How do I find all the plug-ins that contribute to my extension point?]]
 +
:*[[FAQ Why is the interface for my new extension point not visible?]]
 +
:*[[FAQ Can my extension point schema contain nested elements?]]
 +
:*[[FAQ How do I create a feature?]]
 +
:*[[FAQ How do I synchronize versions between a feature and its plug-in(s)?]]
 +
:*[[FAQ What is the Update Manager?]]
 +
:*[[FAQ How do I create an update site (site.xml)?]]
 +
:*[[FAQ Why does my update site need a license? ]]
  
 +
== Part II -- The Rich Client Platform ==
  
===[[FAQ Chapter 5 | Chapter 5 All about Plug-ins]]===
+
=== All about Plug-ins ===
  
:*[[FAQ 94]] What is a plug-in?
+
Part I discussed the Eclipse ecosystem: how to run it, how to use it, and how to extend it. In this chapter, we revisit the topic of plug-ins and lay the groundwork for all plug-in development topics to be discussed in later chapters. This chapter answers questions about the core concepts of the Eclipse kernel, including plug-ins, extension points, fragments, and more. All APIs mentioned in this chapter are found in the org.eclipse.core.runtime plug-in.
:*[[FAQ 95]] Do I use plugin or plug-in?
+
:*[[FAQ 96]] What is the plug-in manifest file (plugin.xml)?
+
:*[[FAQ 97]] How do I make my plug-in connect to other plug-ins?
+
:*[[FAQ 98]] What are extensions and extension points?
+
:*[[FAQ 99]] What is an extension point schema?
+
:*[[FAQ 100]] How do I find out more about a certain extension point?
+
:*[[FAQ 101]] When does a plug-in get started?
+
:*[[FAQ 102]] Where do plug-ins store their state?
+
:*[[FAQ 103]] How do I find out the install location of a plug-in?
+
:*[[FAQ 104]] What is the classpath of a plug-in?
+
:*[[FAQ 105]] How do I add a library to the classpath of a plug-in?
+
:*[[FAQ 106]] How can I share a JAR among various plug-ins?
+
:*[[FAQ 107]] How do I use the context class loader in Eclipse?
+
:*[[FAQ 108]] Why doesn't Eclipse play well with Xerces?
+
:*[[FAQ 109]] What is a plug-in fragment?
+
:*[[FAQ 110]] Can fragments be used to patch a plug-in?
+
:*[[FAQ 111]] What is a configuration?
+
:*[[FAQ 112]] How do I find out whether the Eclipse Platform is running?
+
:*[[FAQ 113]] Where does System.out and System.err output go?
+
:*[[FAQ 114]] How do I locate the owner plug-in from a given class?
+
:*[[FAQ 115]] How does OSGi and the new runtime affect me?
+
:*[[FAQ 116]] What is a dynamic plug-in?
+
:*[[FAQ 117]] How do I make my plug-in dynamic enabled?
+
:*[[FAQ 118]] How do I make my plug-in dynamic aware?
+
  
 +
:*[[FAQ What is a plug-in?]]
 +
:*[[FAQ Do I use plugin or plug-in?]]
 +
:*[[FAQ What is the plug-in manifest file (plugin.xml)?]]
 +
:*[[FAQ How do I make my plug-in connect to other plug-ins?]]
 +
:*[[FAQ What are extensions and extension points?]]
 +
:*[[FAQ What is an extension point schema?]]
 +
:*[[FAQ How do I find out more about a certain extension point?]]
 +
:*[[FAQ When does a plug-in get started?]]
 +
:*[[FAQ Where do plug-ins store their state?]]
 +
:*[[FAQ How do I find out the install location of a plug-in?]]
 +
:*[[FAQ What is the classpath of a plug-in?]]
 +
:*[[FAQ How do I add a library to the classpath of a plug-in?]]
 +
:*[[FAQ How can I share a JAR among various plug-ins?]]
 +
:*[[FAQ How do I use the context class loader in Eclipse?]]
 +
:*[[FAQ Why doesn't Eclipse play well with Xerces?]]
 +
:*[[FAQ What is a plug-in fragment?]]
 +
:*[[FAQ Can fragments be used to patch a plug-in?]]
 +
:*[[FAQ What is a configuration?]]
 +
:*[[FAQ How do I find out whether the Eclipse Platform is running?]]
 +
:*[[FAQ Where does System.out and System.err output go?]]
 +
:*[[FAQ How do I locate the owner plug-in from a given class?]]
 +
:*[[FAQ How does OSGi and the new runtime affect me?]]
 +
:*[[FAQ What is a dynamic plug-in?]]
 +
:*[[FAQ How do I make my plug-in dynamic enabled?]]
 +
:*[[FAQ How do I make my plug-in dynamic aware? ]]
  
===[[FAQ Chapter 6 | Chapter 6 Runtime Facilities]]===
 
  
:*[[FAQ 119]] How do I use progress monitors?
+
=== Runtime Facilities ===
:*[[FAQ 120]] How do I use a SubProgressMonitor?
+
:*[[FAQ 121]] How do I use the platform logging facility?
+
:*[[FAQ 122]] How do I use the platform debug tracing facility?
+
:*[[FAQ 123]] How do I load and save plug-in preferences?
+
:*[[FAQ 124]] How do I use the preference service?
+
:*[[FAQ 125]] What is a preference scope?
+
:*[[FAQ 126]] How do I use IAdaptable and IAdapterFactory?
+
:*[[FAQ 127]] Does the platform have support for concurrency?
+
:*[[FAQ 128]] How do I prevent two jobs from running at the same time?
+
:*[[FAQ 129]] What is the purpose of job families?
+
:*[[FAQ 130]] How do I find out whether a particular job is running?
+
:*[[FAQ 131]] How can I track the lifecycle of jobs?
+
:*[[FAQ 132]] How do I create a repeating background task?
+
  
 +
Above, we already discussed most of the basic functionality of the org.eclipse.core.runtime plug-in. This chapter covers the remaining facilities of Eclipse Platform runtime: APIs for logging, tracing, storing preferences, and other such core functionality. These various services, although not strictly needed by all plug-ins, are common enough that they merit being located directly alongside the Eclipse kernel. In Eclipse 3.0, this plug-in was expanded to add infrastructure for running and managing background operations. This chapter answers some of the questions that may arise when you start to use this new concurrency infrastructure.
  
===[[FAQ Chapter 7 | Chapter 7 Standard Widget Toolkit (SWT)]]===
+
:*[[FAQ How do I use progress monitors?]]
 +
:*[[FAQ How do I use a SubProgressMonitor?]]
 +
:*[[FAQ How do I use the platform logging facility?]]
 +
:*[[FAQ How do I use the platform debug tracing facility?]]
 +
:*[[FAQ How do I load and save plug-in preferences?]]
 +
:*[[FAQ How do I use the preference service?]]
 +
:*[[FAQ What is a preference scope?]]
 +
:*[[FAQ How do I use IAdaptable and IAdapterFactory?]]
 +
:*[[FAQ Does the platform have support for concurrency?]]
 +
:*[[FAQ How do I prevent two jobs from running at the same time?]]
 +
:*[[FAQ What is the purpose of job families?]]
 +
:*[[FAQ How do I find out whether a particular job is running?]]
 +
:*[[FAQ How can I track the lifecycle of jobs?]]
 +
:*[[FAQ How do I create a repeating background task? ]]
  
:*[[FAQ 133]] What is SWT?
 
:*[[FAQ 134]] Why does Eclipse use SWT?
 
:*[[FAQ 137]] Can I use SWT outside Eclipse for my own project?
 
:*[[FAQ 138]] Are there any visual composition editors available for SWT?
 
:*[[FAQ 139]] Why do I have to dispose of colors, fonts, and images?
 
:*[[FAQ 140]] Why do I get an invalid thread access exception?
 
:*[[FAQ 141]] How do I get a Display instance?
 
:*[[FAQ 142]] How do I prompt the user to select a file or a directory?
 
:*[[FAQ 143]] How do I display a Web page in SWT?
 
:*[[FAQ 144]] How do I embed AWT and Swing inside SWT?
 
:*[[FAQ 145]] Where can I find more information on SWT?
 
  
 +
=== Standard Widget Toolkit (SWT) ===
  
===[[FAQ Chapter 8 | Chapter 8 JFace]]===
+
One of the great success stories of the Eclipse Platform has been the overwhelming groundswell of support for its windowing toolkit, SWT. This toolkit offers a fast, thin, mostly native alternative to the most common Java UI toolkits, Swing and Abstract Windowing Toolkit (AWT). Religious debates abound over the relative merits of Swing versus SWT, and we take great pains to avoid these debates here. Suffice it to say that SWT generates massive interest and manages to garner as much, if not more, interest as the Eclipse Platform built on top of it.
  
:*[[FAQ 146]] What is a viewer?
+
The popularity of SWT has forced us to take a slightly different approach with this chapter. The SWT newsgroup was created in July 2003 and since then has generated an average of 136 messages every day. In this book, we could not even scratch the surface of the information available there. Although we could present the illusion of completeness by answering a couple dozen popular technical questions, we would not be doing the topic justice. Instead, we focus on answering a few of the higher-level questions and providing as many forward pointers as we can to further information on SWT available elsewhere. A benefit of SWT’s popularity is the wealth of Web sites, discussion forums, books, and other forms of documentation out there. Thus, although we won’t be able to answer all SWT questions, we hope at least to steer you to the resources that can. However, a handful of questions are asked so often that we can’t resist answering them here.
:*[[FAQ 147]] What are content and label providers?
+
:*[[FAQ 148]] What kinds of viewers does JFace provide?
+
:*[[FAQ 149]] Why should I use a viewer?
+
:*[[FAQ 150]] How do I sort the contents of a viewer?
+
:*[[FAQ 151]] How do I filter the contents of a viewer?
+
:*[[FAQ 152]] How do I use properties to optimize a viewer?
+
:*[[FAQ 153]] What is a label decorator?
+
:*[[FAQ 154]] How do I use image and font registries?
+
:*[[FAQ 155]] What is a wizard?
+
:*[[FAQ 156]] How do I specify the order of pages in a wizard?
+
:*[[FAQ 157]] How can I reuse wizard pages in more than one wizard?
+
:*[[FAQ 158]] Can I reuse wizards from other plug-ins?
+
:*[[FAQ 159]] How do I make my wizard appear in the UI?
+
:*[[FAQ 160]] How do I run a lengthy process in a wizard?
+
:*[[FAQ 161]] How do I launch the preference page that belongs to my plug-in?
+
:*[[FAQ 162]] How do I ask a simple yes or no question?
+
:*[[FAQ 163]] How do I inform the user of a problem?
+
:*[[FAQ 164]] How do I create a dialog with a details area?
+
:*[[FAQ 165]] How do I set the title of a custom dialog?
+
:*[[FAQ 166]] How do I save settings for a dialog or wizard?
+
  
 +
:*[[FAQ What is SWT?]]
 +
:*[[FAQ Why does Eclipse use SWT?]]
 +
:*[[FAQ Can I use SWT outside Eclipse for my own project?]]
 +
:*[[FAQ How do I configure an Eclipse Java project to use SWT?]]
 +
:*[[FAQ How do I create an executable JAR file for a stand-alone SWT program?]]
 +
:*[[FAQ Are there any visual composition editors available for SWT?]]
 +
:*[[FAQ Why do I have to dispose of colors, fonts, and images?]]
 +
:*[[FAQ Why do I get an invalid thread access exception?]]
 +
:*[[FAQ How do I get a Display instance?]]
 +
:*[[FAQ How do I prompt the user to select a file or a directory?]]
 +
:*[[FAQ How do I display a Web page in SWT?]]
 +
:*[[FAQ How do I embed AWT and Swing inside SWT?]]
 +
:*[[FAQ Where can I find more information on SWT? ]]
  
===[[FAQ Chapter 9 | Chapter 9 Generic Workbench]]===
+
=== JFace ===
  
:*[[FAQ 167]] Pages, parts, sites, windows: What is all this stuff?
+
JFace is a Java application framework based on SWT. The goal of JFace is to provide a set of reusable components that make it easier to write a Java-based GUI application. Among the components JFace provides are such familiar GUI concepts as wizards, preference pages, actions, and dialogs. These components tend to be the bits and pieces that are integral to the basic widget set but are common enough that there is significant benefit to drawing them together into a reusable framework. Although its heritage is based on a long line of frameworks for writing IDEs, most of JFace is generally useful in a broad range of graphical desktop applications. JFace has a few connections to classes in the Eclipse runtime kernel, but it is fairly straightforward to extract JFace and SWT for use in stand-alone Java applications that are not based on the Eclipse runtime. JFace does not make use of such Eclipse-specific concepts as extensions and extension points.
:*[[FAQ 168]] How do I find out what object is selected?
+
:*[[FAQ 169]] How do I find out what view or editor is selected?
+
:*[[FAQ 170]] How do I find the active workbench page?
+
:*[[FAQ 171]] How do I show progress on the workbench status line?
+
:*[[FAQ 172]] Why should I use the new progress service?
+
:*[[FAQ 173]] How do I write a message to the workbench status line?
+
:*[[FAQ 174]] How do I create a label decorator declaratively?
+
:*[[FAQ 175]] How do I add label decorations to my viewer?
+
:*[[FAQ 176]] How do I make the workbench shutdown?
+
:*[[FAQ 177]] How can I use IWorkbenchAdapter to display my model elements?
+
:*[[FAQ 178]] How do I create my own preference page?
+
:*[[FAQ 179]] How do I use property pages?
+
:*[[FAQ 180]] How do I open a Property dialog?
+
:*[[FAQ 181]] How do I add my wizard to the New, Import, or Export menu categories?
+
:*[[FAQ 182]] Can I activate my plug-in when the workbench starts?
+
:*[[FAQ 183]] How do I create an image registry for my plug-in?
+
:*[[FAQ 184]] How do I use images defined by other plug-ins?
+
:*[[FAQ 185]] How do I show progress for things happening in the background?
+
:*[[FAQ 186]] How do I switch from using a Progress dialog to the Progress view?
+
:*[[FAQ 187]] Can I make a job run in the UI thread?
+
:*[[FAQ 188]] Are there any special Eclipse UI guidelines?
+
:*[[FAQ 189]] Why do the names of some interfaces end with the digit 2?
+
  
 +
:*[[FAQ What is a viewer?]]
 +
:*[[FAQ What are content and label providers?]]
 +
:*[[FAQ What kinds of viewers does JFace provide?]]
 +
:*[[FAQ Why should I use a viewer?]]
 +
:*[[FAQ How do I sort the contents of a viewer?]]
 +
:*[[FAQ How do I filter the contents of a viewer?]]
 +
:*[[FAQ How do I use properties to optimize a viewer?]]
 +
:*[[FAQ What is a label decorator?]]
 +
:*[[FAQ How do I use image and font registries?]]
 +
:*[[FAQ What is a wizard?]]
 +
:*[[FAQ How do I specify the order of pages in a wizard?]]
 +
:*[[FAQ How can I reuse wizard pages in more than one wizard?]]
 +
:*[[FAQ Can I reuse wizards from other plug-ins?]]
 +
:*[[FAQ How do I make my wizard appear in the UI?]]
 +
:*[[FAQ How do I run a lengthy process in a wizard?]]
 +
:*[[FAQ How do I launch the preference page that belongs to my plug-in?]]
 +
:*[[FAQ How do I ask a simple yes or no question?]]
 +
:*[[FAQ How do I inform the user of a problem?]]
 +
:*[[FAQ How do I create a dialog with a details area?]]
 +
:*[[FAQ How do I set the title of a custom dialog?]]
 +
:*[[FAQ How do I save settings for a dialog or wizard?]]
 +
:*[[FAQ How to decorate a TableViewer or TreeViewer with Columns?]]
 +
:*[[FAQ How do I configure my Eclipse project to use stand-alone JFace?]]
 +
:*[[FAQ How do I deploy a stand-alone JFace application?]]
  
===[[FAQ Chapter 10 | Chapter 10 Perspectives and Views]]===
+
=== Generic Workbench ===
  
:*[[FAQ 190]] How do I create a new perspective?
+
This chapter covers FAQs relating to the generic workbench and its APIs. Workbench is the term used for the generic Eclipse UI. Originally the UI was called the desktop, but because Eclipse was a platform primarily for tools rather than for stationery, workbench was deemed more suitable. In Eclipse 3.0, tools are no longer the sole focus, so the term Rich Client Platform, is starting to creep in as the term for the generic, non-tool-specific UI. After all, people don’t want to play mine sweeper or send e-mails to Mom from such a prosaically named application as a workbench. A rich client, on the other hand, is always welcome at the dinner table.
:*[[FAQ 191]] How can I add my views and actions to an existing perspective?
+
:*[[FAQ 192]] How do I show a given perspective?
+
:*[[FAQ 193]] What is the difference between a perspective and a workbench page?
+
:*[[FAQ 194]] How do I create fixed views and perspectives?
+
:*[[FAQ 195]] What is a view?
+
:*[[FAQ 196]] What is the difference between a view and a viewer?
+
:*[[FAQ 197]] How do I create my own view?
+
:*[[FAQ 198]] How do I set the size or position of my view?
+
:*[[FAQ 199]] Why can't I control when, where, and how my view is presented?
+
:*[[FAQ 200]] How will my view show up in the Show View menu?
+
:*[[FAQ 201]] How do I make my view appear in the Show In menu?
+
:*[[FAQ 202]] How do I add actions to a view's menu and toolbar?
+
:*[[FAQ 203]] How do I make a view respond to selection changes in another view?
+
:*[[FAQ 204]] How does a view persist its state between sessions?
+
:*[[FAQ 205]] How do I open multiple instances of the same view?
+
  
 +
Many of the important workbench concepts, such as editors, views, and actions, generate enough questions that they deserve their own chapters. This chapter focuses on general questions about integrating your plug-in with the various extension hooks the workbench provides.
  
===[[FAQ Chapter 11 | Chapter 11 Generic Editors]]===
+
:*[[FAQ Pages, parts, sites, windows: What is all this stuff?]]
 +
:*[[FAQ How do I find out what object is selected?]]
 +
:*[[FAQ How do I find out what view or editor is selected?]]
 +
:*[[FAQ How do I find the active workbench page?]]
 +
:*[[FAQ How do I show progress on the workbench status line?]]
 +
:*[[FAQ Why should I use the new progress service?]]
 +
:*[[FAQ How do I write a message to the workbench status line?]]
 +
:*[[FAQ How do I create a label decorator declaratively?]]
 +
:*[[FAQ How do I add label decorations to my viewer?]]
 +
:*[[FAQ How do I make the workbench shutdown?]]
 +
:*[[FAQ How can I use IWorkbenchAdapter to display my model elements?]]
 +
:*[[FAQ How do I create my own preference page?]]
 +
:*[[FAQ How do I use property pages?]]
 +
:*[[FAQ How do I open a Property dialog?]]
 +
:*[[FAQ How do I add my wizard to the New, Import, or Export menu categories?]]
 +
:*[[FAQ Can I activate my plug-in when the workbench starts?]]
 +
:*[[FAQ How do I create an image registry for my plug-in?]]
 +
:*[[FAQ How do I use images defined by other plug-ins?]]
 +
:*[[FAQ How do I show progress for things happening in the background?]]
 +
:*[[FAQ How do I switch from using a Progress dialog to the Progress view?]]
 +
:*[[FAQ Can I make a job run in the UI thread?]]
 +
:*[[FAQ Are there any special Eclipse UI guidelines?]]
 +
:*[[FAQ Why do the names of some interfaces end with the digit 2?]]
  
:*[[FAQ 206]] What is the difference between a view and an editor?
+
=== Perspectives and Views ===
:*[[FAQ 207]] How do I open an editor programmatically?
+
:*[[FAQ 208]] How do I open an external editor?
+
:*[[FAQ 209]] How do I dynamically register an editor to handle a given extension?
+
:*[[FAQ 210]] How do I switch to vi or emacs-style key bindings?
+
:*[[FAQ 211]] How do I create my own editor?
+
:*[[FAQ 212]] How do I enable the Save and Revert actions?
+
:*[[FAQ 213]] How do I enable global actions such as Cut, Paste, and Print in my editor?
+
:*[[FAQ 214]] How do I hook my editor to the Back and Forward buttons?
+
:*[[FAQ 215]] How do I create a form-based editor, such as the plug-in Manifest Editor?
+
:*[[FAQ 216]] How do I create a graphical editor?
+
:*[[FAQ 217]] How do I make an editor that contains another editor?
+
  
 +
This chapter answers questions about two central concepts in the Eclipse Platform UI. Perspectives define the set of actions and parts that appear in a workbench window and specify the initial size and position of views within that window. Views are the draggable parts that make up the bulk of a workbench window’s contents. This chapter does not deal with any specific perspectives or views, but with questions that arise when you implement your own perspectives and views.
  
===[[FAQ Chapter 12 | Chapter 12 Actions, Commands, and Activities]]===
+
:*[[FAQ How do I create a new perspective?]]
 +
:*[[FAQ How can I add my views and actions to an existing perspective?]]
 +
:*[[FAQ How do I show a given perspective?]]
 +
:*[[FAQ What is the difference between a perspective and a workbench page?]]
 +
:*[[FAQ How do I create fixed views and perspectives?]]
 +
:*[[FAQ What is a view?]]
 +
:*[[FAQ What is the difference between a view and a viewer?]]
 +
:*[[FAQ How do I create my own view?]]
 +
:*[[FAQ How do I set the size or position of my view?]]
 +
:*[[FAQ Why can't I control when, where, and how my view is presented?]]
 +
:*[[FAQ How will my view show up in the Show View menu?]]
 +
:*[[FAQ How do I make my view appear in the Show In menu?]]
 +
:*[[FAQ How do I add actions to a view's menu and toolbar?]]
 +
:*[[FAQ How do I make a view respond to selection changes in another view?]]
 +
:*[[FAQ How does a view persist its state between sessions?]]
 +
:*[[FAQ How do I open multiple instances of the same view?]]
  
:*[[FAQ 218]] Actions, commands, operations, jobs: What does it all mean?
 
:*[[FAQ 219]] What is an action set?
 
:*[[FAQ 220]] How do I make my action set visible?
 
:*[[FAQ 221]] How do I add actions to the global toolbar?
 
:*[[FAQ 222]] How do I add menus to the main menu?
 
:*[[FAQ 223]] How do I add actions to the main menu?
 
:*[[FAQ 224]] Why are some actions activated without a target?
 
:*[[FAQ 225]] Where can I find a list of existing action group names?
 
:*[[FAQ 226]] What is the difference between a command and an action?
 
:*[[FAQ 227]] How do I associate an action with a command?
 
:*[[FAQ 228]] How do I create my own key-binding configuration?
 
:*[[FAQ 229]] How do I provide a keyboard shortcut for my action?
 
:*[[FAQ 230]] How can I change the name or tooltip of my action?
 
:*[[FAQ 231]] How do I hook into global actions, such as Copy and Delete?
 
:*[[FAQ 232]] How do I build menus and toolbars programmatically?
 
:*[[FAQ 233]] How do I make menus with dynamic contents?
 
:*[[FAQ 234]] What is the difference between a toolbar and a cool bar?
 
:*[[FAQ 235]] Can other plug-ins add actions to my part's context menu?
 
:*[[FAQ 236]] How do I add other plug-ins' actions to my menus?
 
:*[[FAQ 237]] What is the purpose of activities?
 
:*[[FAQ 238]] How do I add activities to my plug-in?
 
:*[[FAQ 239]] How do activities get enabled?
 
:*[[FAQ 240]] What is the difference between perspectives and activities?
 
  
 +
=== Generic Editors ===
  
===[[FAQ Chapter 13 | Chapter 13 Building Your Own Application]]===
+
In Eclipse, editors are parts that have an associated input inside a workbench window and additional lifecycle methods, such as save and revert. This chapter answers questions about interacting with editors and about writing your own editors, whether they are text based or graphical. See Chapter 15 for a complete treatment of questions about writing your own text-based editors.
  
:*[[FAQ 241]] What is an Eclipse application?
+
:*[[FAQ What is the difference between a view and an editor?]]
:*[[FAQ 242]] How do I create an application?
+
:*[[FAQ How do I open an editor programmatically?]]
:*[[FAQ 243]] What is the minimal Eclipse configuration?
+
:*[[FAQ How do I open an external editor?]]
:*[[FAQ 244]] How do I create a Rich Client application?
+
:*[[FAQ How do I dynamically register an editor to handle a given extension?]]
:*[[FAQ 245]] How do I customize the menus in an RCP application?
+
:*[[FAQ How do I switch to vi or emacs-style key bindings?]]
:*[[FAQ 246]] How do I make key bindings work in an RCP application?
+
:*[[FAQ How do I create my own editor?]]
:*[[FAQ 247]] Can I create an application that doesn't have views or editors?
+
:*[[FAQ How do I enable the Save and Revert actions?]]
:*[[FAQ 248]] How do I specify where application data is stored?
+
:*[[FAQ How do I enable global actions such as Cut, Paste, and Print in my editor?]]
:*[[FAQ 249]] Can I create an application that doesn't have a data location?
+
:*[[FAQ How do I hook my editor to the Back and Forward buttons?]]
:*[[FAQ 250]] What is an Eclipse product?
+
:*[[FAQ How do I create a form-based editor, such as the plug-in Manifest Editor?]]
:*[[FAQ 251]] What is the difference between a product and an application?
+
:*[[FAQ How do I create a graphical editor?]]
:*[[FAQ 252]] How do I distribute my Eclipse offering?
+
:*[[FAQ How do I make an editor that contains another editor?]]
:*[[FAQ 253]] Can I use an installation program to distribute my Eclipse product?
+
:*[[FAQ 254]] Can I install my product as an add-on to another product?  
+
  
  
===[[FAQ Chapter 14 | Chapter 14 Productizing an Eclipse Offering]]===
+
=== Actions, Commands, and Activities ===
  
:*[[FAQ 255]] Where do I find suitable Eclipse logos and wordmarks?
+
This chapter answers questions about creating menu bars, context menus, and tool bars and the actions that fill them. A variety of both declarative and programmatic methods are available for contributing actions to the Eclipse UI and for managing and filtering those actions once they have been defined. This chapter also discusses the various ways to execute the long-running tasks that can be triggered by menu and toolbar actions.
:*[[FAQ 256]] When do I need to write a plug-in install handler?
+
:*[[FAQ 257]] How do I support multiple natural languages in my plug-in messages?
+
:*[[FAQ 258]] How do I replace the Eclipse workbench window icon with my own?
+
:*[[FAQ 259]] How do I write my own eclipseexe platform launcher?
+
:*[[FAQ 260]] Who shows the Eclipse splash screen?
+
:*[[FAQ 261]] How can I publish partial upgrades (patches) to my product?
+
  
 +
'''Actions are currently considered to be inferior to commands. The following information about actions is still left here to help people which are still using actions. If you can you should use commands.'''
  
== Part III The Eclipse IDE Platform ==
 
  
 +
:*[[FAQ Actions, commands, operations, jobs: What does it all mean?]]
 +
:*[[FAQ What is an action set?]]
 +
:*[[FAQ How do I make my action set visible?]]
 +
:*[[FAQ How do I add actions to the global toolbar?]]
 +
:*[[FAQ How do I add menus to the main menu?]]
 +
:*[[FAQ How do I add actions to the main menu?]]
 +
:*[[FAQ Why are some actions activated without a target?]]
 +
:*[[FAQ Where can I find a list of existing action group names?]]
 +
:*[[FAQ What is the difference between a command and an action?]]
 +
:*[[FAQ How do I associate an action with a command?]]
 +
:*[[FAQ How do I create my own key-binding configuration?]]
 +
:*[[FAQ How do I provide a keyboard shortcut for my action?]]
 +
:*[[FAQ How can I change the name or tooltip of my action?]]
 +
:*[[FAQ How do I hook into global actions, such as Copy and Delete?]]
 +
:*[[FAQ How do I build menus and toolbars programmatically?]]
 +
:*[[FAQ How do I make menus with dynamic contents?]]
 +
:*[[FAQ What is the difference between a toolbar and a cool bar?]]
 +
:*[[FAQ How to create a context menu & add actions to the same?]]
 +
:*[[FAQ Can other plug-ins add actions to my part's context menu?]]
 +
:*[[FAQ How do I add other plug-ins' actions to my menus?]]
 +
:*[[FAQ What is the purpose of activities?]]
 +
:*[[FAQ How do I add activities to my plug-in?]]
 +
:*[[FAQ How do activities get enabled?]]
 +
:*[[FAQ What is the difference between perspectives and activities?]]
  
===[[FAQ Chapter 15 | Chapter 15 Text Editors]]===
+
=== Building Your Own Application ===
  
:*[[FAQ 262]] What support is there for creating custom text editors?
+
Prior to the introduction of RCP, most of the Eclipse community was focused on developing plug-ins for a particular Eclipse application called the workbench. Eclipse, however, has always supported the ability to create your own stand alone applications based on the Eclipse plug-in architecture. Eclipse applications can range from simple headless programs with no user interface to full-blown IDEs. In Eclipse 3.0, the platform began a shift toward giving greater power and flexibility to applications built on the Eclipse infrastructure. This chapter guides you through the process of building your own Eclipse application and explores some of the new Eclipse 3.0 APIs available only to applications.
:*[[FAQ 263]] I'm still confused! How do all the editor pieces fit together?
+
:*[[FAQ 264]] How do I get started with creating a custom text editor?
+
:*[[FAQ 265]] How do I use the text document model?
+
:*[[FAQ 266]] What is a document partition?
+
:*[[FAQ 267]] How do I add Content Assist to my editor?
+
:*[[FAQ 268]] How do I provide syntax coloring in an editor?
+
:*[[FAQ 269]] How do I support formatting in my editor?
+
:*[[FAQ 270]] How do I insert text in the active text editor?
+
:*[[FAQ 271]] What is the difference between highlight range and selection?
+
:*[[FAQ 272]] How do I change the selection on a double-click in my editor?
+
:*[[FAQ 273]] How do I use a model reconciler?
+
  
 +
:*[[FAQ What is an Eclipse application?]]
 +
:*[[FAQ How do I create an application?]]
 +
:*[[FAQ What is the minimal Eclipse configuration?]]
 +
:*[[FAQ How do I create a Rich Client application?]]
 +
:*[[FAQ How do I customize the menus in an RCP application?]]
 +
:*[[FAQ How do I make key bindings work in an RCP application?]]
 +
:*[[FAQ Can I create an application that doesn't have views or editors?]]
 +
:*[[FAQ How do I specify where application data is stored?]]
 +
:*[[FAQ Can I create an application that doesn't have a data location?]]
 +
:*[[FAQ What is an Eclipse product?]]
 +
:*[[FAQ How do I create an Eclipse product?]]
 +
:*[[FAQ What is the difference between a product and an application?]]
 +
:*[[FAQ How do I distribute my Eclipse offering?]]
 +
:*[[FAQ Can I use an installation program to distribute my Eclipse product?]]
 +
:*[[FAQ Can I install my product as an add-on to another product?]]
  
===[[FAQ Chapter 16 | Chapter 16 Help, Search, and Compare]]===
+
=== Productizing an Eclipse Offering ===
  
:*[[FAQ 274]] How do I add help content to my plug-in?
+
In this chapter, we look at turning an Eclipse configuration into a product. When an Eclipse product is created, the anonymous collection of plug-ins takes on application-specific branding, complete with custom images, splash screen, and launcher. In creating your own product, you typically also need to write an installer and uninstaller and consider how your users will obtain and upgrade your product.
:*[[FAQ 275]] How do I provide F1 help?
+
:*[[FAQ 276]] How do I contribute help contexts?
+
:*[[FAQ 277]] How can I generate HTML and toc.xml files?
+
:*[[FAQ 278]] How do I write a Search dialog?
+
:*[[FAQ 279]] How do I implement a search operation?
+
:*[[FAQ 280]] How do I display search results?
+
:*[[FAQ 281]] How can I use and extend the compare infrastructure?
+
:*[[FAQ 282]] How do I create a Compare dialog?
+
:*[[FAQ 283]] How do I create a compare editor?
+
  
 +
:*[[FAQ Where do I find suitable Eclipse logos and wordmarks?]]
 +
:*[[FAQ When do I need to write a plug-in install handler?]]
 +
:*[[FAQ How do I support multiple natural languages in my plug-in messages?]]
 +
:*[[FAQ How do I replace the Eclipse workbench window icon with my own?]]
 +
:*[[FAQ How do I write my own eclipseexe platform launcher?]]
 +
:*[[FAQ Who shows the Eclipse splash screen?]]
 +
:*[[FAQ How can I publish partial upgrades (patches) to my product?]]
  
===[[FAQ Chapter 17 | Chapter 17 Workspace and Resources API]]===
 
  
:*[[FAQ 284]] How are resources created?
+
== Part III -- The Eclipse IDE Platform ==
:*[[FAQ 285]] Can I create resources that don't reside in the file system?
+
:*[[FAQ 286]] What is the difference between a path and a location?
+
:*[[FAQ 287]] When should I use refreshLocal?
+
:*[[FAQ 288]] How do I create my own tasks, problems, bookmarks, and so on?
+
:*[[FAQ 289]] How can I be notified of changes to the workspace?
+
:*[[FAQ 290]] How do I prevent builds between multiple changes to the workspace?
+
:*[[FAQ 291]] Why should I add my own project nature?
+
:*[[FAQ 292]] Where can I find information about writing builders?
+
:*[[FAQ 293]] How do I store extra properties on a resource?
+
:*[[FAQ 294]] How can I be notified on property changes on a resource?
+
:*[[FAQ 295]] How and when do I save the workspace?
+
:*[[FAQ 296]] How can I be notified when the workspace is being saved?
+
:*[[FAQ 297]] Where is the workspace local history stored?
+
:*[[FAQ 298]] How can I repair a workspace that is broken?
+
:*[[FAQ 299]] What support does the workspace have for team tools?
+
  
 +
=== Text Editors ===
  
===[[FAQ Chapter 18 | Chapter 18 Workbench IDE]]===
+
The most important purpose of an IDE is to browse and edit code. Therefore, perhaps even more than any other IDE platform, the Eclipse editor framework has grown into a highly evolved, flexible, easy-to-use, and easy-to-extend environment for editing program source files. In this chapter, we look at what support exists for writing editors and how easy it is to plug them into the Eclipse IDE platform.
  
:*[[FAQ 300]] How do I open an editor on a file in the workspace?
+
:*[[FAQ What support is there for creating custom text editors?]]
:*[[FAQ 301]] How do I open an editor on a file outside the workspace?
+
:*[http://www.eclipse.org/eclipse/platform-text/development/rcp/examples/index.html Where can I find RCP text editor examples?]
:*[[FAQ 302]] How do I open an editor on something that is not a file?
+
:*[[FAQ I'm still confused! How do all the editor pieces fit together?]]
:*[[FAQ 303]] Why don't my markers show up in the Tasks view?
+
:*[[FAQ How do I get started with creating a custom text editor?]]
:*[[FAQ 304]] Why don't my markers appear in the editor's vertical ruler?
+
:*[[FAQ How do I use the text document model?]]
:*[[FAQ 305]] How do I access the active project?
+
:*[[FAQ What is a document partition?]]
:*[[FAQ 306]] What are IWorkspaceRunnable, IRunnableWithProgress, and WorkspaceModifyOperation?
+
:*[[FAQ How do I add Content Assist to my editor?]]
:*[[FAQ 307]] How do I write to the console from a plug-in?
+
:*[[FAQ How do I provide syntax coloring in an editor?]]
:*[[FAQ 308]] How do I prompt the user to select a resource?
+
:*[[FAQ How do I support formatting in my editor?]]
:*[[FAQ 309]] Can I use the actions from the Navigator in my own plug-in?
+
:*[[FAQ How do I insert text in the active text editor?]]
:*[[FAQ 310]] What APIs exist for integrating repository clients into Eclipse?
+
:*[[FAQ What is the difference between highlight range and selection?]]
:*[[FAQ 311]] How do I deploy projects to a server and keep the two synchronized?
+
:*[[FAQ How do I change the selection on a double-click in my editor?]]
:*[[FAQ 312]] What is the difference between a repository provider and a team subscriber?
+
:*[[FAQ How do I use a model reconciler?]]
:*[[FAQ 313]] What is a launch configuration?
+
:*[[FAQ 314]] When do I use a launch delegate?
+
:*[[FAQ 315]] What is Ant?
+
:*[[FAQ 316]] Why can't my Ant build find javac?
+
:*[[FAQ 317]] How do I add my own external tools?
+
:*[[FAQ 318]] How do I create an external tool builder?
+
  
 +
=== Help, Search, and Compare ===
  
===[[FAQ Chapter 18 | Chapter 19 Implementing Support for Your Own Language]]===
+
Admittedly, this chapter covers a number of unrelated components in the Eclipse Platform. They have in common the fact that each is designed as an independent plug-in that can be added to any Eclipse-based application. Although they are at home mostly in IDE applications, these plug-ins can also be inserted into RCP applications when help, search, or compare facilities are needed.
  
:*[[FAQ 319]] What is eScript?
+
:*[[FAQ How do I add help content to my plug-in?]]
:*[[FAQ 320]] Language integration phase 1: How do I compile and build programs?
+
:*[[FAQ How do I provide F1 help?]]
:*[[FAQ 321]] How do I load source files edited outside Eclipse?
+
:*[[FAQ How do I contribute help contexts?]]
:*[[FAQ 322]] How do I run an external builder on my source files?
+
:*[[FAQ How can I generate HTML and toc.xml files?]]
:*[[FAQ 323]] How do I implement a compiler that runs inside Eclipse?
+
:*[[FAQ How do I write a Search dialog?]]
:*[[FAQ 324]] How do I react to changes in source files?
+
:*[[FAQ How do I implement a search operation?]]
:*[[FAQ 325]] How do I implement an Eclipse builder?
+
:*[[FAQ How do I display search results?]]
:*[[FAQ 326]] Where are project build specifications stored?
+
:*[[FAQ How can I use and extend the compare infrastructure?]]
:*[[FAQ 327]] How do I add a builder to a given project?
+
:*[[FAQ How do I create a Compare dialog?]]
:*[[FAQ 328]] How do I implement an incremental project builder?
+
:*[[FAQ How do I create a compare editor?]]
:*[[FAQ 329]] How do I handle setup problems for a given builder?
+
:*[[FAQ How can I run an infocenter on different servers?]]
:*[[FAQ 330]] How do I make my compiler incremental?
+
:*[[FAQ 331]] Language integration phase 2: How do I implement a DOM?
+
:*[[FAQ 332]] How do I implement a DOM for my language?
+
:*[[FAQ 333]] How can I ensure that my model is scalable?
+
:*[[FAQ 334]] Language integration phase 3: How do I edit programs?
+
:*[[FAQ 335]] How do I write an editor for my own language?
+
:*[[FAQ 336]] How do I add Content Assist to my language editor?
+
:*[[FAQ 337]] How do I add hover support to my text editor?
+
:*[[FAQ 338]] How do I create problem markers for my compiler?
+
:*[[FAQ 339]] How do I implement Quick Fixes for my own language?
+
:*[[FAQ 340]] How do I support refactoring for my own language?
+
:*[[FAQ 341]] How do I create an Outline view for my own language editor?
+
:*[[FAQ 342]] Language integration phase 4: What are the finishing touches?
+
:*[[FAQ 343]] What wizards do I define for my own language?
+
:*[[FAQ 344]] When does my language need its own nature?
+
:*[[FAQ 345]] When does my language need its own perspective?
+
:*[[FAQ 346]] How do I add documentation and help for my own language?
+
:*[[FAQ 347]] How do I support source-level debugging for my own language?
+
  
 +
=== Workspace and Resources API ===
  
===[[FAQ Chapter 19 | Chapter 20 Java Development Tool API]]===
+
A program is never written in isolation but instead depends on other code, icons, data, and configuration files. An extendable IDE should provide access to wherever these artifacts are stored. In Eclipse, the artifacts are referred to as resources and are stored in a workspace. The FAQs in this chapter show how resources are managed in a workspace and what API is available to control and track their lifecycle.
  
:*[[FAQ 348]] How do I extend the JDT?
+
:*[[FAQ How are resources created?]]
:*[[FAQ 349]] What is the Java model?
+
:*[[FAQ Can I create resources that don't reside in the file system?]]
:*[[FAQ 350]] How do I create Java elements?
+
:*[[FAQ What is the difference between a path and a location?]]
:*[[FAQ 351]] How do I create a Java project?
+
:*[[FAQ When should I use refreshLocal?]]
:*[[FAQ 352]] How do I manipulate Java code?
+
:*[[FAQ How do I create my own tasks, problems, bookmarks, and so on?]]
:*[[FAQ 353]] What is a working copy?
+
:*[[FAQ How can I be notified of changes to the workspace?]]
:*[[FAQ 354]] What is a JDOM?
+
:*[[FAQ How do I prevent builds between multiple changes to the workspace?]]
:*[[FAQ 355]] What is an AST?
+
:*[[FAQ Why should I add my own project nature?]]
:*[[FAQ 356]] How do I create and examine an AST?
+
:*[[FAQ Where can I find information about writing builders?]]
:*[[FAQ 357]] How do I distinguish between internal and external JARs on the build path?
+
:*[[FAQ How do I store extra properties on a resource?]]
:*[[FAQ 358]] How do I launch a Java program?
+
:*[[FAQ How can I be notified on property changes on a resource?]]
:*[[FAQ 359]] What is JUnit?
+
:*[[FAQ How and when do I save the workspace?]]
:*[[FAQ 360]] How do I participate in a refactoring?
+
:*[[FAQ How can I be notified when the workspace is being saved?]]
:*[[FAQ 361]] What is LTK?
+
:*[[FAQ Where is the workspace local history stored?]]
 +
:*[[FAQ How can I repair a workspace that is broken?]]
 +
:*[[FAQ What support does the workspace have for team tools?]]
  
  
== Where to buy the book ==
+
=== Workbench IDE ===
  
[http://www.amazon.com/exec/obidos/ASIN/0321268385 Amazon.com]
+
The remaining plug-ins in the Eclipse Platform are truly oriented toward writing development tools. This chapter covers elements of the Eclipse IDE workbench, found in the org.eclipse.ui.ide plug-in. This plug-in includes most of the standard platform views, such as Navigator, Tasks, Problems, Properties, and Bookmark. We also take a quick look at advanced topics, such as writing repository clients and debuggers.
 +
 
 +
:*[[FAQ How do I open an editor on a file in the workspace?]]
 +
:*[[FAQ How do I open an editor on a file outside the workspace?]]
 +
:*[[FAQ How do I open an editor on something that is not a file?]]
 +
:*[[FAQ Why don't my markers show up in the Tasks view?]]
 +
:*[[FAQ Why don't my markers appear in the editor's vertical ruler?]]
 +
:*[[FAQ How do I access the active project?]]
 +
:*[[FAQ What are IWorkspaceRunnable, IRunnableWithProgress, and WorkspaceModifyOperation?]]
 +
:*[[FAQ How do I write to the console from a plug-in?]]
 +
:*[[FAQ How do I prompt the user to select a resource?]]
 +
:*[[FAQ Can I use the actions from the Navigator in my own plug-in?]]
 +
:*[[FAQ What APIs exist for integrating repository clients into Eclipse?]]
 +
:*[[FAQ How do I deploy projects to a server and keep the two synchronized?]]
 +
:*[[FAQ What is the difference between a repository provider and a team subscriber?]]
 +
:*[[FAQ What is a launch configuration?]]
 +
:*[[FAQ When do I use a launch delegate?]]
 +
:*[[FAQ What is Ant?]]
 +
:*[[FAQ Why can't my Ant build find javac?]]
 +
:*[[FAQ How do I add my own external tools?]]
 +
:*[[FAQ How do I create an external tool builder?]]
 +
 
 +
 
 +
=== Implementing Support for Your Own Language ===
 +
 
 +
Through its JDT project, Eclipse has strong support for Java development, such as editing, refactoring, building, launching, and debugging. Likewise, the C development tools (CDT) project aims for similar support for writing C/C++ code. This chapter discusses some of the issues to address when you have your own language and want to host it in Eclipse for writing programs and plug-ins. We look at the various ways of integrating with Eclipse: from no integration to a fully integrated language development environment. To structure our discussion, we take a closer look at eScript, an experimental script language developed especially for this book. As is the case for all examples described in this book, you can find eScript on this book’s CD-ROM or Web site (http://eclipsefaq.org).
 +
 
 +
Many questions have been addressed in other FAQs in this book and may be somewhat repetitive. However, if you are planning to implement support for your own programming language, this chapter might serve well as a comprehensive overview of how to approach this big task.
 +
 
 +
Any classification of integration of a new programming language with Eclipse is somewhat arbitrary. We have identified the following degrees of integration of a new programming language, such as eScript, with Eclipse:
 +
 
 +
* Phase 1—Compiling code and building projects. To obtain full integration with Eclipse in the area of compilation of programs and build processes for your own language, follow the various steps outlined in the FAQs below.
 +
     
 +
* Phase 2—Implementing a DOM. The DOM is an in-memory structural representation of the source code of a program written in your language. Using the structural information contained in the DOM, all kinds of analysis and refactoring tools can be built.
 +
     
 +
* Phase 3—editing programs. After writing a compiler, a builder, and a DOM, you are ready to consider all the individual steps to build the ultimate Eclipse editor for your language.
 +
     
 +
* Phase 4—Adding the finishing touches. To give your language IDE a professional look, follow the steps outlined in the FAQs below.
 +
 
 +
If you carefully observe these four phases, you will find that the visual aspects of your language IDE happen late in the process. You will have to do some legwork before you are able to get to the pretty parts. We recommend patience and restraint. Time spent in phases 1 and 2 will be well spent, and once you get to phase 3 and 4, you will be grateful that you followed all the steps we outlined.
 +
 
 +
:*[[FAQ What is eScript?]]
 +
:*[[FAQ Language integration phase 1: How do I compile and build programs?]]
 +
:*[[FAQ How do I load source files edited outside Eclipse?]]
 +
:*[[FAQ How do I run an external builder on my source files?]]
 +
:*[[FAQ How do I implement a compiler that runs inside Eclipse?]]
 +
:*[[FAQ How do I react to changes in source files?]]
 +
:*[[FAQ How do I implement an Eclipse builder?]]
 +
:*[[FAQ Where are project build specifications stored?]]
 +
:*[[FAQ How do I add a builder to a given project?]]
 +
:*[[FAQ How do I implement an incremental project builder?]]
 +
:*[[FAQ How do I handle setup problems for a given builder?]]
 +
:*[[FAQ How do I make my compiler incremental?]]
 +
:*[[FAQ Language integration phase 2: How do I implement a DOM?]]
 +
:*[[FAQ How do I implement a DOM for my language?]]
 +
:*[[FAQ How can I ensure that my model is scalable?]]
 +
:*[[FAQ Language integration phase 3: How do I edit programs?]]
 +
:*[[FAQ How do I write an editor for my own language?]]
 +
:*[[FAQ How do I add Content Assist to my language editor?]]
 +
:*[[FAQ How do I add hover support to my text editor?]]
 +
:*[[FAQ How do I create problem markers for my compiler?]]
 +
:*[[FAQ How do I implement Quick Fixes for my own language?]]
 +
:*[[FAQ How do I support refactoring for my own language?]]
 +
:*[[FAQ How do I create an Outline view for my own language editor?]]
 +
:*[[FAQ Language integration phase 4: What are the finishing touches?]]
 +
:*[[FAQ What wizards do I define for my own language?]]
 +
:*[[FAQ When does my language need its own nature?]]
 +
:*[[FAQ When does my language need its own perspective?]]
 +
:*[[FAQ How do I add documentation and help for my own language?]]
 +
:*[[FAQ How do I support source-level debugging for my own language?]]
 +
 
 +
 
 +
=== Java Development Tool API ===
 +
 
 +
From the outset, Eclipse has been used to develop Eclipse itself. The plug-ins that make up Eclipse are written in Java, and the concept of self-hosting has propelled the JDT to their current maturity level. When you are writing your plug-ins, you will also spend considerable time inside the JDT. A full coverage of JDT’s functionality is way beyond the scope of the list of FAQs in this chapter; however, we do focus on topics that are directly related to writing plug-ins and discuss aspects of JDT that warrant a discussion about how they are implemented rather than used.
 +
 
 +
It is important to realize that JDT itself has been written as a set of plug-ins and receives no special support from the platform. JDT represents a wealth of knowledge and is by far the most elaborate and advanced set of plug-ins in Eclipse. It is definitely worth spending some time to observe how JDT extends the platform and how its own extension points and API have been designed. It is likely that your plug-ins will deploy very similar patterns of extensions, extendibility, and reuse.
 +
 
 +
Finally, the JDT is a useful set of plug-ins in its own right, but it has also been carefully designed for extension by other plug-ins. By having a published API, it is easy to create new Java projects, generate Java source code, manage Java builds, inspect and analyze Java projects, and implement special refactorings. Refer to Help > Help Contents > JDT Plug-in Developer Guide for extensive documentation and tutorials describing the extension points and API published by JDT. For a comprehensive guide to Java development using Eclipse, see the Java Developers Guide to Eclipse (Addison-Wesley, 2003).
 +
 
 +
:*[[FAQ How do I extend the JDT?]]
 +
:*[[FAQ What is the Java model?]]
 +
:*[[FAQ How do I create Java elements?]]
 +
:*[[FAQ How do I create a Java project?]]
 +
:*[[FAQ How do I manipulate Java code?]]
 +
:*[[FAQ What is a working copy?]]
 +
:*[[FAQ What is a JDOM?]]
 +
:*[[FAQ What is an AST?]]
 +
:*[[FAQ How do I create and examine an AST?]]
 +
:*[[FAQ How do I distinguish between internal and external JARs on the build path?]]
 +
:*[[FAQ How do I launch a Java program?]]
 +
:*[[FAQ What is JUnit?]]
 +
:*[[FAQ How do I participate in a refactoring?]]
 +
:*[[FAQ What is LTK?]]
 +
 
 +
== Where to buy the original book ==
 +
 
 +
The initial contents for these FAQ pages has come from The Offical Eclipse 3.0 FAQs written by John Arthorne and Chris Laffra.
 +
 
 +
Permission to publish the FAQ book contents here has been graciously offered by Addison-Wesley, publishers of the official [http://www.awprofessional.com/series/series.asp?st=44100&rl=1| Eclipse Series] which wouldn't be possible without the great help from Greg Doench.
 +
 
 +
The book can be purchased from [http://www.amazon.com/exec/obidos/ASIN/0321268385 Amazon.com]
 +
 
 +
[[Category:FAQ]]

Revision as of 19:25, 7 April 2013

Note that this FAQ is updated less frequently than this FAQ. You may find your answer there before it makes its way here.

Part I -- The Eclipse Ecosystem

The Eclipse Community

Eclipse has taken the computing industry by storm. The download data for the Eclipse Software Development Kit (SDK) is astounding and a true ecosystem is forming around this new phenomenon. In this chapter we discuss what Eclipse is and who is involved in it and give you a glimpse of how large a community has put its weight behind this innovative technology.

An open source project would be nothing without a supporting community. The Eclipse ecosystem is a thriving one, with many research projects based on Eclipse, commercial products that ship on top of Eclipse, lively discussions in newsgroups and mailing lists, and a long list of articles and books that address the platform. The following pages will give you a roadmap of the community, so that you will feel more at home as you come to wander its winding streets.

Getting Started

Eclipse can be seen as a very advanced Java program. Running Eclipse may sound simple—simply run the included eclipse.exe or eclipse executable—yet in practice, you may want to tweak the inner workings of the platform. First, Eclipse does not come with a Java virtual machine (JVM), so you have to get one yourself. Note that any version later than Eclipse 3.0 needs a 1.4-compatible Java runtime environment (JRE), and the Java 5 JRE is recommended for Eclipse version 3.3.

To use Eclipse effectively, you will need to learn how to make Eclipse use a specific JRE. In addition, you may want to influence how much heap Eclipse may allocate, where it loads and saves its workspace from, and how you can add more plug-ins to your Eclipse installation.

This chapter should get you going. We also included some FAQs for plug-in developers who have already written plug-ins and want to get started with plug-in development for Eclipse 3.0.

Java Development in Eclipse

The topic of how to use Eclipse for typical Java development is beyond the scope of this FAQ list. We focus more on the issues Eclipse users may run into when developing new plug-ins for the platform. Also, as a plug-in developer, you need to be familiar with the ways in which Eclipse is used. To achieve seamless integration with the platform, your plug-in must respect common usage patterns and offer the same level of functionality that users of your plug-in have come to expect from the platform. This chapter focuses on user-level issues of interest to plug-in developers as users or as enablers for other users of the platform.

For a comprehensive guide to using Eclipse, refer to other books such as The Java Developer’s Guide to Eclipse (Addison-Wesley, 2003).

Plug-In Development Environment

This book is all about extending the Eclipse Platform. The main instrument for extending the platform is a plug-in. Plug-ins solidify certain crucial design criteria underlying Eclipse. Special tooling has been developed as part of Eclipse to support the development of plug-ins. This set of plug-ins is called the Plug-in Development Environment; or PDE. The PDE tools cover the entire lifecycle of plug-in development, from creating them using special wizards to editing them to building them to launching them to exporting and sharing them.

This chapter describes the mechanics of plug-in development, such as creating plug-ins, features, and update sites, and introduces the PDE tooling. We go into much more depth about what plug-ins are in later FAQs. If you want to jump ahead, we suggest that you first visit FAQ What is a plug-in?.

Part II -- The Rich Client Platform

All about Plug-ins

Part I discussed the Eclipse ecosystem: how to run it, how to use it, and how to extend it. In this chapter, we revisit the topic of plug-ins and lay the groundwork for all plug-in development topics to be discussed in later chapters. This chapter answers questions about the core concepts of the Eclipse kernel, including plug-ins, extension points, fragments, and more. All APIs mentioned in this chapter are found in the org.eclipse.core.runtime plug-in.


Runtime Facilities

Above, we already discussed most of the basic functionality of the org.eclipse.core.runtime plug-in. This chapter covers the remaining facilities of Eclipse Platform runtime: APIs for logging, tracing, storing preferences, and other such core functionality. These various services, although not strictly needed by all plug-ins, are common enough that they merit being located directly alongside the Eclipse kernel. In Eclipse 3.0, this plug-in was expanded to add infrastructure for running and managing background operations. This chapter answers some of the questions that may arise when you start to use this new concurrency infrastructure.


Standard Widget Toolkit (SWT)

One of the great success stories of the Eclipse Platform has been the overwhelming groundswell of support for its windowing toolkit, SWT. This toolkit offers a fast, thin, mostly native alternative to the most common Java UI toolkits, Swing and Abstract Windowing Toolkit (AWT). Religious debates abound over the relative merits of Swing versus SWT, and we take great pains to avoid these debates here. Suffice it to say that SWT generates massive interest and manages to garner as much, if not more, interest as the Eclipse Platform built on top of it.

The popularity of SWT has forced us to take a slightly different approach with this chapter. The SWT newsgroup was created in July 2003 and since then has generated an average of 136 messages every day. In this book, we could not even scratch the surface of the information available there. Although we could present the illusion of completeness by answering a couple dozen popular technical questions, we would not be doing the topic justice. Instead, we focus on answering a few of the higher-level questions and providing as many forward pointers as we can to further information on SWT available elsewhere. A benefit of SWT’s popularity is the wealth of Web sites, discussion forums, books, and other forms of documentation out there. Thus, although we won’t be able to answer all SWT questions, we hope at least to steer you to the resources that can. However, a handful of questions are asked so often that we can’t resist answering them here.

JFace

JFace is a Java application framework based on SWT. The goal of JFace is to provide a set of reusable components that make it easier to write a Java-based GUI application. Among the components JFace provides are such familiar GUI concepts as wizards, preference pages, actions, and dialogs. These components tend to be the bits and pieces that are integral to the basic widget set but are common enough that there is significant benefit to drawing them together into a reusable framework. Although its heritage is based on a long line of frameworks for writing IDEs, most of JFace is generally useful in a broad range of graphical desktop applications. JFace has a few connections to classes in the Eclipse runtime kernel, but it is fairly straightforward to extract JFace and SWT for use in stand-alone Java applications that are not based on the Eclipse runtime. JFace does not make use of such Eclipse-specific concepts as extensions and extension points.

Generic Workbench

This chapter covers FAQs relating to the generic workbench and its APIs. Workbench is the term used for the generic Eclipse UI. Originally the UI was called the desktop, but because Eclipse was a platform primarily for tools rather than for stationery, workbench was deemed more suitable. In Eclipse 3.0, tools are no longer the sole focus, so the term Rich Client Platform, is starting to creep in as the term for the generic, non-tool-specific UI. After all, people don’t want to play mine sweeper or send e-mails to Mom from such a prosaically named application as a workbench. A rich client, on the other hand, is always welcome at the dinner table.

Many of the important workbench concepts, such as editors, views, and actions, generate enough questions that they deserve their own chapters. This chapter focuses on general questions about integrating your plug-in with the various extension hooks the workbench provides.

Perspectives and Views

This chapter answers questions about two central concepts in the Eclipse Platform UI. Perspectives define the set of actions and parts that appear in a workbench window and specify the initial size and position of views within that window. Views are the draggable parts that make up the bulk of a workbench window’s contents. This chapter does not deal with any specific perspectives or views, but with questions that arise when you implement your own perspectives and views.


Generic Editors

In Eclipse, editors are parts that have an associated input inside a workbench window and additional lifecycle methods, such as save and revert. This chapter answers questions about interacting with editors and about writing your own editors, whether they are text based or graphical. See Chapter 15 for a complete treatment of questions about writing your own text-based editors.


Actions, Commands, and Activities

This chapter answers questions about creating menu bars, context menus, and tool bars and the actions that fill them. A variety of both declarative and programmatic methods are available for contributing actions to the Eclipse UI and for managing and filtering those actions once they have been defined. This chapter also discusses the various ways to execute the long-running tasks that can be triggered by menu and toolbar actions.

Actions are currently considered to be inferior to commands. The following information about actions is still left here to help people which are still using actions. If you can you should use commands.


Building Your Own Application

Prior to the introduction of RCP, most of the Eclipse community was focused on developing plug-ins for a particular Eclipse application called the workbench. Eclipse, however, has always supported the ability to create your own stand alone applications based on the Eclipse plug-in architecture. Eclipse applications can range from simple headless programs with no user interface to full-blown IDEs. In Eclipse 3.0, the platform began a shift toward giving greater power and flexibility to applications built on the Eclipse infrastructure. This chapter guides you through the process of building your own Eclipse application and explores some of the new Eclipse 3.0 APIs available only to applications.

Productizing an Eclipse Offering

In this chapter, we look at turning an Eclipse configuration into a product. When an Eclipse product is created, the anonymous collection of plug-ins takes on application-specific branding, complete with custom images, splash screen, and launcher. In creating your own product, you typically also need to write an installer and uninstaller and consider how your users will obtain and upgrade your product.


Part III -- The Eclipse IDE Platform

Text Editors

The most important purpose of an IDE is to browse and edit code. Therefore, perhaps even more than any other IDE platform, the Eclipse editor framework has grown into a highly evolved, flexible, easy-to-use, and easy-to-extend environment for editing program source files. In this chapter, we look at what support exists for writing editors and how easy it is to plug them into the Eclipse IDE platform.

Help, Search, and Compare

Admittedly, this chapter covers a number of unrelated components in the Eclipse Platform. They have in common the fact that each is designed as an independent plug-in that can be added to any Eclipse-based application. Although they are at home mostly in IDE applications, these plug-ins can also be inserted into RCP applications when help, search, or compare facilities are needed.

Workspace and Resources API

A program is never written in isolation but instead depends on other code, icons, data, and configuration files. An extendable IDE should provide access to wherever these artifacts are stored. In Eclipse, the artifacts are referred to as resources and are stored in a workspace. The FAQs in this chapter show how resources are managed in a workspace and what API is available to control and track their lifecycle.


Workbench IDE

The remaining plug-ins in the Eclipse Platform are truly oriented toward writing development tools. This chapter covers elements of the Eclipse IDE workbench, found in the org.eclipse.ui.ide plug-in. This plug-in includes most of the standard platform views, such as Navigator, Tasks, Problems, Properties, and Bookmark. We also take a quick look at advanced topics, such as writing repository clients and debuggers.


Implementing Support for Your Own Language

Through its JDT project, Eclipse has strong support for Java development, such as editing, refactoring, building, launching, and debugging. Likewise, the C development tools (CDT) project aims for similar support for writing C/C++ code. This chapter discusses some of the issues to address when you have your own language and want to host it in Eclipse for writing programs and plug-ins. We look at the various ways of integrating with Eclipse: from no integration to a fully integrated language development environment. To structure our discussion, we take a closer look at eScript, an experimental script language developed especially for this book. As is the case for all examples described in this book, you can find eScript on this book’s CD-ROM or Web site (http://eclipsefaq.org).

Many questions have been addressed in other FAQs in this book and may be somewhat repetitive. However, if you are planning to implement support for your own programming language, this chapter might serve well as a comprehensive overview of how to approach this big task.

Any classification of integration of a new programming language with Eclipse is somewhat arbitrary. We have identified the following degrees of integration of a new programming language, such as eScript, with Eclipse:

  • Phase 1—Compiling code and building projects. To obtain full integration with Eclipse in the area of compilation of programs and build processes for your own language, follow the various steps outlined in the FAQs below.
  • Phase 2—Implementing a DOM. The DOM is an in-memory structural representation of the source code of a program written in your language. Using the structural information contained in the DOM, all kinds of analysis and refactoring tools can be built.
  • Phase 3—editing programs. After writing a compiler, a builder, and a DOM, you are ready to consider all the individual steps to build the ultimate Eclipse editor for your language.
  • Phase 4—Adding the finishing touches. To give your language IDE a professional look, follow the steps outlined in the FAQs below.

If you carefully observe these four phases, you will find that the visual aspects of your language IDE happen late in the process. You will have to do some legwork before you are able to get to the pretty parts. We recommend patience and restraint. Time spent in phases 1 and 2 will be well spent, and once you get to phase 3 and 4, you will be grateful that you followed all the steps we outlined.


Java Development Tool API

From the outset, Eclipse has been used to develop Eclipse itself. The plug-ins that make up Eclipse are written in Java, and the concept of self-hosting has propelled the JDT to their current maturity level. When you are writing your plug-ins, you will also spend considerable time inside the JDT. A full coverage of JDT’s functionality is way beyond the scope of the list of FAQs in this chapter; however, we do focus on topics that are directly related to writing plug-ins and discuss aspects of JDT that warrant a discussion about how they are implemented rather than used.

It is important to realize that JDT itself has been written as a set of plug-ins and receives no special support from the platform. JDT represents a wealth of knowledge and is by far the most elaborate and advanced set of plug-ins in Eclipse. It is definitely worth spending some time to observe how JDT extends the platform and how its own extension points and API have been designed. It is likely that your plug-ins will deploy very similar patterns of extensions, extendibility, and reuse.

Finally, the JDT is a useful set of plug-ins in its own right, but it has also been carefully designed for extension by other plug-ins. By having a published API, it is easy to create new Java projects, generate Java source code, manage Java builds, inspect and analyze Java projects, and implement special refactorings. Refer to Help > Help Contents > JDT Plug-in Developer Guide for extensive documentation and tutorials describing the extension points and API published by JDT. For a comprehensive guide to Java development using Eclipse, see the Java Developers Guide to Eclipse (Addison-Wesley, 2003).

Where to buy the original book

The initial contents for these FAQ pages has come from The Offical Eclipse 3.0 FAQs written by John Arthorne and Chris Laffra.

Permission to publish the FAQ book contents here has been graciously offered by Addison-Wesley, publishers of the official Eclipse Series which wouldn't be possible without the great help from Greg Doench.

The book can be purchased from Amazon.com