use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method goToTheEndOfNextLineEvenIfItEndsWithNewline.
@Test
public void goToTheEndOfNextLineEvenIfItEndsWithNewline() throws Exception {
setupMultiLine("blah\nasdf\nasdf").withCaretAt(0, 4);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_DOWN, 0), model);
assertEquals(TextLocation.at(1, 4), model.getCaretLocation());
assertEquals(TextLocation.origin, model.getSelectionLocation());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method shiftLeftArrowBeginsSelectionWithMultipleLines.
@Test
public void shiftLeftArrowBeginsSelectionWithMultipleLines() {
setupMultiLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_LEFT, 0), model);
assertEquals(TextLocation.origin, 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 altUpGoesToBeginningOfLine.
@Test
public void altUpGoesToBeginningOfLine() throws Exception {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_UP, 0), model);
assertEquals(TextLocation.origin, model.getCaretLocation());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method cmdLeftArrowJumpsToLeftEdgeAndEndsSelection.
@Test
public void cmdLeftArrowJumpsToLeftEdgeAndEndsSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(CMD, KeyEvent.KEY_LEFT, 0), model);
assertEquals(TextLocation.origin, model.getCaretLocation());
assertEquals(TextLocation.at(0, 4), model.getSelectionLocation());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method shiftUpArrowBeginsSelection.
@Test
public void shiftUpArrowBeginsSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_UP, 0), model);
assertEquals(TextLocation.origin, model.getCaretLocation());
assertEquals(TextLocation.at(0, 1), model.getSelectionLocation());
assertEquals(true, model.isSelectionActivated());
}
Aggregations