如何从Windows中删除视图->显示视图列表? [英] How to remove views from Windows-->Show View list?

查看:92
本文介绍了如何从Windows中删除视图->显示视图列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有永久性的观点。
此视图无法关闭,也无法从Windows打开->显示视图

I have view which I am setting permanently on my perspective. This view can not be closed and can not be opened from Windows --> show views

我将其从Windows删除->视图列表。

I struct to remove View from Windows --> view list.

我将如何实现这一目标?

How would I achieve this?

我尝试了您的解决方案,它正在执行此操作,但是它也在删除从角度来看。以下是我遵循的步骤。

I tried your solution it is doing the things but it is also removing the view from perspective. Below are the steps I followed..

我已在plugin.XML中添加了以下视图

I have added the following view in plugin.XML

<view
     allowMultiple="false"
     category="org.view.ui.IDECategory"
     class="org.view.ui.BannerInformationView"    
     id="org.view.ui.BannerInformationView"
     name="BannerInfo"
     restorable="true">
</view>

此后,我在我的视角中添加了此视图

After this I have added this view in my Perspective

public void defineLayout( IPageLayout layout )
    {
        layout.setEditorAreaVisible( true );
        layout.addStandaloneView( BANNER_INFO_VIEW_ID, false, IPageLayout.TOP, 0.03f, layout.getEditorArea() );
        IViewLayout viewLayout = layout.getViewLayout( BANNER_INFO_VIEW_ID );
        viewLayout.setMoveable( false );
    }

现在,我已添加活动以从显示视图菜单中隐藏我的视图名称

Now I have added the activity to hide my view name from show view menu

<extension point="org.eclipse.ui.activities">
     <activity
           id="activity.ide"
           name="ide">
     </activity>
     <activityPatternBinding
           activityId="activity.ide"
           isEqualityPattern="true"
           pattern="org.view.ui.IDECategory.pluginid/org.view.ui.BannerInformationView">
     </activityPatternBinding>
  </extension>

现在我的问题是,除了从窗口中隐藏视图条目-> show view,它还是从我的角度隐藏视图。

Now my problem is, along with hiding the view entry from window -> show view, it is also hiding the view from my perspective.

我想隐藏显示视图中的唯一条目,以便用户无法对其进行任何操作,但它应该始终在我的视图中可见

I want to hide the only entry from show view so that user can not do anything with it, but it should be always visible in my perspective.

推荐答案

视图列表由活动列表。因此,您可以定义一个活动来隐藏视图:

The view list is filtered by the activities list. So you can define an activity to suppress the view:

<extension point="org.eclipse.ui.activities">  
  <activity id="activity.id" name="Name">
  </activity>
  <activityPatternBinding
     activityId="activity.id"
     isEqualityPattern="true"
     pattern="plugin.id/view.id">
  </activityPatternBinding>
 </extension>

注意:模式的值是贡献插件ID /视图ID,一个常见的错误是忽略了插件ID。

Note: The pattern value is 'contributing plugin id / view id', a common mistake is leaving out the plugin id.

这篇关于如何从Windows中删除视图-&gt;显示视图列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆