【问题标题】:Eclipse RCP Java Perspective extensionEclipse RCP Java 透视扩展
【发布时间】:2023-03-15 09:40:02
【问题描述】:

我想用一个新视图扩展默认的 Eclipse IDE 'Java' 透视图,默认情况下该视图将在底部面板中打开(例如,我们有“问题”、“搜索”、“控制台”等)。

如何确保我的新视图将显示在底部面板的第一个位置(在“问题”视图之前)?

【问题讨论】:

    标签: eclipse eclipse-plugin eclipse-rcp


    【解决方案1】:

    使用Perspective Extension

    在您的扩展节点中添加一个视图节点并设置相对和关系属性来满足您的需求。

    <extension point="org.eclipse.ui.perspectiveExtensions"> 
        <perspectiveExtension 
            targetID="existing Perspective ID to extend"> 
            <view id="Your View ID" 
                relative="offset View ID" 
                relationship="relation"/> 
    
            <!-- example -->
            <view id="org.eclipse.jdt.ui.TypeHierarchy" 
                relative="org.eclipse.ui.views.ResourceNavigator" 
                relationship="left" 
                ratio="0.50"/> 
        </perspectiveExtension> 
    </extension> 
    

    【讨论】:

    • 这是我尝试过的,但后来我将这些视图放在单独的“文件夹”中,所以我分别查看它们。我需要设置任何标志、值等吗?!
    【解决方案2】:

    Perspective Extensions 是正确答案,但您应该使用:

    • relationship="stack"
    • relative="org.eclipse.ui.console.ConsoleView"

    示例:

    <perspectiveExtension
                targetID="org.eclipse.jdt.ui.JavaPerspective">
             <view
                   id="your.view.id"
                   minimized="false"
                   relationship="stack"
                   relative="org.eclipse.ui.console.ConsoleView">
            </view>
    </perspectiveExtension>
    

    使用插件启动 Eclipse 并打开视图。它应该出现在控制台视图旁边

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-15
      • 2011-01-13
      • 1970-01-01
      • 1970-01-01
      • 2011-07-17
      相关资源
      最近更新 更多