`
Jameslyy
  • 浏览: 391343 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Project Builders and Natures In Eclipse

阅读更多

Project natures allow a plug-in to tag a project as a specific kind of project. For example, the Java development tools (JDT) use a "Java nature" to add Java-specific behavior to projects.  Project natures are defined by plug-ins, and are typically added or removed per-project when the user performs some action defined by the plug-in.

 

A project can have more than one nature.  However, when you define a project nature, you can define special constraints for the nature:

one-of-nature - specifies that the nature is one of a named set.  Natures in a set are mutually exclusive; that is, only one nature belonging to the set can exist for a project.

requires-nature - specifies that the nature depends on another nature and can only be added to a project that already has the required nature.

To implement your own nature, you need to define an extension and supply a class which implements IProjectNature.

 

The workspace supports the notion of an incremental project builder (or "builder" for short"). The job of a builder is to process a set of resource changes (supplied as a resource delta). For example, a Java builder would recompile changed Java files and produce new class files.

Builders are confgured on a per-project basis and run automatically when resources within their project are changed. As such, builders should be fast and scale with respect to the amount of change rather than the number of resources in the project. This typically implies that builders are able to incrementally update their "built state".

 

Eclipse Article:

Project Builders and Natures

 

Plugin.xml configuration:

   <extension 
   	id="mynature" 
   	name="My Nature" 
   	point="org.eclipse.core.resources.natures"> 
      <runtime> 
         <run class="com.xyz.natures.MyNature"/> 
      </runtime> 
      <builder id="com.xyz.myplugin.mybuilder"/> 
   </extension> 
   <extension 
   	id="mybuilder" 
   	name="My Builder" 
   	point="org.eclipse.core.resources.builders"> 
      <builder hasNature="true"> 
         <run class="com.xyz.builders.MyBuilder"/>
      </builder> 
   </extension> 
  

Append Icon to new project type on project navigator:

<extension
	point="org.eclipse.ui.ide.projectNatureImages">
	<image icon="icons/javafx_icon.png"
		id="com.sun.javafx.eclipse.core.natureImage"
		natureId="com.sun.javafx.eclipse.core.javafxNature">
	</image>
</extension>

This extension point is used to associate an image with a project nature. The supplied image is used to form a composite image consisting of the standard project image combined with the image of its nature. The supplied image is drawn over the top right corner of the base image. 

 

Howto create a new project nature in Eclipse

 

Decorators

Your plug-in can use decorators to annotate the images for resources and other objects that appear in the workbench views.  Decorators are useful when your plug-in adds functionality for existing resource types.  Many of the standard workbench views participate in showing decorations.  

Package explorer view with PDE decorators

 

Decorators Guide

http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_decorators.html

 

Dextension point

http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_decorators.html

 

 

分享到:
评论

相关推荐

    安卓appcompat-v7库,eclipse完整工程

    2. `.project`: 这是Eclipse项目的元数据文件,包含了项目的构建设置、Natures(表示项目类型)和Builders(处理构建过程的插件)信息。 3. `project.properties`: 这个文件定义了项目的属性,如目标SDK版本、最小...

    java eclipse 插件 按照目录结构生成的目录树

    4. **.project 文件**:这是另一个XML文件,它包含了项目的构建配置信息,如构建路径、Natures(项目的类型,如Java项目)、Builders(构建过程)等。Eclipse 通过此文件理解项目的结构和属性。 5. **build....

    eclipse swt项目源代码

    4. `.project`:这是Eclipse项目的配置文件,定义了项目的类型、构建设置、Natures(特性)以及Builders(构建器)。通过这个文件,开发者可以知道该项目在Eclipse环境中是如何配置的,包括使用的构建工具、插件和...

    project-zmcc

    `.project` 文件同样是Eclipse IDE的产物,它定义了项目的元数据,包括项目类型、构建配置、Natures(项目特性,比如Java项目、Web项目等)和Builders(构建器,如Java编译器)。这个文件帮助Eclipse识别项目并提供...

    eoecn.zip

    4. **.project** 和 `(2).project`:这是Eclipse项目配置文件,包含了项目类型、构建设置、Natures(项目特性)和Builders(构建器)等信息。每个Eclipse工程都有一个这样的文件,用于保持项目的元数据,使得其他...

    swt.jar包与源文件

    `.project`文件同样属于Eclipse项目配置的一部分,它定义了项目的属性,如构建设置、Natures(表示项目类型)和Builders(处理构建过程的规则)。 `about_files`目录可能包含了关于SWT的图标、图片和其他资源,这些...

    androidtest.7z

    3. `.project` 文件是Eclipse项目的元数据,包含了项目的构建信息、Natures(比如Android Nature)和Builders(比如ADT Builder)等设置。 4. `project.properties` 文件记录了项目的属性,如目标Android版本和其他...

    video.zip

    2. `.project`:同样来自Eclipse,它定义了项目的属性,如构建配置、Natures(项目类型,例如Java项目、Android项目等)和Builders(构建工具),用于Eclipse识别和管理项目。 3. `project.properties`:在Android...

    XUtils3源码依赖包

    - `.project`:定义了项目的构建配置,包括构建路径、Natures(项目类型)和Builders(构建器)等信息。 - `project.properties`:包含了项目的基本属性,如目标平台版本等,Eclipse会根据这些属性来构建和运行...

    dbcontrast

    2. **.project**:这是Eclipse项目的配置文件,包含了项目的构建设置、Natures(项目特性,如Java项目、Plug-in项目)和Builders(构建规则)等信息。dbcontrast作为一个Eclipse插件,这个文件确保了项目在Eclipse...

    毕业设计之网上订餐系统.zip

    3. `.project`:这是Eclipse项目的配置文件,定义了项目的构建路径、Natures(项目特性)和Builders(构建器),帮助Eclipse识别和管理项目。 4. `readme.txt`:这是一个文本文件,通常包含项目简介、安装指南、...

    gwt2.1 maven example

    2. `.project`:这是另一个Eclipse项目配置文件,定义了项目的构建属性、Natures(如Java或GWT Nature)、Builders等。它帮助Eclipse识别项目类型,并设定相应的构建规则。 3. `pom.xml`:这是Maven项目的配置文件...

    Android手机的VoIP客户端 Sipdroid.zip

    2. `.project` 和 `(2).project`:这是Eclipse项目的配置文件,包含了项目的构建设置、Natures(项目特性)和Builders(构建器)。这些信息帮助Eclipse理解项目结构,并提供相应的开发工具支持。 3. `LICENSE (2)....

    swt-4.21M1-win32-win32-x86_64.zip

    4. `.project`:Eclipse项目文件,定义了项目的构建设置、Natures(项目特性)和Builders(构建器)等信息,帮助Eclipse理解如何管理该项目。 5. `src.zip`:可能包含了SWT的源代码,开发者可以查看源码,了解内部...

    nchuYXSystem.zip

    - `.project`:这是Eclipse项目的配置文件,描述了项目的构建属性、Natures(项目类型)和Builders(构建规则)。 2. **数据库相关**: - `yingxin.sql`:这是一个SQL脚本文件,很可能包含了迎新系统的数据库结构...

    FileUpload.zip

    【.project】 文件同样属于Eclipse项目的一部分,它定义了项目的类型、构建设置、Natures(项目特性,如Java项目、Android项目等)以及Builders(构建规则)。开发者可以通过编辑这个文件来定制项目的构建过程。 ...

    Android最新平台上可运行的Android demo

    `.project`文件是Eclipse项目的配置文件,包含了项目的构建信息、Natures(表示项目类型的标识)和Builders(负责构建项目的工具)。这个文件告诉Eclipse如何处理和构建项目。 `project.properties`文件存储了项目...

    计算机课程设计,连连看小程序

    2. `.project`:这是Eclipse项目的配置文件,存储了项目的构建配置、Natures(项目特性)和Builders(构建工具)信息,帮助Eclipse理解项目结构和构建规则。 3. `sounds`:这个目录可能包含了游戏运行过程中所需的...

    swt-3.6.1-x86_64

    `.project`文件是另一个Eclipse项目的配置文件,它描述了项目的属性,如构建设置、Natures(特性,如Java或SWT项目特性)和Builders(构建规则)。对于SWT项目,`.project`文件确保Eclipse知道这是一个基于SWT的Java...

    swt-4.4.2-win32-win32-x86_64.zip

    - `.project`:这是Eclipse项目的配置文件,定义了项目的构建设置、Natures和Builders等信息。 - `src.zip`:源代码的ZIP文件,可能包含了SWT库的源码,供开发者查阅和学习。 - `about_files`:通常包含关于...

Global site tag (gtag.js) - Google Analytics