Keyboard.Modifier commandModifier = Platform.getCommandModifier();
if (document != null) {
if (keyCode == Keyboard.KeyCode.ENTER
&& textPane.isEditable()) {
textPane.insertParagraph();
consumed = true;
} else if (keyCode == Keyboard.KeyCode.DELETE
&& textPane.isEditable()) {
textPane.delete(false);