我正在创建一个自定义的 eclipse 插件,基础是 Lua 代码。我想构建独立的 IDE,所以我有 Application 和 LuaNature 类。
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$
}
当我为 Lua 项目运行 newProjectWizard 时,出现错误
自然不存在:com.my.ide.nature。
我错过了一些设置吗?