Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] Question regarding DelayedEventsProcessor

Dear Platform Experts,

I have a question regarding the implementation of DelayedEventsProcessor.

When a user chooses “Open with > Eclipse” e.g. from Windows File Explorer context menu the Display's implementation fires the SWT.OpenDocument event. DelayedEventsProcessor is the Handler that listens to this event. When such an event is received this handle only stores this in an array. The actual processing takes place later. It takes place when the catchUp method is called. According to the JavaDoc “This method is called when there are currently no more events on the queue to be processed at the moment.” So this is event is processed when the UI-queue is free.

When you look now into the implementation of DelayedEventsProcessor#openFile you see that the complete work is done inside a “display.asyncExec”. I wonder why this is done.
aynchExec puts the runnable at the end of the UI queue and executes the work in the UI thread. But we are currently in the UI Thread and we got called because no other stuff needs to be done in the UI queue. So I would say we don’t need that “asynchExec” here. Or do I overlook something?

Regards,
Matthias


Back to the top