• 介绍

本文介绍如何给Eclipse自带的tomcat插件添加一些功能。

  • 右键菜单扩展

添加扩展点 org.eclipse.ui.popupMenus

[codesyntax lang="xml"]


<extension point="org.eclipse.ui.popupMenus">
<objectContribution adaptable="true"
id="org.eclipse.jst.server.tomcat.ui.serveractions" objectClass="org.eclipse.wst.server.core.IServer">
<visibility>
<objectState name="serverType" value="org.eclipse.jst.server.tomcat.*" />
</visibility>
<action class="surenpi.com.dev.debugger.tomcat.OpenDirAction"
enablesFor="1" id="surenpi.com.dev.debugger.tomcat.openserverdiraction"
label="Open Deploy Directory">
</action>
</objectContribution>
<objectContribution adaptable="true"
id="org.eclipse.jst.server.tomcat.ui.serveractions" objectClass="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
<visibility>
<and>
<objectState name="serverType" value="org.eclipse.jst.server.tomcat.*" />
<objectState name="moduleType" value="jst.web" />
</and>
</visibility>
<action class="surenpi.com.dev.debugger.tomcat.OpenDirAction"
enablesFor="1" id="surenpi.com.dev.debugger.tomcat.openmodulediraction"
label="Open Deploy Directory">
</action>
</objectContribution>
</extension>


[/codesyntax]

我们实现的功能是通过右键菜单