问题描述
- eclipse插件开发 popupMenu 怎么才能右键点击JAVA文件时候才展示插件
- eclipse插件开发 popupMenu 只有右键点击JAVA文件时候才展示插件 ,右键点工程部显示
我在网上找了一下,都不行plugin.xml 文件如下
<?xml version=""1.0"" encoding=""UTF-8""?>
<?eclipse version=""3.3""?>point=""org.eclipse.ui.popupMenus"">
objectClass=""org.eclipse.core.runtime.IAdaptable""
id=""org.slive.quickcmd.contribution"">
definitionId=""org.slive.quickcmd.command.QuickCmdAction""
label=""Run As Uiautomator""
class=""org.slive.quickcmd.actions.QuickCmdAction""
menubarPath=""additions""
enablesFor=""1""
icon=""icons/QuickCmd.jpg""
id=""org.slive.quickcmd.QuickCmdAction"">definitionId=""org.slive.quickcmd.command.QuickCmdAction""
label=""Setting Uiautomator""
class=""org.slive.quickcmd.actions.SettingAction""
menubarPath=""additions""
enablesFor=""1""
icon=""icons/QuickCmd.jpg""
id=""org.slive.quickcmd.QuickCmdAction"">point=""org.eclipse.ui.commands"">
description=""Open cmd window from project or file quickly""
id=""org.slive.quickcmd.commands.category""
name=""Quick""/>
<!-- Commands -->
categoryId=""org.slive.quickcmd.commands.category""
id=""org.slive.quickcmd.command.QuickCmdAction""
name=""Quick Cmd""/>point=""org.eclipse.ui.bindings"">
<!-- Keyassist -->
commandId=""org.slive.quickcmd.command.QuickCmdAction""
contextId=""org.eclipse.ui.contexts.window""
schemeId=""org.eclipse.ui.defaultAcceleratorConfiguration""
sequence=""Alt+C""/>非常希望能提供一个DEMO.感谢
解决方案
解决方案二:
objectclass改为IFile表示只对文件类型可见。
nameFilter属性设置为*.java,表示只对java文件可见