mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
Extras: use default activation keys if passing null to FlatInspector.install() or to FlatUIDefaultsInspector.install()
This commit is contained in:
@@ -125,9 +125,12 @@ public class FlatInspector
|
|||||||
* Installs a key listener into the application that allows enabling and disabling
|
* Installs a key listener into the application that allows enabling and disabling
|
||||||
* the UI inspector with the given keystroke (e.g. "ctrl shift alt X").
|
* the UI inspector with the given keystroke (e.g. "ctrl shift alt X").
|
||||||
*
|
*
|
||||||
* @param activationKeys a keystroke (e.g. "ctrl shift alt X")
|
* @param activationKeys a keystroke (e.g. "ctrl shift alt X"), or {@code null} to use "ctrl shift alt X"
|
||||||
*/
|
*/
|
||||||
public static void install( String activationKeys ) {
|
public static void install( String activationKeys ) {
|
||||||
|
if( activationKeys == null )
|
||||||
|
activationKeys = "ctrl shift alt X";
|
||||||
|
|
||||||
KeyStroke keyStroke = KeyStroke.getKeyStroke( activationKeys );
|
KeyStroke keyStroke = KeyStroke.getKeyStroke( activationKeys );
|
||||||
Toolkit.getDefaultToolkit().addAWTEventListener( e -> {
|
Toolkit.getDefaultToolkit().addAWTEventListener( e -> {
|
||||||
if( e.getID() == KeyEvent.KEY_RELEASED &&
|
if( e.getID() == KeyEvent.KEY_RELEASED &&
|
||||||
|
|||||||
@@ -85,9 +85,12 @@ public class FlatUIDefaultsInspector
|
|||||||
* Installs a key listener into the application that allows enabling and disabling
|
* Installs a key listener into the application that allows enabling and disabling
|
||||||
* the UI inspector with the given keystroke (e.g. "ctrl shift alt Y").
|
* the UI inspector with the given keystroke (e.g. "ctrl shift alt Y").
|
||||||
*
|
*
|
||||||
* @param activationKeys a keystroke (e.g. "ctrl shift alt Y")
|
* @param activationKeys a keystroke (e.g. "ctrl shift alt Y"), or {@code null} to use "ctrl shift alt Y"
|
||||||
*/
|
*/
|
||||||
public static void install( String activationKeys ) {
|
public static void install( String activationKeys ) {
|
||||||
|
if( activationKeys == null )
|
||||||
|
activationKeys = "ctrl shift alt Y";
|
||||||
|
|
||||||
KeyStroke keyStroke = KeyStroke.getKeyStroke( activationKeys );
|
KeyStroke keyStroke = KeyStroke.getKeyStroke( activationKeys );
|
||||||
Toolkit.getDefaultToolkit().addAWTEventListener( e -> {
|
Toolkit.getDefaultToolkit().addAWTEventListener( e -> {
|
||||||
if( e.getID() == KeyEvent.KEY_RELEASED &&
|
if( e.getID() == KeyEvent.KEY_RELEASED &&
|
||||||
|
|||||||
Reference in New Issue
Block a user