use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method backSpaceWithMultipleLines.
@Test
public void backSpaceWithMultipleLines() {
setupMultiLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_BACK_SPACE, 0), model);
assertEquals(TextLocation.origin, model.getCaretLocation());
assertEquals("ere are four words", model.getText());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method shiftCmdRightArrowSelectsToTheRightEdge.
@Test
public void shiftCmdRightArrowSelectsToTheRightEdge() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(SHIFT + CMD, KeyEvent.KEY_RIGHT, 0), model);
assertEquals(model.getEndLocation(), 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 cmdRightArrowGoesToEndOfLine.
@Test
public void cmdRightArrowGoesToEndOfLine() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(CMD, KeyEvent.KEY_RIGHT, 0), model);
assertEquals(model.getEndLocation(), model.getCaretLocation());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method backSpace.
@Test
public void backSpace() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_BACK_SPACE, 0), model);
assertEquals(TextLocation.origin, model.getCaretLocation());
assertEquals("ere are four words", model.getText());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method shiftCmdLeftArrowSelectsToTheLeftEdgeWithSelectionOn.
@Test
public void shiftCmdLeftArrowSelectsToTheLeftEdgeWithSelectionOn() {
setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(SHIFT + CMD, KeyEvent.KEY_LEFT, 0), model);
assertEquals(TextLocation.origin, model.getCaretLocation());
assertEquals(TextLocation.at(0, 4), model.getSelectionLocation());
assertEquals(true, model.isSelectionActivated());
}
Aggregations