use of limelight.ui.events.panel.KeyPressedEvent in project limelight by slagyr.
the class TextInputKeyProcessorTest method downArrowDoesNothingWhenAtBottom.
@Test
public void downArrowDoesNothingWhenAtBottom() {
setupMultiLine("This is\nMulti lined.").withCaretAt(1, 3);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_DOWN, 0), model);
assertEquals(TextLocation.at(1, 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 deleteDeletesSelection.
@Test
public void deleteDeletesSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_DELETE, 0), model);
assertEquals(TextLocation.at(0, 1), model.getCaretLocation());
assertEquals("H 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 downArrowMovesDownALine.
@Test
public void downArrowMovesDownALine() {
setupMultiLine("This is\nMulti lined.").withCaretAt(1, 3);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_DOWN, 0), model);
assertEquals(TextLocation.at(1, 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 downArrowWithMultipleLinesAndSelection.
@Test
public void downArrowWithMultipleLinesAndSelection() {
setupMultiLine("This is\nMulti lined.").withCaretAt(0, 3).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_DOWN, 0), model);
assertEquals(TextLocation.at(1, 3), 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 downArrowWithSelection.
@Test
public void downArrowWithSelection() {
setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_DOWN, 0), model);
assertEquals(model.getEndLocation(), model.getCaretLocation());
assertEquals(false, model.isSelectionActivated());
}
Aggregations