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 6057515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:29:49+00:00 2026-05-23T08:29:49+00:00

I have an Eclipse RCP Standalone Application using Eclipse 3.6. I have implemented a

  • 0

I have an Eclipse RCP Standalone Application using Eclipse 3.6.

I have implemented a FormEditor and a FormPage for that (multipage) FormEditor. On that first FormPage is a Button that has a Command which calculate some data and should open a second FormPage with the results.

The results are calculated and the second FormPage is showing the results and added to the FormEditor properly.

My problem is that only a new tab appears in the FormEditor. I want that the second FormPage is shown immediately. Instead you have to click on the tab in order to see the second page.

Here is the code of the Handler which adds the FormPage to the Editor.

IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();

for(IEditorReference reference : page.getEditorReferences()){
  if(reference .getId().equals("my.project.MyFormEditor")){
    EditorPart part = (EditorPart) reference.getEditor(true);
    MyFormEditor editor = (MyFormEditor)part;
    editor.addResultPage();
  }
}

This works fine, but I need to bring the ResultPage to the Foreground now. So I tried to call the setFocus() Method of the ResultPage with:

IFormPage resultPage = editor.findPage("my.project.ResultPage");
resultPage.setFocus();

and have overritten the setFocus() Method of the ResultPage like this:

public void setFocus(){
 this.getPartControl().setFocus();
}

But that causes a NullPointer Exeption when the Method setFocus tries to get the PartControl. It seems that the ResultPage isn’t loaded at that point of time.
So I tried to call the setFocus() Method via asyncExec like this:

Display.getDefault().asyncExec(new Runnable() {
 public void run() {
 //...call the setFocus() Method ....
 }
}

But that causes the same NullpointerException. And by adding a wait to the Runnable it causes a IllegalMonitorState Exception.

So I tried several ways and search the internet for a solution but could’t find one. So I hope that maybe you can help me.

Is there a clean way to bring a specific FormPage to the Foreground? Is calling the setFocus() Method wrong? Should it something like toForeground()? Or isn’t this possible with the FormEditor/FormPage UI Elements?

Best Regards

Matthias

  • 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-23T08:29:49+00:00Added an answer on May 23, 2026 at 8:29 am

    Try in your EditorPart ((CTabFolder) getContainer()).setSelection(2);

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

Sidebar

Related Questions

I have a plug-in to an Eclipse RCP application that has a view. After
I have an Eclipse RCP application that will launch properly after a clean install
I have an Eclipse RCP app I'm working on. It has some view-specific menus
I have an Eclipse RCP application with an instance of an EMF model populated
I have an Eclipse RCP project that's targeted to Eclipse 3.4. Now that 3.5
I have an Eclipse RCP plugin that requires a DLL. What is the recommended
I have an Eclipse RCP app running on Java 6. When I try to
I have only a basic understanding of Eclipse RCP. I am about to start
I have Eclipse 3.3.2 with PDT doing PHP development. All projects that I create,
Does Eclipse have a feature that lets you search a project to find all

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.