活动视角问题
我创建了一个示例插件,需要隐藏 java 透视图。为此我使用了活动。发生的问题是,它隐藏在视角之外,但它仍然存在于(最近打开的视角)中。我怎样才能把它隐藏起来呢?以下是我的代码。
<extension
point="org.eclipse.ui.activities">
<activity
id="com.example.activities.hideperspective"
name="Hide Perspective">
</activity>
<activityPatternBinding
activityId="com.example.activities.hideperspective"
isEqualityPattern="false"
pattern="com.example.activities.hideperspective/org.eclipse.jdt.ui.JavaPerspective">
</activityPatternBinding>
这是我实施的正确方法吗?另一件事是,当我单击工具栏上的按钮时,我会调用这种隐藏的透视图。该按钮的位置也发生了变化。工具栏上的某种刷新。
我也附上了屏幕截图。
I created a sample plugin which needs to hide the java perspective. For that I used activities. The problems what happends is,it is hiding from the perspectives,but it is there still in the (recent opened perspectives). How can I hide it from there also? Following is my code.
<extension
point="org.eclipse.ui.activities">
<activity
id="com.example.activities.hideperspective"
name="Hide Perspective">
</activity>
<activityPatternBinding
activityId="com.example.activities.hideperspective"
isEqualityPattern="false"
pattern="com.example.activities.hideperspective/org.eclipse.jdt.ui.JavaPerspective">
</activityPatternBinding>
Is this the right way what I have implemented? One more thing, This hiding of perspective I am calling when I click a Button on the toolbar. That the that buttons location is also getting changed. some kind of refresh on the toolbar.
I have attached the screenshot as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ActivityPatternBinding 是plugin.id/perspective.id,其中plugin.id 是提供透视图的插件的ID,而不是com.example.activities.hideperspective。而且,它看起来确实像一个平等模式。
此外,如果启用了指向该透视图的任何活动,则活动将显示某些内容(例如透视图)。因此,将一项活动设置为
enabled=false
可能不会消除视角。最后,活动不会关闭已经开放的视角。它只是将其从“打开视角”对话框/快捷方式中删除。
The activityPatternBinding is plugin.id/perspective.id, where the plugin.id is the ID of the plugin that contributed the perspective, not com.example.activities.hideperspective. Also, it does look like an equality pattern.
Also, activities will show something (like a perspective) if any activity that points to that perspective is enabled. So setting one activity to
enabled=false
might not get rid of the perspective.And finally, activities won't shut a perspective that is already open. It just removes it from the "Open Perspective" dialog/shortcuts.