--- openide.util/apichanges.xml +++ openide.util/apichanges.xml @@ -51,6 +51,24 @@ Actions API + + + Platform dependent sound when invoking a disabled action. + + + + + +

+ Only some platforms provide an audible notification when user + tries to invoke a disabled action. So instead of Toolkit.beep() + which always plays a sound a new method + Utilities.disabledActionSound() shoud be used instead. +

+
+ + +
Try to lock a Mutex --- openide.util/manifest.mf +++ openide.util/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.util OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties -OpenIDE-Module-Specification-Version: 8.38 +OpenIDE-Module-Specification-Version: 8.39 --- openide.util/src/org/openide/util/Utilities.java +++ openide.util/src/org/openide/util/Utilities.java @@ -3215,6 +3215,20 @@ } } + /** + * On some platform this method makes a short audible beep, use it when user + * tries to invoke an action that's disabled. + * Some platforms, e.g. MS Windows do not emit any sound in such cases. + * @since 8.39 + */ + public static void disabledActionBeep() { + if( isWindows() ) { + //no sound on MS Windows + return; + } + Toolkit.getDefaultToolkit().beep(); + } + /** Interfaces for communication between Utilities.translate and regular * expression impl. *