Perspective 自定义设置扩展点

在RCP开发中,会要求对特定的perspective 进行自定义设置,比如显示、隐藏某个菜单等,这些操作都可以通过在Window菜单下的Customize Perspective 菜单项实现。如果想设定默认的透视图的状态,可以使用org.eclipse.ui.perspectiveExtensions扩展点。

 

Eclipse Doc写道
This extension point is used to extend perspectives registered by other plug-ins. A perspective defines the initial contents of the window action bars (menu and toolbar) and the initial set of views and their layout within a workbench page. Other plug-ins may contribute actions or views to the perspective which appear when the perspective is selected. Optional additions by other plug-ins are appended to the initial definition.

 

一个示例:

    <extension point="org.eclipse.ui.perspectiveExtensions"> 
        <perspectiveExtension 
            targetID="org.eclipse.ui.resourcePerspective"> <!-- 目标透视图-->
            <actionSet id="org.eclipse.jdt.ui.JavaActionSet"/> <!-- 显示JavaActionSet相关的菜单-->
            <viewShortcut id="org.eclipse.jdt.ui.PackageExplorer"/> 
            <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewProjectCreationWizard"/> 
            <perspectiveShortcut id="org.eclipse.jdt.ui.JavaPerspective"/> 
            <view id="org.eclipse.jdt.ui.PackageExplorer" 
                relative="org.eclipse.ui.views.ResourceNavigator" 
                relationship="stack"/> 
            <view id="org.eclipse.jdt.ui.TypeHierarchy" 
                relative="org.eclipse.ui.views.ResourceNavigator" 
                relationship="left" 
                ratio="0.50"/> 
        </perspectiveExtension> 
    </extension> 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值