Package limelight.ui.events.panel

Examples of limelight.ui.events.panel.KeyPressedEvent


  @Test
  public void upArrowWithSelection()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
    processor.processKey(new KeyPressedEvent(NO_MODIFIERS, KeyEvent.KEY_UP, 0), model);

    assertEquals(TextLocation.origin, model.getCaretLocation());
    assertEquals(false, model.isSelectionActivated());
  }
View Full Code Here


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

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

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

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

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

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

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

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

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

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

  @Test
  public void shiftLeftArrowWithSelection()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);
    processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_LEFT, 0), model);

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

  @Test
  public void shiftUpArrowBeginsSelection()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1);
    processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_UP, 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 shiftDownArrowBeginsSelection()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1);
    processor.processKey(new KeyPressedEvent(SHIFT, KeyEvent.KEY_DOWN, 0), model);

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

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

    assertEquals(TextLocation.at(0, 2), model.getCaretLocation());
    assertEquals(TextLocation.at(0, 1), model.getSelectionLocation());
    assertEquals(true, model.isSelectionActivated());
  }
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.