]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - ui/jcr/AsyncUiEventListener.java
1 package org
.argeo
.eclipse
.ui
.jcr
;
3 import javax
.jcr
.observation
.EventIterator
;
4 import javax
.jcr
.observation
.EventListener
;
6 import org
.eclipse
.ui
.PlatformUI
;
8 /** {@link EventListener} which simplifies running actions within the UI thread. */
9 public abstract class AsyncUiEventListener
implements EventListener
{
10 /** Called asynchronously in the UI thread. */
11 protected abstract void onEventInUiThread(EventIterator events
);
13 public void onEvent(final EventIterator events
) {
14 PlatformUI
.getWorkbench().getDisplay().asyncExec(new Runnable() {
16 onEventInUiThread(events
);