Package limelight.ui.events.panel

Examples of limelight.ui.events.panel.KeyPressedEvent


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

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

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


  @Test
  public void altRightArrowMovesToStartOfNextWordWithSelection()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);

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

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

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

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

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

  @Test
  public void altUpArrowMovesToStartOfLineWithSelection()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);

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

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

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

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

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

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

    processor.processKey(new KeyPressedEvent(ALT + CMD, KeyEvent.KEY_RIGHT, 0), model);

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

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

    processor.processKey(new KeyPressedEvent(ALT + CMD, KeyEvent.KEY_A, 0), model);

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

  @Test
  public void altCmdCharacterAndDoNothingWithSelection()
  {
    setupSingleLine("Here are four words").withCaretAt(0, 1).andSelectionAt(0, 4);

    processor.processKey(new KeyPressedEvent(ALT + CMD, KeyEvent.KEY_A, 0), model);

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

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

    processor.processKey(new KeyPressedEvent(ALT + SHIFT + CMD, KeyEvent.KEY_RIGHT, 0), model);

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

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

    processor.processKey(new KeyPressedEvent(ALT + SHIFT + CMD, KeyEvent.KEY_A, 0), model);

    assertEquals(TextLocation.at(0, 1), model.getCaretLocation());
    assertEquals(false, 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.