gpt4 book ai didi

eclipse-rcp - "link with editor"用于表单编辑器

转载 作者:行者123 更新时间:2023-12-04 04:34:25 25 4
gpt4 key购买 nike

我正在寻找“与编辑器链接”的解决方案,但用于 FormEditor 而不是 ViewPart,如 http://murygin.wordpress.com/2012/06/13/link-eclipse-view-to-editor/ 中所述

我尝试做类似的事情。但是“与编辑器的链接”不会触发任何操作。

感谢您的帮助!

最佳答案

我发现我可以使用“导航器链接助手”:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_navigator_linkHelper.html

Hier 是我在 plugin.xml 中的代码:

<extension point="org.eclipse.ui.navigator.viewer">
...
<viewerContentBinding ...>
<includes>
<contentExtension pattern="my.ui.navigator.linkHelper.myExplorer"/>
</includes>
</viewerContentBinding>
...
</extension>
<extension point="org.eclipse.ui.navigator.linkHelper">
<linkHelper
class="my.ui.navigator.MyExplorerLinkHelper"
id="my.ui.navigator.linkHelper.myExplorer">
<selectionEnablement>
<or>
<adapt type="org.eclipse.core.resources.IProject"/>
<instanceof value="org.eclipse.core.resources.IProject"/>
</or>
</selectionEnablement>
<editorInputEnablement>
<or>
<adapt type="org.eclipse.core.resources.IProject"/>
<instanceof value="org.eclipse.core.resources.IProject"/>
</or>
</editorInputEnablement>
</linkHelper>
</extension>

我实现了这个类:
public class MyExplorerLinkHelper implements ILinkHelper {
@Override
public IStructuredSelection findSelection(IEditorInput anInput) {
...
}

@Override
public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
...
}
}

关于eclipse-rcp - "link with editor"用于表单编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20002461/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com