use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method rightArrowWithMultipleLines.
@Test
public void rightArrowWithMultipleLines() {
setupMultiLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_RIGHT, 0), model);
assertEquals(TextLocation.at(0, 2), 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 downArrowMovesDownALineToTheLastCharacterIfTheFirstLineRunsPastTheSecond.
@Test
public void downArrowMovesDownALineToTheLastCharacterIfTheFirstLineRunsPastTheSecond() {
setupMultiLine("This is a longer\nMulti lined.").withCaretAt(0, 15);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_DOWN, 0), model);
assertEquals(model.getEndLocation(), 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 altRightArrowMovesToStartOfNextWordWithSelection.
@Test
public void altRightArrowMovesToStartOfNextWordWithSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_RIGHT, 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 upArrowDoesNothingWhenAllTheWayUp.
@Test
public void upArrowDoesNothingWhenAllTheWayUp() {
setupMultiLine("This is\nMulti lined.").withCaretAt(0, 3);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_UP, 0), model);
assertEquals(TextLocation.at(0, 3), 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 cmdDownArrowGoesToEndOfText.
@Test
public void cmdDownArrowGoesToEndOfText() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(CMD, KeyEvent.KEY_DOWN, 0), model);
assertEquals(model.getEndLocation(), model.getCaretLocation());
assertEquals(false, model.isSelectionActivated());
}
Aggregations