Example usage for javafx.scene.input KeyCode TAB

List of usage examples for javafx.scene.input KeyCode TAB

Introduction

In this page you can find the example usage for javafx.scene.input KeyCode TAB.

Prototype

KeyCode TAB

To view the source code for javafx.scene.input KeyCode TAB.

Click Source Link

Document

Constant for the Tab key.

Usage

From source file:org.beryx.viewreka.fxapp.codearea.SimpleCodeArea.java

public SimpleCodeArea(String text) {
    super(text);/*  w  ww  . jav a  2s .  co  m*/

    putStyleGroup("KEYWORD", "keyword", NEVER_MATCHING);
    putStyleGroup("PAREN", "paren", PAREN_PATTERN);
    putStyleGroup("BRACE", "brace", BRACE_PATTERN);
    putStyleGroup("BRACKET", "bracket", BRACKET_PATTERN);
    putStyleGroup("SEMICOLON", "semicolon", SEMICOLON_PATTERN);
    putStyleGroup("STRING", "string", STRING_PATTERN);
    putStyleGroup("STRING2", "string", STRING2_PATTERN);
    putStyleGroup("COMMENT", "comment", COMMENT_PATTERN);

    String cssName = SimpleCodeArea.class.getSimpleName() + ".css";
    getStylesheets().add(SimpleCodeArea.class.getResource(cssName).toExternalForm());

    setParagraphGraphicFactory(LineNumberFactory.get(this));
    richChanges().subscribe(change -> {
        setStyleSpans(0, computeHighlighting(getText()));
    });
    EventHandler<? super KeyEvent> tabHandler = EventHandlerHelper.on(EventPattern.keyPressed(KeyCode.ENTER))
            .act(event -> applyEnter()).on(EventPattern.keyPressed(KeyCode.TAB)).act(event -> applyTab())
            .on(EventPattern.keyPressed(KeyCode.TAB, KeyCombination.SHIFT_DOWN)).act(event -> applyShiftTab())
            .create();
    EventHandlerHelper.install(onKeyPressedProperty(), tabHandler);
}

From source file:org.pdfsam.ui.selection.single.SingleSelectionPaneTest.java

private void typePathAndValidate(String path) throws Exception {
    ValidableTextField field = find(".validable-container-field");
    // TODO replace with typing when slash works
    FXTestUtils.invokeAndWait(() -> field.setText(path), 2);
    click(field).type(KeyCode.TAB);
}