[Cocoa] Replace deprecated macOS Button Type and Bezel Style constants#3215
Open
HeikoKlare wants to merge 1 commit intoeclipse-platform:masterfrom
Open
Conversation
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.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses part of #3214, which tracks the replacement of deprecated macOS SDK constants replicated in
OS.java.This PR replaces 8 deprecated
NSButtonCell.hconstants (deprecated since macOS 10.0–10.14) with their modern equivalents across the SWT Cocoa implementation.Button Types (
NSButtonType)NSMomentaryLightButtonNSButtonTypeMomentaryLightNSPushOnPushOffButtonNSButtonTypePushOnPushOffNSRadioButtonNSButtonTypeRadioNSSwitchButtonNSButtonTypeSwitchBezel Styles (
NSBezelStyle)NSRoundedBezelStyleNSBezelStylePushNSRegularSquareBezelStyleNSBezelStyleFlexiblePushNSShadowlessSquareBezelStyleNSBezelStyleSmallSquareNSRoundedDisclosureBezelStyleNSBezelStylePushDisclosureNote:
NSShadowlessSquareBezelStylewas first renamed toNSBezelStyleShadowlessSquare, which itself was subsequently deprecated in favour ofNSBezelStyleSmallSquare. This PR goes directly to the current non-deprecated name.Changed Files
OS.java— constant declarations replaced in-place, maintaining alphabetical orderingAppKitFull.bridgesupport— new enum entries added for the modern constant namesAppKitFull.bridgesupport.extras—swt_genmarkers updated to reference the new namesButton.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).