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

  • Home
  • SEARCH
  • 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 6167505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:31:31+00:00 2026-05-23T22:31:31+00:00

I have created a simple Eclipse RCP application where I can open multiple editor

  • 0

I have created a simple Eclipse RCP application where I can open multiple editor instances based on user action. I have a separate view (ViewPart) where I listen for the selection changes on the editor.
The problem is that the view is notified only of the selections from the last opened editor, the other editors which were opened earlier don’t provide the events any more/or maybe the view listens only to the last opened editor and nothing else. This happens even if the previously opened editors gain focus.

In other words, only the newest editor in editor area provides selection events, what I want is, when I click on the other editor’s tabs, I want to see the changes on my view when I click one of the previously opened editors.

In my view I use:

IWorkbench workbench = PlatformUI.getWorkbench();
        workbench.getActiveWorkbenchWindow().getActivePage().addSelectionListener(DocumentsEditor.ID,(ISelectionListener)this);

where DocumentEditor is one of the editors opened in application editor area.

  • 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. Editorial Team
    Editorial Team
    2026-05-23T22:31:32+00:00Added an answer on May 23, 2026 at 10:31 pm

    From the JavaDoc for ISelectionService.addSelectionListener(String partId, ISelectionListener listener) (emphasis is mine):

    Adds a part-specific selection listener which is notified when selection changes in the part with the given id. This is independent of part activation – the part need not be active for notification to be sent.

    When the part is created, the listener is passed the part’s initial selection. When the part is disposed, the listener is passed a null selection, but only if the listener implements INullSelectionListener.

    Note: This will not correctly track editor parts as each editor does not have a unique partId.

    So don’t use this method when you want to track editor selections. Instead use ISelectionService.addSelectionListener(ISelectionListener listener) and check the given part in ISelectionListener.selectionChanged(IWorkbenchPart part, ISelection selection) using instanceof…

    Small note to the code: The selection service exists on a per window basis, so if you have multiple workbench windows, they each have their own service instance.

    For this reason I usually use the following code in my views and editors:

    ISelectionService ss = getSite().getWorkbenchWindow().getSelectionService();
    ss.addPostSelectionListener(listener);
    

    This way the used listener will come from the correct window.

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

Sidebar

Related Questions

I have created a simple application in android [PhoneGap] [Eclipse] {Sorry for this convention
I have created simple Java Dynamic Web project in Eclipse. I host my project
Hello i have created a sample application in android using eclipse IDE my code
I have created a simple hello world php app in eclipse with the name
I have created a dynamic web project in Eclipse and have written a simple
I have created a simple RMI application, that just send a message to RMI
I have created a simple java web (Vaadin) application project using JPA and it
Could someone help me on this, I have created simple web services using axis2
How to manually create Friendly URLs? (PHP) So I have created simple php file
I have created a simple wcf service which used the WCF Service Library template.

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.