diff options
author | Alexander Kurtakov | 2016-02-09 09:02:37 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2016-02-10 07:57:09 +0000 |
commit | 0b3de15c83fddb6e45d1372ffdf88504e8951d1e (patch) | |
tree | 1a473bc6a5e0fe325fb6900b9bac630409450ae8 /bundles/org.eclipse.swt/Eclipse SWT AWT | |
parent | 1a375bfbb7dca92b102db09891a18eeb80d671f2 (diff) | |
download | eclipse.platform.swt-0b3de15c83fddb6e45d1372ffdf88504e8951d1e.tar.gz eclipse.platform.swt-0b3de15c83fddb6e45d1372ffdf88504e8951d1e.tar.xz eclipse.platform.swt-0b3de15c83fddb6e45d1372ffdf88504e8951d1e.zip |
Bug 483640 - Add missing annotations to SWT after the move to Java 7
Add missing @Override annotation for interface methods.
Change-Id: Ibce185467807acd2dc5e6b71fda643a3947f60eb
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT AWT')
3 files changed, 40 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java index cdc70ed472..f908478a0f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation 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 @@ -164,6 +164,7 @@ public static Frame new_Frame(final Composite parent) { final Throwable[] exception = new Throwable[1]; Runnable runnable = new Runnable () { boolean run; + @Override public void run() { if (run) return; run = true; @@ -204,10 +205,12 @@ public static Frame new_Frame(final Composite parent) { /* Forward the iconify and deiconify events */ final Listener shellListener = new Listener () { + @Override public void handleEvent (Event e) { switch (e.type) { case SWT.Deiconify: EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEICONIFIED)); } @@ -215,6 +218,7 @@ public static Frame new_Frame(final Composite parent) { break; case SWT.Iconify: EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ICONIFIED)); } @@ -232,6 +236,7 @@ public static Frame new_Frame(final Composite parent) { */ final Display display = parent.getDisplay(); display.addListener(SWT.Dispose, new Listener() { + @Override public void handleEvent(Event event) { while (frame.isDisplayable() && !display.isDisposed()) { if (!display.readAndDispatch()) { @@ -251,6 +256,7 @@ public static Frame new_Frame(final Composite parent) { * focus work properly for lightweights. */ Listener listener = new Listener () { + @Override public void handleEvent (Event e) { switch (e.type) { case SWT.Dispose: @@ -263,6 +269,7 @@ public static Frame new_Frame(final Composite parent) { } parent.setVisible(false); EventQueue.invokeLater(new Runnable () { + @Override public void run () { try { frame.dispose (); @@ -274,6 +281,7 @@ public static Frame new_Frame(final Composite parent) { if (!parent.isFocusControl()) return; case SWT.FocusIn: EventQueue.invokeLater(new Runnable () { + @Override public void run () { if (frame.isActive()) return; try { @@ -287,6 +295,7 @@ public static Frame new_Frame(final Composite parent) { case SWT.Deactivate: case SWT.FocusOut: EventQueue.invokeLater(new Runnable () { + @Override public void run () { if (!frame.isActive()) return; try { @@ -313,6 +322,7 @@ public static Frame new_Frame(final Composite parent) { parent.addListener (SWT.Dispose, listener); display.asyncExec(new Runnable() { + @Override public void run () { if (parent.isDisposed()) return; final Rectangle clientArea = parent.getClientArea(); @@ -323,6 +333,7 @@ public static Frame new_Frame(final Composite parent) { } catch (Throwable e) {e.printStackTrace();} } else { EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.setSize(clientArea.width, clientArea.height); frame.validate(); @@ -374,6 +385,7 @@ public static Shell new_Shell(final Display display, final Canvas parent) { @Override public void componentResized (ComponentEvent e) { display.asyncExec (new Runnable () { + @Override public void run () { if (shell.isDisposed()) return; Dimension dim = parent.getSize (); @@ -384,6 +396,7 @@ public static Shell new_Shell(final Display display, final Canvas parent) { }; parent.addComponentListener(listener); shell.addListener(SWT.Dispose, new Listener() { + @Override public void handleEvent(Event event) { parent.removeComponentListener(listener); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java index dba5cd6938..f73f9261a4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation 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 @@ -177,11 +177,13 @@ public static Frame new_Frame (final Composite parent) { if (method != null) method.invoke(value); } catch (Throwable e) {} final AWTEventListener awtListener = new AWTEventListener() { + @Override public void eventDispatched(AWTEvent event) { if (event.getID() == WindowEvent.WINDOW_OPENED) { final Window window = (Window) event.getSource(); if (window.getParent() == frame) { parent.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (parent.isDisposed()) return; Shell shell = parent.getShell(); @@ -203,10 +205,12 @@ public static Frame new_Frame (final Composite parent) { }; frame.getToolkit().addAWTEventListener(awtListener, AWTEvent.WINDOW_EVENT_MASK); final Listener shellListener = new Listener () { + @Override public void handleEvent (Event e) { switch (e.type) { case SWT.Deiconify: EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEICONIFIED)); } @@ -214,6 +218,7 @@ public static Frame new_Frame (final Composite parent) { break; case SWT.Iconify: EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ICONIFIED)); } @@ -227,6 +232,7 @@ public static Frame new_Frame (final Composite parent) { shell.addListener (SWT.Iconify, shellListener); Listener listener = new Listener () { + @Override public void handleEvent (Event e) { switch (e.type) { case SWT.Dispose: @@ -235,6 +241,7 @@ public static Frame new_Frame (final Composite parent) { shell.removeListener (SWT.Iconify, shellListener); parent.setVisible(false); EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.getToolkit().removeAWTEventListener(awtListener); frame.dispose (); @@ -245,6 +252,7 @@ public static Frame new_Frame (final Composite parent) { if (Library.JAVA_VERSION >= Library.JAVA_VERSION(1, 6, 0)) { final Rectangle clientArea = parent.getClientArea(); EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.setSize (clientArea.width, clientArea.height); } @@ -258,10 +266,12 @@ public static Frame new_Frame (final Composite parent) { parent.addListener (SWT.Resize, listener); parent.getDisplay().asyncExec(new Runnable() { + @Override public void run () { if (parent.isDisposed()) return; final Rectangle clientArea = parent.getClientArea(); EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.setSize (clientArea.width, clientArea.height); frame.validate (); @@ -305,6 +315,7 @@ public static Shell new_Shell (final Display display, final Canvas parent) { @Override public void componentResized (ComponentEvent e) { display.syncExec (new Runnable () { + @Override public void run () { if (shell.isDisposed()) return; Dimension dim = parent.getSize (); @@ -315,6 +326,7 @@ public static Shell new_Shell (final Display display, final Canvas parent) { }; parent.addComponentListener(listener); shell.addListener(SWT.Dispose, new Listener() { + @Override public void handleEvent(Event event) { parent.removeComponentListener(listener); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java index 20053185ed..66c684d799 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation 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 @@ -130,6 +130,7 @@ public static Frame new_Frame (final Composite parent) { final Frame[] result = new Frame[1]; final Throwable[] exception = new Throwable[1]; Runnable runnable = new Runnable () { + @Override public void run () { try { /* @@ -215,10 +216,12 @@ public static Frame new_Frame (final Composite parent) { /* Forward the iconify and deiconify events */ final Listener shellListener = new Listener () { + @Override public void handleEvent (Event e) { switch (e.type) { case SWT.Deiconify: EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEICONIFIED)); } @@ -226,6 +229,7 @@ public static Frame new_Frame (final Composite parent) { break; case SWT.Iconify: EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ICONIFIED)); } @@ -244,6 +248,7 @@ public static Frame new_Frame (final Composite parent) { * focus work properly for lightweights. */ Listener listener = new Listener () { + @Override public void handleEvent (Event e) { switch (e.type) { case SWT.Dispose: @@ -252,6 +257,7 @@ public static Frame new_Frame (final Composite parent) { shell.removeListener (SWT.Iconify, shellListener); parent.setVisible(false); EventQueue.invokeLater(new Runnable () { + @Override public void run () { try { frame.dispose (); @@ -262,6 +268,7 @@ public static Frame new_Frame (final Composite parent) { case SWT.FocusIn: case SWT.Activate: EventQueue.invokeLater(new Runnable () { + @Override public void run () { if (frame.isActive()) return; try { @@ -274,6 +281,7 @@ public static Frame new_Frame (final Composite parent) { break; case SWT.Deactivate: EventQueue.invokeLater(new Runnable () { + @Override public void run () { if (!frame.isActive()) return; try { @@ -292,10 +300,12 @@ public static Frame new_Frame (final Composite parent) { parent.addListener (SWT.Dispose, listener); parent.getDisplay().asyncExec(new Runnable() { + @Override public void run () { if (parent.isDisposed()) return; final Rectangle clientArea = parent.getClientArea(); EventQueue.invokeLater(new Runnable () { + @Override public void run () { frame.setSize (clientArea.width, clientArea.height); frame.validate (); @@ -339,6 +349,7 @@ public static Shell new_Shell (final Display display, final Canvas parent) { @Override public void componentResized (ComponentEvent e) { display.syncExec (new Runnable () { + @Override public void run () { if (shell.isDisposed()) return; Dimension dim = parent.getSize (); @@ -349,6 +360,7 @@ public static Shell new_Shell (final Display display, final Canvas parent) { }; parent.addComponentListener(listener); shell.addListener(SWT.Dispose, new Listener() { + @Override public void handleEvent(Event event) { parent.removeComponentListener(listener); } |