use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method altCmdRightArrowDoesNothing.
@Test
public void altCmdRightArrowDoesNothing() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(ALT + CMD, KeyEvent.KEY_RIGHT, 0), model);
assertEquals(TextLocation.at(0, 1), model.getCaretLocation());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method altShiftLeftArrowSelectsToThePreviousWord.
@Test
public void altShiftLeftArrowSelectsToThePreviousWord() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
model.setCaretLocation(TextLocation.at(0, 9));
processor.processKey(new KeyPressedEvent(ALT + SHIFT, KeyEvent.KEY_LEFT, 0), model);
assertEquals(TextLocation.at(0, 5), model.getCaretLocation());
assertEquals(TextLocation.at(0, 9), model.getSelectionLocation());
assertEquals(true, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method shiftLeftArrowBeginsSelection.
@Test
public void shiftLeftArrowBeginsSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_LEFT, 0), model);
assertEquals(TextLocation.at(0, 0), 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 leftArrow.
@Test
public void leftArrow() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_LEFT, 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 cmdUpArrowJumpsToTheStartWithSelection.
@Test
public void cmdUpArrowJumpsToTheStartWithSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(CMD, KeyEvent.KEY_UP, 0), model);
assertEquals(TextLocation.origin, model.getCaretLocation());
assertEquals(TextLocation.at(0, 4), model.getSelectionLocation());
assertEquals(false, model.isSelectionActivated());
}
Aggregations