Search in sources :

Example 1 with DarculaEditorTextFieldBorder

use of com.intellij.ide.ui.laf.darcula.ui.DarculaEditorTextFieldBorder in project intellij-community by JetBrains.

the class EditorTextField method setupBorder.

protected void setupBorder(@NotNull EditorEx editor) {
    if (UIUtil.isUnderAquaLookAndFeel() || UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
        editor.setBorder(UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF() ? new DarculaEditorTextFieldBorder() : new MacUIUtil.EditorTextFieldBorder(this));
        editor.addFocusListener(new FocusChangeListener() {

            @Override
            public void focusGained(Editor editor) {
                repaint();
            }

            @Override
            public void focusLost(Editor editor) {
                repaint();
            }
        });
    } else if (UIUtil.isUnderAlloyLookAndFeel() || UIUtil.isUnderJGoodiesLookAndFeel()) {
        editor.setBorder(BorderFactory.createCompoundBorder(UIUtil.getTextFieldBorder(), BorderFactory.createEmptyBorder(1, 1, 1, 1)));
    } else {
        editor.setBorder(BorderFactory.createCompoundBorder(UIUtil.getTextFieldBorder(), BorderFactory.createEmptyBorder(2, 2, 2, 2)));
    }
}
Also used : DarculaEditorTextFieldBorder(com.intellij.ide.ui.laf.darcula.ui.DarculaEditorTextFieldBorder) DarculaEditorTextFieldBorder(com.intellij.ide.ui.laf.darcula.ui.DarculaEditorTextFieldBorder) FocusChangeListener(com.intellij.openapi.editor.ex.FocusChangeListener)

Aggregations

DarculaEditorTextFieldBorder (com.intellij.ide.ui.laf.darcula.ui.DarculaEditorTextFieldBorder)1 FocusChangeListener (com.intellij.openapi.editor.ex.FocusChangeListener)1