Search in sources :

Example 86 with KeyPressedEvent

use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.

the class TextInputKeyProcessorTest method shitUpArrowMovesUpALineWithSelectionWithMutlipleLines.

@Test
public void shitUpArrowMovesUpALineWithSelectionWithMutlipleLines() {
    setupMultiLine("This is\nMulti lined.").withCaretAt(1, 3).andSelectionAt(0, 4);
    processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_UP, 0), model);
    assertEquals(TextLocation.at(0, 3), model.getCaretLocation());
    assertEquals(TextLocation.at(0, 4), model.getSelectionLocation());
    assertEquals(true, model.isSelectionActivated());
}
Also used : KeyPressedEvent(limelight.ui.events.panel.KeyPressedEvent) Test(org.junit.Test)

Aggregations

KeyPressedEvent (limelight.ui.events.panel.KeyPressedEvent)86 Test (org.junit.Test)86 StringSelection (java.awt.datatransfer.StringSelection)2 KeyEvent (java.awt.event.KeyEvent)1