这是类似于模板之类的功能。
- 扩展点 org.eclipse.wst.common.project.facet.core.facets
需要添加依赖:org.eclipse.wst.common.project.facet.core [codesyntax lang="xml"]
<extension point="org.eclipse.wst.common.project.facet.core.facets">
<project-facet id="org.suren.facet.id">
<category>suren</category>
<label>SuRen Facet</label>
<description>suren facet desc</description>
</project-facet>
<project-facet-version facet="org.suren.facet.id"
version="1.0">
<action type="INSTALL">
<delegate class="surenpi.com.dev.debugger.facet.SuRenFacetDelegate" />
</action>
<action type="UNINSTALL">
<delegate class="surenpi.com.dev.debugger.facet.SuRenFacetDelegate" />
</action>
</project-facet-version>
</extension>
[/codesyntax] 实现类: [codesyntax lang="java"]
/**
* http://surenpi.com
*/
package surenpi.com.dev.debugger.facet;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
/**
* @author surenpi.com
* @since jdk1.6
* 2015年8月25日
*/
public class SuRenFacetDelegate implements IDelegate {
@Override
public void execute(IProject project, IProjectFacetVersion version,
Object config, IProgressMonitor monitor) throws CoreException {
System.out.println("hello");
}
}
[/codesyntax]
- 扩展点 org.eclipse.wst.common.project.facet.ui.images
需要添加依赖:org.eclipse.wst.common.project.facet.ui [codesyntax lang="xml"]
<extension point="org.eclipse.wst.common.project.facet.ui.images">
<image facet="org.suren.facet.id" path="icons/error.png" />
</extension>
[/codesyntax]
http://www.cnblogs.com/drawwindows/archive/2011/07/14/2106725.html