Eclipse 和 HSQLDB: 将关系数据库服务器嵌入到 Eclipse 中,第 2 部分
2009-12-16 00:00:00 来源:WEB开发网当 Java 项目没有插件自己定义的性质时“Add HSQLDB Engine nature”是可见的。
最后,当 Java 项目具有我们的新性质时,“Remove HSQLDB Engine nature”可见。
清单 4. plugin.xml 清单文件中定义 HSQLDB 菜单操作的片断 <extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.core.resources.IFile"
nameFilter="*.sql"
id="hsqldb.ui.SQLScriptFiles">
<visibility>
<objectState
name="projectNature"
value="hsqldb.ui.hsqldbEngine">
</objectState>
</visibility>
<action
label="Run HSQLDB Script"
class="hsqldb.ui.popup.actions.HsqldbRunScript"
menubarPath="additions"
enablesFor="1"
id="hsqldb.ui.HsqldbRunScript">
<enablement>
<objectState
name="projectSessionProperty"
value="hsqldb.ui.running">
</objectState>
</enablement>
</action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.jdt.core.IJavaProject"
id="hsqldb.ui.HsqldbEngineMenu">
<menu
label="HSQLDB"
path="additions"
id="hsqldb.ui.HsqldbProject">
<separator
name="hsqldb.ui.group1">
</separator>
<separator
name="hsqldb.ui.group2">
</separator>
</menu>
</objectContribution>
<objectContribution
objectClass="org.eclipse.jdt.core.IJavaProject"
id="hsqldb.ui.HsqldbEngineActions">
<visibility>
<objectState
name="nature"
value="hsqldb.ui.hsqldbEngine">
</objectState>
</visibility>
<action
label="Run Database Manager (Standalone)"
icon="icons/dbmansa.gif"
class="hsqldb.ui.popup.actions.RunDatabaseManagerStandalone"
menubarPath="hsqldb.ui.HsqldbProject/group1"
enablesFor="1"
id="hsqldb.ui.RunDatabaseManagerStandalone">
<enablement>
<not>
<objectState
name="sessionProperty"
value="hsqldb.ui.running">
</objectState>
</not>
</enablement>
</action>
<action
label="Run Database Manager (Client)"
icon="icons/dbman.gif"
class="hsqldb.ui.popup.actions.RunDatabaseManager"
menubarPath="hsqldb.ui.HsqldbProject/group1"
enablesFor="1"
id="hsqldb.ui.RunDatabaseManager">
<enablement>
<objectState
name="sessionProperty"
value="hsqldb.ui.running">
</objectState>
</enablement>
</action>
<action
label="Stop HSQLDB Server"
icon="icons/stop.gif"
class="hsqldb.ui.popup.actions.StopHsqldbServer"
menubarPath="hsqldb.ui.HsqldbProject/group1"
enablesFor="1"
id="hsqldb.ui.StopHsqldbServer">
<enablement>
<objectState
name="sessionProperty"
value="hsqldb.ui.running">
</objectState>
</enablement>
</action>
<action
label="Start HSQLDB Server"
icon="icons/start.gif"
class="hsqldb.ui.popup.actions.StartHsqldbServer"
menubarPath="hsqldb.ui.HsqldbProject/group1"
enablesFor="1"
id="hsqldb.ui.StartHsqldbServer">
<enablement>
<not>
<objectState
name="sessionProperty"
value="hsqldb.ui.running">
</objectState>
</not>
</enablement>
</action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.jdt.core.IJavaProject"
id="hsqldb.ui.JavaProjects">
<visibility>
<not>
<objectState
name="nature"
value="hsqldb.ui.hsqldbEngine">
</objectState>
</not>
</visibility>
<action
label="Add Database Engine nature"
class="hsqldb.ui.popup.actions.AddDBEngineNature"
menubarPath="hsqldb.ui.HsqldbProject/group2"
enablesFor="1"
id="hsqldb.ui.AddDBEngineNature">
</action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.jdt.core.IJavaProject"
id="hsqldb.ui.HsqldbEngineProjects">
<visibility>
<objectState
name="nature"
value="hsqldb.ui.hsqldbEngine">
</objectState>
</visibility>
<action
label="Remove Database Engine nature"
class="hsqldb.ui.popup.actions.RemoveDBEngineNature"
menubarPath="hsqldb.ui.HsqldbProject/group2"
enablesFor="1"
id="hsqldb.ui.AddDBEngineNature">
</action>
</objectContribution>
</extension>
- ››Eclipse 3.7反编译插件的安装
- ››eclipse CDT NDK环境搭建步骤
- ››Eclipse 如何自定义java class注释
- ››eclipse.ini内存设置
- ››Eclipse+PyDev离线配置Python开发环境
- ››Eclipse下jQuery文件报错解决方案
- ››Eclipse快捷键与使用技巧
- ››Eclipse 常用快捷键 常用技巧My Eclipse常用快捷键...
- ››Eclipse快捷键二
- ››Eclipse快捷键一
- ››Eclipse+SVN+Google Code配置过程
- ››eclipse中开发android程序时,打开layout配置文件自...
更多精彩
赞助商链接