arc*_*ain 1 eclipse-plugin popupmenu wizard
我在文件 - >新建 - >其他人中创建了一个类别“企业”。其中有一些向导可以说“实例”,“组件”等。现在我想要什么,当我右键单击项目资源管理器并进入时新的那些巫师应该看到他们自己。基本上是尝试制作这些向导的弹出菜单。
所以我创建了弹出菜单:
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="true"
locationURI="popup:common.new.menu?before=additions">
<command
commandId="CommandComponent"
label="Component"
style="push">
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
id="CommandComponent"
name="Component">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="CommandComponent">
</handler>
</extension>
Run Code Online (Sandbox Code Playgroud)
现在我怎样才能将与我提供给向导组件的处理程序相同的类提供给该处理程序?
或者我是否必须编写一个具有相同功能但按照处理程序格式的新类(如果可能)?
您可以使用org.eclipse.ui.perspectiveExtensions扩展点来定义使用元素显示在“新建”菜单顶层的“新建向导” newWizardShortcut。
就像是:
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<newWizardShortcut
id="org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard">
</newWizardShortcut>
</perspectiveExtension>
Run Code Online (Sandbox Code Playgroud)
(这是新 JUnit 测试用例的快捷方式)。
您可能需要重置透视图或使用自定义透视图使项目可见,因为用户可以控制显示哪些快捷方式。
帮助中的更多信息