[Cocoa] Replace deprecated macOS Alert Style and Event Modifier Flag constants#3453
Merged
HeikoKlare merged 1 commit intoJul 21, 2026
Conversation
The macOS AppKit framework deprecated the old-style NSAlert alert style constants in macOS 10.12 (Sierra) in favour of the NSAlertStyle enum, and the old-style NSEvent modifier flag constants in macOS 10.12 in favour of the NSEventModifierFlags option set type. This change replaces all seven deprecated constants throughout the SWT macOS/Cocoa implementation with their modern equivalents, eliminating compiler deprecation warnings and improving forward compatibility with future macOS SDK versions. Replaced constants (values are unchanged): NSWarningAlertStyle -> NSAlertStyleWarning (0) NSInformationalAlertStyle -> NSAlertStyleInformational (1) NSCriticalAlertStyle -> NSAlertStyleCritical (2) NSShiftKeyMask -> NSEventModifierFlagShift (131072) NSControlKeyMask -> NSEventModifierFlagControl (262144) NSCommandKeyMask -> NSEventModifierFlagCommand (1048576) NSHelpKeyMask -> NSEventModifierFlagHelp (4194304) Contributes to eclipse-platform#3214
Contributor
HeikoKlare
marked this pull request as ready for review
July 20, 2026 19:01
HeikoKlare
deleted the
replace-deprecated-alert-style-event-modifier-constants
branch
July 21, 2026 12:17
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.
The macOS AppKit framework deprecated the old-style
NSAlertalert style constants in macOS 10.12 (Sierra) in favour of theNSAlertStyleenum, and the old-styleNSEventmodifier flag constants in macOS 10.12 in favour of theNSEventModifierFlagsoption set type. This change replaces all seven deprecated constants throughout the SWT macOS/Cocoa implementation with their modern equivalents, eliminating compiler deprecation warnings and improving forward compatibility with future macOS SDK versions.Replaced constants (values are unchanged):
NSWarningAlertStyleNSAlertStyleWarning(0)NSInformationalAlertStyleNSAlertStyleInformational(1)NSCriticalAlertStyleNSAlertStyleCritical(2)NSShiftKeyMaskNSEventModifierFlagShift(131072)NSControlKeyMaskNSEventModifierFlagControl(262144)NSCommandKeyMaskNSEventModifierFlagCommand(1048576)NSHelpKeyMaskNSEventModifierFlagHelp(4194304)The new entries in
AppKitFull.bridgesupportwere taken from a bridgesupport file generated against the macOS 26 SDK with a minimum deployment target of macOS 11, and the corresponding update toOS.javawas generated using the MacGenerator tool.Contributes to #3214