| | import static javafx.event.Event.fireEvent; |
| | import static javafx.scene.input.KeyCode.ENTER; |
| | -import static javafx.scene.input.KeyCode.TAB; |
| | import static javafx.stage.WindowEvent.WINDOW_CLOSE_REQUEST; |
| | import static org.fxmisc.richtext.model.TwoDimensional.Bias.Forward; |
 |
| | rerender(); |
| | }; |
| | - |
| | - /** |
| | - * Called to switch to the definition pane when the user presses the TAB key. |
| | - */ |
| | - private final EventHandler<? super KeyEvent> mTabKeyHandler = |
| | - (EventHandler<KeyEvent>) event -> { |
| | - if( event.getCode() == TAB ) { |
| | - getDefinitionPane().requestFocus(); |
| | - event.consume(); |
| | - } |
| | - }; |
| | |
| | /** |
 |
| | |
| | initTextChangeListener( tab ); |
| | - initTabKeyEventListener( tab ); |
| | initScrollEventListener( tab ); |
| | initSpellCheckListener( tab ); |
 |
| | } |
| | ); |
| | - } |
| | - |
| | - /** |
| | - * Ensure that the keyboard events are received when a new tab is added |
| | - * to the user interface. |
| | - * |
| | - * @param tab The tab editor that can trigger keyboard events. |
| | - */ |
| | - private void initTabKeyEventListener( final FileEditorTab tab ) { |
| | - tab.addEventFilter( KeyEvent.KEY_PRESSED, mTabKeyHandler ); |
| | } |
| | |