Skip to content

[Cocoa] Replace deprecated macOS Button Type and Bezel Style constants#3215

Open
HeikoKlare wants to merge 1 commit intoeclipse-platform:masterfrom
HeikoKlare:replace-deprecated-macos-button-bezel-constants
Open

[Cocoa] Replace deprecated macOS Button Type and Bezel Style constants#3215
HeikoKlare wants to merge 1 commit intoeclipse-platform:masterfrom
HeikoKlare:replace-deprecated-macos-button-bezel-constants

Conversation

@HeikoKlare
Copy link
Copy Markdown
Contributor

Summary

Addresses part of #3214, which tracks the replacement of deprecated macOS SDK constants replicated in OS.java.

This PR replaces 8 deprecated NSButtonCell.h constants (deprecated since macOS 10.0–10.14) with their modern equivalents across the SWT Cocoa implementation.

Button Types (NSButtonType)

Deprecated Replacement
NSMomentaryLightButton NSButtonTypeMomentaryLight
NSPushOnPushOffButton NSButtonTypePushOnPushOff
NSRadioButton NSButtonTypeRadio
NSSwitchButton NSButtonTypeSwitch

Bezel Styles (NSBezelStyle)

Deprecated Replacement
NSRoundedBezelStyle NSBezelStylePush
NSRegularSquareBezelStyle NSBezelStyleFlexiblePush
NSShadowlessSquareBezelStyle NSBezelStyleSmallSquare
NSRoundedDisclosureBezelStyle NSBezelStylePushDisclosure

Note: NSShadowlessSquareBezelStyle was first renamed to NSBezelStyleShadowlessSquare, which itself was subsequently deprecated in favour of NSBezelStyleSmallSquare. This PR goes directly to the current non-deprecated name.

Changed Files

  • OS.java — constant declarations replaced in-place, maintaining alphabetical ordering
  • AppKitFull.bridgesupport — new enum entries added for the modern constant names
  • AppKitFull.bridgesupport.extrasswt_gen markers updated to reference the new names
  • Button.java — 7 call sites updated (button type and bezel style assignments and comparisons)
  • DateTime.java — 2 call sites updated (disclosure button setup)
  • Table.java — 1 call site updated (checkbox column button type)
  • Tree.java — 1 call site updated (checkbox column button type)

Testing

No functional change — the integer values of all constants remain identical. The rename is purely nominal to align with the current macOS SDK naming conventions and silence deprecation warnings when building against macOS 10.14+.


This change was made with the assistance of Claude Code (claude.ai/code).

Replaces deprecated NSButtonCell.h constants (deprecated since macOS 10.14)
with their modern equivalents as tracked in issue eclipse-platform#3214:

Button Types:
  NSMomentaryLightButton  -> NSButtonTypeMomentaryLight
  NSPushOnPushOffButton   -> NSButtonTypePushOnPushOff
  NSRadioButton           -> NSButtonTypeRadio
  NSSwitchButton          -> NSButtonTypeSwitch

Bezel Styles:
  NSRoundedBezelStyle          -> NSBezelStylePush
  NSRegularSquareBezelStyle    -> NSBezelStyleFlexiblePush
  NSShadowlessSquareBezelStyle -> NSBezelStyleSmallSquare
  NSRoundedDisclosureBezelStyle -> NSBezelStylePushDisclosure

Updated OS.java constant declarations, AppKitFull.bridgesupport(.extras),
and all call sites in Button, DateTime, Table, and Tree widgets.
@github-actions
Copy link
Copy Markdown
Contributor

Test Results (macos)

   54 files  +   27     54 suites  +27   8m 28s ⏱️ + 5m 28s
4 531 tests ±    0  4 287 ✅ ±    0  244 💤 ± 0  0 ❌ ±0 
2 130 runs  +1 065  2 068 ✅ +1 034   62 💤 +31  0 ❌ ±0 

Results for commit f22509b. ± Comparison against base commit 596bef6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant