use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method cmdUpArrowGoesToStartOfText.
@Test
public void cmdUpArrowGoesToStartOfText() {
setupSingleLine("Here are four words").withCaretAt(0, 5);
processor.processKey(new KeyPressedEvent(CMD, KeyEvent.KEY_UP, 0), model);
assertEquals(TextLocation.origin, model.getCaretLocation());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method altLeftArrowMovesToEndOfPreviousWord.
@Test
public void altLeftArrowMovesToEndOfPreviousWord() {
setupSingleLine("Here are four words").withCaretAt(0, 9).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_LEFT, 0), model);
assertEquals(TextLocation.at(0, 5), model.getCaretLocation());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method shiftCmdDownArrowSelectsToEndOfTextMultipleLinesWithSelectionOn.
@Test
public void shiftCmdDownArrowSelectsToEndOfTextMultipleLinesWithSelectionOn() {
setupMultiLine("Here are\nfour words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(SHIFT + CMD, KeyEvent.KEY_DOWN, 0), model);
assertEquals(model.getEndLocation(), model.getCaretLocation());
assertEquals(TextLocation.at(0, 4), model.getSelectionLocation());
assertEquals(true, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method altShiftRightArrowSelectsToTheNextWord.
@Test
public void altShiftRightArrowSelectsToTheNextWord() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(ALT + SHIFT, KeyEvent.KEY_RIGHT, 0), model);
assertEquals(TextLocation.at(0, 5), 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 cmdASelectsAll.
@Test
public void cmdASelectsAll() {
setupSingleLine("Bob");
processor.processKey(new KeyPressedEvent(CMD, KeyEvent.KEY_A, 0), model);
assertEquals(TextLocation.at(0, 3), model.getCaretLocation());
assertEquals(TextLocation.origin, model.getSelectionLocation());
assertEquals(true, model.isSelectionActivated());
}
Aggregations