简体   繁体   English

使Eclipse RCP Intro成为透视图的一部分

[英]Make Eclipse RCP Intro part of a perspective

For a product we are creating, we want to be able to have the welcome screen display in a perspective (which we are calling "Start Here"). 对于我们正在创建的产品,我们希望能够以透视图显示欢迎屏幕(我们称之为“从这里开始”)。 The intro is the only thing that needs to be in that perspective, however, when I try to add our intro view to the perspective, it says that the view already exists in the layout. 介绍是唯一需要在该视角中的东西,但是,当我尝试将我们的介绍视图添加到透视图时,它表示视图已经存在于布局中。

I have tried programmatically closing the intro, messing around with standby mode etc but I cant get it working. 我已经尝试以编程方式关闭介绍,乱用待机模式等但我无法让它工作。

The intro is an XHTML one and we use internal Eclipse "action links" (eg http://org.eclipse...?runAction etc) extensively (hence the reason that we need to use the intro framework. 介绍是一个XHTML,我们广泛使用内部Eclipse“动作链接”(例如http://org.eclipse ...?runAction等)(因此我们需要使用intro框架。

Does anyone have any ideas as to how I could get it added to a perspective, or at the very least get the intro fully maximised when you select a specific perspective (using the "showIntro" method results in it displaying oddly, bunched to one side). 有没有人对如何将它添加到透视图中有任何想法,或者至少在选择特定透视图时使介绍完全最大化(使用“showIntro”方法导致它显示奇怪,聚集到一侧)。

Thanks! 谢谢!

Intro view is a sticky view, so its placeholder is created by default to every perspective, to the right of editor area. 简介视图是一个粘滞视图,因此其占位符默认创建到编辑器区域右侧的每个透视图。 There's no public API to remove a placeholder once it is created and when you try to create one you get the error that it already exists. 创建占位符后,没有公共API可以删除占位符,当您尝试创建占位符时,您会收到已存在的错误。

You can maximize Intro view like this: 你可以像这样最大化Intro视图:

IWorkbenchPage page =
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.setPartState(page.findViewReference("org.eclipse.ui.internal.introview"),
    IWorkbenchPage.STATE_MAXIMIZED);

This should probably be done in IPerspectiveListener .perspectiveChanged() rather than in perspective factory. 这可能应该在IPerspectiveListener .perspectiveChanged()而不是透视工厂中完成。

不要将视图添加到透视图,而是调用IIntroManager.showIntro()或WorkbenchWindowAdvisor.openIntro()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM