Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2016-01-07 19:15:42 +0000
committerAlexander Kurtakov2016-01-07 19:15:42 +0000
commitdb81cae862c88eaf5211866cce13b638beb646e8 (patch)
tree5f325c604e9a5a6c386a4f70353e442fdde1db13 /bundles
parent62396e7f197b93c20522ab3007183e0650d01964 (diff)
downloadeclipse.platform.swt-db81cae862c88eaf5211866cce13b638beb646e8.tar.gz
eclipse.platform.swt-db81cae862c88eaf5211866cce13b638beb646e8.tar.xz
eclipse.platform.swt-db81cae862c88eaf5211866cce13b638beb646e8.zip
Bug 485369 - Remove pre Java 1.5 workarounds
There are few code branches for pre Java 1.5, that serve no purpose nowadays as SWT require 1.5 or newer. Change-Id: Ieb5d4ce0da8407d32b907b71d1721ef07bf11f18 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTException.java6
3 files changed, 13 insertions, 45 deletions
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 7a815ee1db..a61d2cde26 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
@@ -263,51 +263,31 @@ public static Frame new_Frame (final Composite parent) {
case SWT.Activate:
EventQueue.invokeLater(new Runnable () {
public void run () {
- if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 4, 0)) {
- frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ACTIVATED));
- frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_GAINED));
- } else if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 5, 0)) {
- frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ACTIVATED));
- frame.dispatchEvent (new WindowEvent (frame, 207 /*WindowEvent.WINDOW_GAINED_FOCUS*/));
- } else {
- if (frame.isActive()) return;
- try {
- Class<?> clazz = frame.getClass();
- Method method = clazz.getMethod("synthesizeWindowActivation", boolean.class);
- if (method != null) method.invoke(frame, Boolean.TRUE);
- } catch (Throwable e) {}
- }
+ if (frame.isActive()) return;
+ try {
+ Class<?> clazz = frame.getClass();
+ Method method = clazz.getMethod("synthesizeWindowActivation", boolean.class);
+ if (method != null) method.invoke(frame, Boolean.TRUE);
+ } catch (Throwable e) {}
}
});
break;
case SWT.Deactivate:
EventQueue.invokeLater(new Runnable () {
public void run () {
- if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 4, 0)) {
- frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));
- frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_LOST));
- } else if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 5, 0)) {
- frame.dispatchEvent (new WindowEvent (frame, 208 /*WindowEvent.WINDOW_LOST_FOCUS*/));
- frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));
- } else {
- if (!frame.isActive()) return;
- try {
- Class<?> clazz = frame.getClass();
- Method method = clazz.getMethod("synthesizeWindowActivation", boolean.class);
- if (method != null) method.invoke(frame, Boolean.FALSE);
- } catch (Throwable e) {}
- }
+ if (!frame.isActive()) return;
+ try {
+ Class<?> clazz = frame.getClass();
+ Method method = clazz.getMethod("synthesizeWindowActivation", boolean.class);
+ if (method != null) method.invoke(frame, Boolean.FALSE);
+ } catch (Throwable e) {}
}
});
break;
}
}
};
- if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 5, 0)) {
- parent.addListener (SWT.Activate, listener);
- } else {
- parent.addListener (SWT.FocusIn, listener);
- }
+ parent.addListener (SWT.FocusIn, listener);
parent.addListener (SWT.Deactivate, listener);
parent.addListener (SWT.Dispose, listener);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java
index 1c2de31609..87dedc37a9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.swt;
-import org.eclipse.swt.internal.*;
-
/**
* This error is thrown whenever an unrecoverable error
* occurs internally in SWT. The message text and error code
@@ -140,10 +138,6 @@ public String getMessage () {
@Override
public void printStackTrace () {
super.printStackTrace ();
- if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 4, 0) && throwable != null) {
- System.err.println ("*** Stack trace of contained error ***"); //$NON-NLS-1$
- throwable.printStackTrace ();
- }
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTException.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTException.java
index 7a9e70ddd5..3097562ddc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTException.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTException.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.swt;
-import org.eclipse.swt.internal.*;
-
/**
* This runtime exception is thrown whenever a recoverable error
* occurs internally in SWT. The message text and error code
@@ -131,10 +129,6 @@ public String getMessage () {
@Override
public void printStackTrace () {
super.printStackTrace ();
- if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 4, 0) && throwable != null) {
- System.err.println ("*** Stack trace of contained exception ***"); //$NON-NLS-1$
- throwable.printStackTrace ();
- }
}
}

Back to the top