FAQ How do I create fixed views and perspectives?

From Eclipsepedia

Jump to: navigation, search

New APIs in Eclipse 3.0 allow perspectives more control over how their views are presented. These APIs are useful in RCP applications that want different view-presentation models. The IPageLayout interface, provided when your perspective factory is creating its initial layout, has methods for customizing how views will be presented in that perspective. The setFixed method on IPageLayout indicates that a perspective should be fixed. In a fixed perspective, views and editors cannot be moved or zoomed by the user.

A stand-alone view, created with the method addStandaloneView, cannot be stacked together with other views and can optionally hide its title bar. A view with its title bar hidden cannot be closed, minimized, or moved. For further control over whether views can be closed or moved, you can obtain an IViewLayout instance for any view in the perspective. Following is an example of a fixed perspective that creates a stand-alone view above the editor area that cannot be moved or closed.

   class RecipePerspective implements IPerspectiveFactory {
      public void createInitialLayout(IPageLayout page) {
            false, IPageLayout.TOP, 0.2f, 
         IViewLayout view = page.getViewLayout(

You can add fixed and stand-alone views to perspectives from other plug-ins using the perspectiveExtensions extension point. See the extension point documentation for more details.

See Also:

FAQ How can I add my views and actions to an existing perspective?

FAQ Why can't I control when, where, and how my view is presented?

This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.