Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/events/AbstractEventListener.java')
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/events/AbstractEventListener.java47
1 files changed, 0 insertions, 47 deletions
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/events/AbstractEventListener.java b/target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/events/AbstractEventListener.java
deleted file mode 100644
index a50e03bee..000000000
--- a/target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/events/AbstractEventListener.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tm.te.ui.events;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.tm.te.runtime.interfaces.events.IEventFireDelegate;
-import org.eclipse.tm.te.runtime.interfaces.events.IEventListener;
-import org.eclipse.tm.te.ui.swt.DisplayUtil;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Abstract event listener implementation firing the event
- * within the platforms UI thread.
- */
-public abstract class AbstractEventListener implements IEventListener, IEventFireDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.interfaces.events.IEventFireDelegate#fire(java.lang.Runnable)
- */
- @Override
- public void fire(Runnable runnable) {
- // Do nothing if no valid runnable is passed
- if (runnable == null) return;
-
- // Executes the runnable asynchronously within the current platform
- // UI thread if the platform display instance is available and not yet disposed.
- if (PlatformUI.isWorkbenchRunning() && PlatformUI.getWorkbench().getDisplay() != null
- && !PlatformUI.getWorkbench().getDisplay().isDisposed()) {
- // Check if the current thread is the platform UI thread
- if (PlatformUI.getWorkbench().getDisplay().equals(Display.getCurrent())) {
- // We can execute the runnable directly
- runnable.run();
- } else {
- // We have to execute the runnable asynchronously
- DisplayUtil.safeAsyncExec(runnable);
- }
- }
- }
-
-}

Back to the top