
本站地址:http://www.bajiao123.com

Eclipse Plugins Exposed, Part 1: A First Glimpse
There are many places where you can specify what files are required for your plugin to compile and run. This makes things confusing for us Eclipse users. Let's try to clarify some of these issues.
Supporting files come in three categories:
The compilation environment can be set up in the Build page of the plugin editor. Again, this maps to the build.properties file. This page may be confusing at first, as it has four separate sections:
If your plugin uses a special library, make sure you add it to your project. Then add it to the Source Build and the Extra Classpath Entries.
Other important pages in the plugin editor are:
These are more advanced and will be covered in another article.
Once the plugin is coded, and tested in the workbench, it is ready to be deployed to the "real" Eclipse environment. To do this, go to the Overview page and click on the Export Wizard link. The Export Options box allows you to choose among three types of deployments:
Once you click on Finish, the selected output is produced. If you elected to export as a directory structure, you'll have to restart Eclipse for the plugin to take effect.
The best source of information about writing Eclipse plugins is the set of many plugin examples that are provided with it. If I had to choose a single source of information to help me write Eclipse plugins, this would be it.
To download these plugins, simply go to the Eclipse downloads page and select the latest version of Eclipse. Then go to the middle of the page, where it says "Example Plug-ins," and download the .zip file (less than 2MB). Unzip this into the folder where Eclipse is located, such as c:\dev, for example. This will create many folders under the folders eclipse/features and eclipse/plugins. The source code for these examples is located in numerous .zip files in the folder C:\dev\eclipse\plugins, listed below.
Editor's Note: we have inserted line breaks in these paths to accommodate the page layout. Each should be all on one line, without spaces, in your work.
Example Code Location SWT examples In the folderorg.eclipse.sdk.examples.source_3.0.1\src...
...\org.eclipse.swt.examples_3.0.0 swtexamplessrc.zip
...\org.eclipse.swt.examples.browser_3.0.0 browserexamplesrc.zip
...\org.eclipse.swt.examples.controls_3.0.0 controlssrc.zip
...\org.eclipse.swt.examples.launcher_3.0.0 launchersrc.zip
...\org.eclipse.swt.examples.layouts_3.0.0 layoutssrc.zip
...\org.eclipse.swt.examples.paint_3.0.0 paintsrc.zip
org.eclipse.sdk.examples.source.win32.win32.x86_3.0.1 src\org.eclipse.swt.examples.ole.win32_3.0.0 olewin32src.zip
Workbench Examples
...\org.eclipse.ui.examples.javaeditor_3.0.0 javaeditorexamplesrc.zip
...\org.eclipse.ui.examples.javaeditor_3.0.0 templateeditorexamplesrc.zip
...\org.eclipse.ui.examples.multipageeditor_2.1.0< multipageeditorsrc.zip
...\org.eclipse.ui.examples.propertysheet_2.1.0 propertysheetsrc.zip
...\org.eclipse.ui.examples.readmetool_2.1.0 readmetoolsrc.zip
Help example
Special folder
org.eclipse.help.examples.ex1_3.0.0(There's no Java here; the HTML is in doc.zip)
Team examples
...\org.eclipse.team.examples.filesystem_3.0.0 teamfilesystemsrc.zip
File compare examples
...\org.eclipse.compare.examples_3.0.0 compareexamplessrc.zip
...\org.eclipse.compare.examples.xml_3.0.0 xmlcompareexamplessrc.zip
There are also useful examples of GEF and Draw2D plugins. To get those, go to the GEF page and click on the latest version. Then locate "GEF Examples" in the middle of the Release Build page. Download the .zip file. At the time this was written, it was the file GEF-examples-3.0.1.zip (.5MB). Unzip this into the folder where Eclipse is located (for example, C:\dev). You will see two examples:
Example Code Locationorg.eclipse.gef.examples.source_3.0.1\src org.eclipse.gef.examples.logic_3.0.0\logicsrc.zip
org.eclipse.gef.examples.source_3.0.1\src org.eclipse.gef.examples.flow_3.0.1\flowsrc.zip
The first place to look is the examples the previous section. Secondly there's the help system, which is of good quality. This is in menu Help -> Help Content. The relevant categories are:
You now have enough information to create amazing, graphical p
本站地址:http://www.bajiao123.com

