From abd61e9f124f4132bf619e6a19fe1d7b4e40a656 Mon Sep 17 00:00:00 2001 From: mguessan Date: Mon, 20 Jun 2011 10:26:19 +0000 Subject: [PATCH] Remove unused SwtAwtEventQueue class git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1710 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- .../davmail/ui/tray/SwtAwtEventQueue.java | 116 ------------------ 1 file changed, 116 deletions(-) delete mode 100644 src/java/davmail/ui/tray/SwtAwtEventQueue.java diff --git a/src/java/davmail/ui/tray/SwtAwtEventQueue.java b/src/java/davmail/ui/tray/SwtAwtEventQueue.java deleted file mode 100644 index a9f7a907..00000000 --- a/src/java/davmail/ui/tray/SwtAwtEventQueue.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway - * Copyright (C) 2010 Mickael Guessant - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package davmail.ui.tray; - -import org.apache.log4j.Logger; -import org.eclipse.swt.internal.gtk.OS; - -import java.awt.*; -import java.util.EmptyStackException; - -/** - * Custom AWT event queue to trap X errors and avoid application crash. - */ -public class SwtAwtEventQueue extends EventQueue { - protected static final Logger LOGGER = Logger.getLogger(SwtAwtEventQueue.class); - - /** - * Register SWT GDK error handler - */ - public static void registerErrorHandler() { - OS.gdk_error_trap_push(); - } - - /** - * Handle errors caught by SWT GDK error handler - */ - public static void handleGdkError() { - OS.gdk_flush(); - int errorCode = OS.gdk_error_trap_pop(); - if (errorCode != 0) { - LOGGER.debug("Uncaught GDK X error: " + errorCode); - } - } - - /** - * @inheritDoc - */ - public void postEvent(AWTEvent event) { - registerErrorHandler(); - super.postEvent(event); - handleGdkError(); - } - - /** - * @inheritDoc - */ - protected void dispatchEvent(AWTEvent event) { - registerErrorHandler(); - super.dispatchEvent(event); - handleGdkError(); - } - - /** - * @inheritDoc - */ - public AWTEvent getNextEvent() throws InterruptedException { - registerErrorHandler(); - AWTEvent event = super.getNextEvent(); - handleGdkError(); - return event; - } - - /** - * @inheritDoc - */ - public synchronized AWTEvent peekEvent() { - registerErrorHandler(); - AWTEvent event = super.peekEvent(); - handleGdkError(); - return event; - } - - /** - * @inheritDoc - */ - public synchronized AWTEvent peekEvent(int id) { - registerErrorHandler(); - AWTEvent event = super.peekEvent(id); - handleGdkError(); - return event; - } - - /** - * @inheritDoc - */ - protected void pop() throws EmptyStackException { - registerErrorHandler(); - super.pop(); - handleGdkError(); - } - - /** - * @inheritDoc - */ - public synchronized void push(EventQueue newEventQueue) { - registerErrorHandler(); - super.push(newEventQueue); - handleGdkError(); - } -}