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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:23:57+00:00 2026-06-11T15:23:57+00:00

I am registering a lifecycle listener in the plugin.xml . It runs ok if

  • 0

I am registering a lifecycle listener in the plugin.xml. It runs ok if I just define a Shell.
e.g.

@PostContextCreate  
void postContextCreate(final IEventBroker eventBroker){  
     System.out.println("CALLED!");    
     final Shell shell = new Shell(SWT.TOOL | SWT.NO_TRIM);  
     shell.open();  
     eventBroker.subscribe(UIEvents.UILifeCycle.ACTIVATE, new EventHandler() {  

    @Override  
    public void handleEvent(Event event) {  
        System.out.println("Closing shell");  
        shell.close();  
        shell.dispose();  
        System.out.println("Closed");  
        eventBroker.unsubscribe(this);  
        }
     });

But if I change the call to also use a Display:

@PostContextCreate
void postContextCreate(final IEventBroker eventBroker){  
    System.out.println("CALLED!");  
    Display display = new Display();  
    final Shell shell = createSplashShell(display);  
    shell.open();  
    while (!shell.isDisposed ()) {  
    if (!display .readAndDispatch ()) display.sleep ();  
    }
    display.dispose ();  
   //etc  

I get the following exception:

org.eclipse.e4.core.di.InjectionException:
org.eclipse.swt.SWTException: Invalid thread access at
org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
at
org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
at
org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:206)
at

I understand that this exception has to do something with the UI thread but I can not figure out how using Display causes this exception here.
Any help?

  • 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-06-11T15:23:58+00:00Added an answer on June 11, 2026 at 3:23 pm

    As per my understanding, I see that you want to popup a shell when an event occurs.
    One display( created by main RCP app) is enough to crate new shell and processing events.

    @PostContextCreate
        void postContextCreate(final IEventBroker eventBroker){  
            System.out.println("CALLED!");
    
            final Display display = Display.getDefault();
            Display.getDefault().asyncExec(new Runnable()
            {
              public void run()
            { 
             final Shell shell = createSplashShell(display);  
             shell.open();  
             while (!shell.isDisposed ()) {  
             if (!display .readAndDispatch ()) display.sleep ();  
            }
          }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm registering for location updates: public void onResume() { LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); List<String>
I'm registering a preference change listener like this (in the onCreate() of my main
I am struggling to get my LogIn/Registering system working. I have a register.aspx page
After registering on my site I can make people moderators which just changes 1
I have a contacts registering(is simply just to test) but the editText when it
Is registering components on castle windsor thread-safe? I.e., can multiple threads simultaneously register components
When registering an event via addEventListener on an element, then delete that element without
When registering a product, the user can customize the URL of it! As the
My registering here is a strong testimony to the excellent answers I've found here
When registering my first user in table 'users' the id is the same value

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.