Package limelight.ui.events.panel

Examples of limelight.ui.events.panel.KeyPressedEvent


  @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());
  }
View Full Code Here


  @Test
  public void shiftUpArrowMovesUpALineAndBeginsSelectionWithMultipleLines()
  {
    setupMultiLine("This is\nMulti lined.").withCaretAt(1, 3);

    processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_UP, 0), model);

    assertEquals(TextLocation.at(0, 3), model.getCaretLocation());
    assertEquals(TextLocation.at(1, 3), model.getSelectionLocation());
    assertEquals(true, model.isSelectionActivated());
  }
View Full Code Here

  @Test
  public void shiftDownArrowMovesDownALineAndBeginsSelectionWithMultipleLines()
  {
    setupMultiLine("This is\nMulti lined.").withCaretAt(0, 3);

    processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_DOWN, 0), model);

    assertEquals(TextLocation.at(1, 3), model.getCaretLocation());
    assertEquals(TextLocation.at(0, 3), model.getSelectionLocation());
    assertEquals(true, model.isSelectionActivated());
  }
View Full Code Here

  @Test
  public void shitUpArrowMovesUpALineWithSelectionWithMutlipleLines()
  {
    setupMultiLine("This is\nMulti lined.").withCaretAt(1, 3).andSelectionAt(0, 4);

    processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_UP, 0), model);

    assertEquals(TextLocation.at(0, 3), model.getCaretLocation());
    assertEquals(TextLocation.at(0, 4), model.getSelectionLocation());
    assertEquals(true, model.isSelectionActivated());
  }
View Full Code Here

  @Test
  public void shiftDownArrowMovesDownALineWithSelection()
  {
    setupMultiLine("This is\nMulti lined.").withCaretAt(0, 3).andSelectionAt(0, 4);

    processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_DOWN, 0), model);

    assertEquals(TextLocation.at(1, 3), model.getCaretLocation());
    assertEquals(TextLocation.at(0, 4), model.getSelectionLocation());
    assertEquals(true, model.isSelectionActivated());
  }
View Full Code Here

  @Test
  public void altRightArrowJumpsToTheNextWord()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1);
    processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_RIGHT, 0), model);

    assertEquals(TextLocation.at(0, 5), model.getCaretLocation());
  }
View Full Code Here

  @Test
  public void altLeftArrowJumpsToThePreviousWord()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 9);

    processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_LEFT, 0), model);

    assertEquals(TextLocation.at(0, 5), model.getCaretLocation());
  }
View Full Code Here

  @Test
  public void altDownGoesToEndOfLine() throws Exception
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1);

    processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_DOWN, 0), model);

    assertEquals(model.getEndLocation(), model.getCaretLocation());
  }
View Full Code Here

  @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());
  }
View Full Code Here

  @Test
  public void altDownGoesToEndOfLineWithMultipleLines() throws Exception
  {
    setupMultiLine("This is\nMulti lined.").withCaretAt(0, 3);

    processor.processKey(new KeyPressedEvent(ALT, KeyEvent.KEY_DOWN, 0), model);

    assertEquals(TextLocation.at(0, 7), model.getCaretLocation());
  }
View Full Code Here

TOP

Related Classes of limelight.ui.events.panel.KeyPressedEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.