void (boolean enabled) { if (myMultilineEnabled == enabled) return; myMultilineEnabled = enabled; myTextArea.getDocument().putProperty("filterNewlines", myMultilineEnabled ? null : Boolean.TRUE); if (!myMultilineEnabled) { myTextArea.getInputMap().put(KeyStroke.getKeyStroke("shift UP"), "selection-begin-line"); myTextArea.getInputMap().put(KeyStroke.getKeyStroke("shift DOWN"), "selection-end-line"); myTextArea.addKeyListener(myEnterRedispatcher); } else { myTextArea.getInputMap().put(KeyStroke.getKeyStroke("shift UP"), "selection-up"); myTextArea.getInputMap().put(KeyStroke.getKeyStroke("shift DOWN"), "selection-down"); myTextArea.removeKeyListener(myEnterRedispatcher); } updateIconsLayout(); }