Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 163983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:39:48+00:00 2026-05-11T11:39:48+00:00

My application has 5 plugins. Each plugin has a perspective of it’s own and

  • 0

My application has 5 plugins. Each plugin has a perspective of it’s own and hence each perspective extension definition is under individual plugin’s plugin.xml.

Now, I want to control the order in which these perspectives appear in my application. How to do it?

There is one main plugin that holds ‘ApplicationWorkBenchAdvisor.java’. This has initialize() method in which I am iterating through the perspective registry using

PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives(); 

and then appending perspective ids in a comma separated fashion to a String variable (pbar) which is used later like this.

PlatformUI.getPreferenceStore().setDefault(IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS, pbar); PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS, pbar); 

When iterating thourgh the perspective registry, I can compare perspective ids and sort it(when adding to ‘pbar’ by comparing ids) the way I want it to appear but, I don’t want to do this ordering here as it appears like a dirty way.

Is there any other place where we can fix the order in which perspectives appear? (Each perspective resides in different plugin).

ADDED

1) Could we also control the ordering in the perspective switcher?

2) Is there a way to control entry into perspective registry to in inflict the desired order. If not could we write back into perspective registry?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:39:48+00:00Added an answer on May 11, 2026 at 11:39 am

    If your application is encapsulated as an eclipse product, you may tweak the plugin.properties/plugin_customization.ini file.
    (file referenced by the ‘preferenceCustomization‘ property in your product extension point.)
    This file is a java.io.Properties format file. Typically this file is used to set the values for preferences that are published as part of a plug-in’s public API.
    (Example of such a file for org.eclipse.platform)

    So if the string representing the order of perspective can be referenced as a property, you can define the default order in there.
    Since the source code of IWorkbenchPreferenceConstants mentions:

     /**   * Lists the extra perspectives to show in the perspective bar.   * The value is a comma-separated list of perspective ids.   * The default is the empty string.   *   * @since 3.2   */  public static final String JavaDoc PERSPECTIVE_BAR_EXTRAS = 'PERSPECTIVE_BAR_EXTRAS'; //$NON-NLS-1$ 

    Maybe a line in the plugin_customization.ini file:

    org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS=perspectiveId1,perspectiveId2,perspectiveId3 

    would allow you to specify that order without having to hard-code it.

    Additional notes:

    IPerspectiveRegistry (or PerspectiveRegistry) is not made to write anything (especially for perspective defined in an extension)

    Ordering may be found in the state of the workbench (stored in the workspace and then restored when its launched again, .metadata/.plugins/org.eclipse.ui.workbench/workbench.xml)

    Do you confirm that:

    IPerspectiveRegistry registry = PlatformUI.getWorkbench().getPerspectiveRegistry(); IPerspectiveDescriptor[] perspectives = registry.getPerspectives(); 

    is not in the right order when the plugin_customization.ini does define that order correctly ?

    Liverpool 5 – 0 Aston Villa does confirm that (in the comments), but also indicates the (ordered) ini file entries internally get recorded into preference store, which means they can be retrieved through the preference store API:

    PatformUI.getPreferenceStore().getDefault(      IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS) 

    Liverpool 5 – 0 Aston Villa then add:

    perspective registry (the initial ‘PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives();‘ bit) remains unaltered (and unordered).
    But, you still can ‘readily access to ordered list of perspectives‘ through preference store.
    So, for other tasks, instead of iterating though perspective registry (which is still unordered), we can use the ordered variable that stores list of ordered perpective ids.

    .
    .
    .
    .


    Note: another possibility is to Replace the Perspective-Switcher in RCP apps

    alt text => to: alt text

    You can more easily define the order in a menu or in buttons there.


    Extreme solution: re-implement a perspective switcher.

    http://www.richclient2.de/wp-content/uploads/2006/08/persp_header.png

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

My application has 5 plugins. Each plugin has a perspective of it's own and
Context: .NET 3.5, VS2008. I'm not sure about the title of this question, so
I am developing RoR application that works with legacy database and uses ActiveScaffold plugin
I have a web application that's currently running under Tomcat 5.5.25. I'm attempting to
First a bit of background. I have been working on the MS platform for

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.