use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method cmdRightArrowGoesToEndOfLineWithMultipleText.
@Test
public void cmdRightArrowGoesToEndOfLineWithMultipleText() {
setupMultiLine("Here are\nfour words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(CMD, KeyEvent.KEY_RIGHT, 0), model);
assertEquals(TextLocation.at(0, 8), model.getCaretLocation());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method shiftRightArrowBeingsSelectionWithMultipleLines.
@Test
public void shiftRightArrowBeingsSelectionWithMultipleLines() {
setupMultiLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_RIGHT, 0), model);
assertEquals(TextLocation.at(0, 2), model.getCaretLocation());
assertEquals(TextLocation.at(0, 1), model.getSelectionLocation());
assertEquals(true, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method altLeftArrowJumpsToThePreviousWord.
@Test
public void altLeftArrowJumpsToThePreviousWord() {
setupSingleLine("Here are four words").withCaretAt(0, 9);
processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_LEFT, 0), model);
assertEquals(TextLocation.at(0, 5), model.getCaretLocation());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method altDownGoesToEndOfLine.
@Test
public void altDownGoesToEndOfLine() throws Exception {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_DOWN, 0), model);
assertEquals(model.getEndLocation(), model.getCaretLocation());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method backSpaceDeleteSelection.
@Test
public void backSpaceDeleteSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_BACK_SPACE, 0), model);
assertEquals(TextLocation.at(0, 1), model.getCaretLocation());
assertEquals("H are four words", model.getText());
assertEquals(false, model.isSelectionActivated());
}
Aggregations