Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.DocumentCommand$CommandIterator


        while (line > 0 && (line2.startsWith("#") || line2.trim().length() == 0)) {
            line--;
            line2 = skippedPs.getLine(line);
        }

        DocumentCommand command = new DocCmd(skippedPs.getEndLineOffset(line), 0, "\n");
        indentStrategy.customizeDocumentCommand(document, command);
        return command.text.substring(1);
    }
View Full Code Here


                  document.set(data);

                  MainAutoEditStrategy indentLineAutoEditStrategy = new MainAutoEditStrategy();

                  DocumentCommand cmd = new DocumentCommand() {

                  };

                  cmd.offset = offset;
                  cmd.length = 0;
View Full Code Here

                  document.set(data);

                  MainAutoEditStrategy indentLineAutoEditStrategy = new MainAutoEditStrategy();

                  DocumentCommand cmd = new DocumentCommand() {

                  };

                  cmd.offset = offset;
                  cmd.length = 0;
View Full Code Here

                  document.set(data);

                  IAutoEditStrategy indentLineAutoEditStrategy = new MainAutoEditStrategy();

                  DocumentCommand cmd = new DocumentCommand() {

                  };

                  cmd.offset = offset;
                  cmd.length = 0;
View Full Code Here

    CodeFormatterConstants.FORMATTER_TAB_SIZE.set(4);
    CodeFormatterConstants.FORMATTER_INDENT_MODE.set(IndentMode.TAB.getPrefValue());
  }
 
  protected DocumentCommand createDocumentCommand(int start, int length, String text) {
    DocumentCommand documentCommand = new DocumentCommand() {};
    documentCommand.doit = true;
    documentCommand.text = text;
   
    documentCommand.offset = start;
    documentCommand.length = length;
View Full Code Here

  }
 
  protected void dotestEnterAutoEdit(String textBefore, String textAfter, String expectedInsert, int offsetDelta) {
    Document document = setupDocument(textBefore, textAfter);
    int keypressOffset = textBefore.length();
    DocumentCommand docCommand = createDocumentCommand(keypressOffset, 0, NL);
    getAutoEditStrategy().customizeDocumentCommand(document, docCommand);
    int caretOffset = (offsetDelta == -1) ? -1 : textBefore.length() + offsetDelta;
    int replaceLength = 0;
    checkCommand(docCommand, expectedInsert, keypressOffset, replaceLength, caretOffset);
  }
View Full Code Here

    String srcAfter3 = srcIndent.substring(nlSize, srcIndent.length()) + sourceAfter;
    testDeleteCommandWithNoEffect(srcPre3, srcAfter3);
  }
 
  protected void testDeleteDeindent(String srcPre, String srcIndent, String sourceAfter) {
    DocumentCommand delCommand = applyDelCommand(srcPre, srcIndent + sourceAfter);
    getAutoEditStrategy().customizeDocumentCommand(getDocument(), delCommand);
    checkCommand(delCommand, "", srcPre.length(), srcIndent.length());
  }
View Full Code Here

    getAutoEditStrategy().customizeDocumentCommand(getDocument(), delCommand);
    checkCommand(delCommand, "", srcPre.length(), srcIndent.length());
  }
 
  protected void testBackSpaceDeindent(String srcPre, String srcIndent, String sourceAfter) {
    DocumentCommand bsCommand = applyBackSpaceCommand(srcPre + srcIndent, sourceAfter);
    getAutoEditStrategy().customizeDocumentCommand(getDocument(), bsCommand);
    checkCommand(bsCommand, "", srcPre.length(), srcIndent.length());
  }
View Full Code Here

      length = (keypressOffset == lineLimit) ? getDocument().getLineDelimiter(line - 1).length() : 1;
    } catch (BadLocationException e) {
      throw melnorme.utilbox.core.ExceptionAdapter.unchecked(e);
    }
    getAutoEditStrategy().lastKeyEvent.character = SWT.BS;
    DocumentCommand docCommand = createDocumentCommand(keypressOffset - length, length, "");
    return docCommand;
  }
View Full Code Here

      length = (keypressOffset == lineEnd) ? getDocument().getLineDelimiter(line).length() : 1;
    } catch (BadLocationException e) {
      throw melnorme.utilbox.core.ExceptionAdapter.unchecked(e);
    }
    getAutoEditStrategy().lastKeyEvent.character = SWT.DEL;
    DocumentCommand docCommand = createDocumentCommand(keypressOffset, length, "");
    return docCommand;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.DocumentCommand$CommandIterator

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.