Search in sources :

Example 1 with ShowUIDefaultsAction

use of com.intellij.ui.ShowUIDefaultsAction in project intellij-community by JetBrains.

the class DarculaTest method main.

public static void main(String[] args) {
    try {
        UIManager.setLookAndFeel(new DarculaLaf());
    } catch (UnsupportedLookAndFeelException ignored) {
    }
    final JFrame frame = new JFrame("Darcula Demo");
    frame.setSize(900, 500);
    final DarculaTest form = new DarculaTest();
    final JPanel root = form.myRoot;
    frame.setContentPane(root);
    frame.getRootPane().setDefaultButton(form.myDefaultButton);
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {

        @Override
        public void eventDispatched(AWTEvent event) {
            if (event instanceof KeyEvent && event.getID() == KeyEvent.KEY_PRESSED && ((KeyEvent) event).getKeyCode() == KeyEvent.VK_F1) {
                new ShowUIDefaultsAction().actionPerformed(null);
            }
        }
    }, AWTEvent.KEY_EVENT_MASK);
    SwingUtilities.invokeLater(() -> frame.setVisible(true));
}
Also used : DarculaLaf(com.intellij.ide.ui.laf.darcula.DarculaLaf) KeyEvent(java.awt.event.KeyEvent) ShowUIDefaultsAction(com.intellij.ui.ShowUIDefaultsAction) AWTEventListener(java.awt.event.AWTEventListener)

Aggregations

DarculaLaf (com.intellij.ide.ui.laf.darcula.DarculaLaf)1 ShowUIDefaultsAction (com.intellij.ui.ShowUIDefaultsAction)1 AWTEventListener (java.awt.event.AWTEventListener)1 KeyEvent (java.awt.event.KeyEvent)1