Ejemplo n.º 1
0
  /* (non-Javadoc)
   * @see jexi.core.command.Command#execute()
   */
  public boolean execute() {
    Paragraph p = document.getCaret().getPargraph();
    Paragraph p2 = p.split(document.getCaret().getInsertIndex());
    document.addParagraph(document.getParagraphIndex(p) + 1, p2);
    p.debug();
    p2.debug();

    // then compose:
    this.document.compose();
    document.getCaret().moveRight();
    document.updateCaret();

    return true;
  }
Ejemplo n.º 2
0
 /**
  * Create a break command.
  *
  * @param document The document.
  */
 public SplitCommand(Document document) {
   this.document = document;
   this.position = document.getCaret().getPosition();
 }