我正在创建一个自定义的eclipse插件,基础是Lua代码。我想构建独立的IDE,所以我有Application和LuaNature类。我的Eclipse插件中不存在性质
plugin.xml
看起来是这样的:
<extension
id="application"
point="org.eclipse.core.runtime.applications">
<application>
<run
class="com.my.ide.Application">
</run>
</application>
</extension>
.
.
.
<extension
id="id1"
point="org.eclipse.core.resources.natures">
<runtime>
<run
class="com.my.ide.core.LuaNature">
</run>
</runtime>
</extension>
Application.class
看起来是这样的:
public class Application implements IApplication {
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
*/
public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART)
return IApplication.EXIT_RESTART;
else
return IApplication.EXIT_OK;
} finally {
display.dispose();
}
}
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#stop()
*/
public void stop() {
if (!PlatformUI.isWorkbenchRunning())
return;
final IWorkbench workbench = PlatformUI.getWorkbench();
final Display display = workbench.getDisplay();
display.syncExec(new Runnable() {
public void run() {
if (!display.isDisposed())
workbench.close();
}
});
}
}
和LuaNature.class
这样的:
public class LuaNature extends ScriptNature {
/**
* Nature of IDE composed from plug-in ID
*
* @return String
*/
public static final String ID = Activator.PLUGIN_ID + ".nature"; //$NON-NLS-1$
}
当我运行newProjectWizard为lua项目,我得到错误
自然不存在:com.my.ide.nature。
我是否缺少一些设置?