use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method shiftCmdUpArrowSelectsToStartOfText.
@Test
public void shiftCmdUpArrowSelectsToStartOfText() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(SHIFT + CMD, KeyEvent.KEY_UP, 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 rightArrow.
@Test
public void rightArrow() {
setupSingleLine("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(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method rightArrowWithSelection.
@Test
public void rightArrowWithSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_RIGHT, 0), model);
assertEquals(TextLocation.at(0, 4), model.getCaretLocation());
assertEquals(false, model.isSelectionActivated());
}
use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method leftArrowWithMultipleLines.
@Test
public void leftArrowWithMultipleLines() {
setupMultiLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_LEFT, 0), model);
assertEquals(TextLocation.origin, 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 delete.
@Test
public void delete() {
setupSingleLine("Here are four words").withCaretAt(0, 1);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_DELETE, 0), model);
assertEquals(TextLocation.at(0, 1), model.getCaretLocation());
assertEquals("Hre are four words", model.getText());
assertEquals(false, model.isSelectionActivated());
}
Aggregations