Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[albireo-dev] SWT version numbers

Hi Gordon,

While trying to see the possible interactions between SWT.BORDER support
and the focus management, I tried to reproduce the focus test cases on
3.4M4, and was shocked to see that the first three test cases were not
working!

Fortunately, it's simple to fix. When you wrote
   if (Platform.SWT_VERSION < Platform.SWT_34 ...)
and
   SWT_34 = swtVersion(3, 400);
you probably expected that they bump the version number to 3,400 when they
release 3.4. No, the version number is already 3,422 in Eclipse 3.4M4. I.e.
they bump the version number at the beginning of a development cycle, not
when they make a release.

I'm fixing it like this. Since the milestones are not tagged in the CVS,
I had to determine the version numbers from the date.

Index: src/org/eclipse/albireo/internal/FocusHandler.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.albireo/org.eclipse.albireo.core/src/org/eclipse/albireo/internal/FocusHandler.java,v
retrieving revision 1.12
diff -c -3 -r1.12 FocusHandler.java
*** src/org/eclipse/albireo/internal/FocusHandler.java	24 Apr 2008 18:43:24 -0000	1.12
--- src/org/eclipse/albireo/internal/FocusHandler.java	24 Apr 2008 19:47:40 -0000
***************
*** 445,451 ****
                  case SWT.Activate:
                      isActiveSwt = true;
                      activeSwingControl = swingControl;
!                     if (Platform.isWin32() && (Platform.SWT_VERSION < Platform.SWT_34) && (synthesizeMethod != null)) {
                          synthesizeWindowActivation(true);
                          if (verboseFocusEvents) {
                              trace("Consuming SWT.Activate event: " + event);
--- 445,451 ----
                  case SWT.Activate:
                      isActiveSwt = true;
                      activeSwingControl = swingControl;
!                     if (Platform.isWin32() && (Platform.SWT_VERSION < Platform.SWT_FIX216431) && (synthesizeMethod != null)) {
                          synthesizeWindowActivation(true);
                          if (verboseFocusEvents) {
                              trace("Consuming SWT.Activate event: " + event);
***************
*** 460,466 ****
                  case SWT.Deactivate:
                      isActiveSwt = false;
                      activeSwingControl = null;
!                     if (Platform.isWin32() && (Platform.SWT_VERSION < Platform.SWT_34) && (synthesizeMethod != null)) {
                          synthesizeWindowActivation(false);
                          if (verboseFocusEvents) {
                              trace("Consuming SWT.Deactivate event: " + event);
--- 460,466 ----
                  case SWT.Deactivate:
                      isActiveSwt = false;
                      activeSwingControl = null;
!                     if (Platform.isWin32() && (Platform.SWT_VERSION < Platform.SWT_FIX216431) && (synthesizeMethod != null)) {
                          synthesizeWindowActivation(false);
                          if (verboseFocusEvents) {
                              trace("Consuming SWT.Deactivate event: " + event);
Index: src/org/eclipse/albireo/internal/Platform.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.albireo/org.eclipse.albireo.core/src/org/eclipse/albireo/internal/Platform.java,v
retrieving revision 1.4
diff -c -3 -r1.4 Platform.java
*** src/org/eclipse/albireo/internal/Platform.java	26 Feb 2008 19:55:51 -0000	1.4
--- src/org/eclipse/albireo/internal/Platform.java	24 Apr 2008 19:47:40 -0000
***************
*** 86,94 ****
      // It seems necessary to use private API to get this value. Provide delegating methods here so that
      // the internal dependency is localized. 
      public static final int SWT_VERSION = Library.SWT_VERSION;
!     public static final int SWT_33 = swtVersion(3, 300);
!     public static final int SWT_34 = swtVersion(3, 400);
!     
      private static int swtVersion(int major, int minor) {
          return Library.SWT_VERSION(major, minor);
      }
--- 86,97 ----
      // It seems necessary to use private API to get this value. Provide delegating methods here so that
      // the internal dependency is localized. 
      public static final int SWT_VERSION = Library.SWT_VERSION;
!     // For the SWT version numbers, look at
!     // <http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java?view=log>
!     public static final int SWT_33 = swtVersion(3, 346);
!     public static final int SWT_FIX216431 = swtVersion(3, 426); // between 3.4M4 and 3.4M5
!     //public static final int SWT_34 = swtVersion(3, 4??);
! 
      private static int swtVersion(int major, int minor) {
          return Library.SWT_VERSION(major, minor);
      }


Back to the top