Examples of addPositionCategory()


Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

 
  @Test
  public void testFile7() {
   
    IDocument doc = FileToDocUtility.getDocument(System.getProperty("user.dir") + "/resources/testfiles/test7.json");
    doc.addPositionCategory(JSON_ELEMENTS);
    JsonTextOutlineParser jtop = new JsonTextOutlineParser(doc);
   
    JsonElement top = (JsonElement) jtop.parse();
   
    Assert.assertEquals(2, top.getChildren().size());
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

 
  @Test
  public void testFile8() {
   
    IDocument doc = FileToDocUtility.getDocument(System.getProperty("user.dir") + "/resources/testfiles/test8.json");
    doc.addPositionCategory(JSON_ELEMENTS);
    JsonTextOutlineParser jtop = new JsonTextOutlineParser(doc);
   
    JsonElement top = (JsonElement) jtop.parse();
   
    Assert.assertEquals(2, top.getChildren().size());
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

 
  @Test
  public void testFile9() {
   
    IDocument doc = FileToDocUtility.getDocument(System.getProperty("user.dir") + "/resources/testfiles/test9.json");
    doc.addPositionCategory(JSON_ELEMENTS);
    JsonTextOutlineParser jtop = new JsonTextOutlineParser(doc);
   
    JsonElement top = (JsonElement) jtop.parse();
   
    Assert.assertEquals(4, top.getChildren().size());
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

    rootObject = null;
   
    if (newInput != null) {
      IDocument document = fDocumentProvider.getDocument(newInput);
      if (document != null) {
        document.addPositionCategory(JSON_ELEMENTS);
        document.addPositionUpdater(fPositionUpdater);

        parse(document);
      }
    }
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

      fContent.clear();

      if (newInput != null) {
        IDocument document = fDocumentProvider.getDocument(newInput);
        if (document != null) {
          document.addPositionCategory(SEGMENTS);
          document.addPositionUpdater(fPositionUpdater);

          parse(document);
        }
      }
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

    final IDocument document= getDocument();

    if (fSelections.isEmpty()) {
      fSelectionCategory= _SELECTION_POSITION_CATEGORY + hashCode();
      fSelectionUpdater= new NonDeletingPositionUpdater(fSelectionCategory);
      document.addPositionCategory(fSelectionCategory);
      document.addPositionUpdater(fSelectionUpdater);
    }

    try {
      final Position position;
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

    return new DefaultTextEntityRenderer();
  }
 
  private IDocument createDocument(String headerText, String bodyText, ITextEntityRenderer renderer) {
    final IDocument document = createEmptyDocument(renderer);
    document.addPositionCategory(HttpMessageDocument.SECTION_POSITION_CATEGORY);
    document.addPositionUpdater(new DefaultPositionUpdater(HttpMessageDocument.SECTION_POSITION_CATEGORY));
   
    if(bodyText != null && !bodyText.isEmpty()) {
      document.set(headerText + bodyText);
      addSectionPosition(document, 0, headerText.length());
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

            level.fOffset = offset;
            level.fLength = 2;

            // set up position tracking for our magic peers
            if (fBracketLevelStack.size() == 1) {
                document.addPositionCategory(CATEGORY);
                document.addPositionUpdater(fUpdater);
            }
            level.fFirstPosition = new Position(offset, 1);
            level.fSecondPosition = new Position(offset + 1, 1);
            document.addPosition(CATEGORY, level.fFirstPosition);
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.addPositionCategory()

    final IDocument document= getDocument();

    if (fSelections.isEmpty()) {
      fSelectionCategory= _SELECTION_POSITION_CATEGORY + hashCode();
      fSelectionUpdater= new NonDeletingPositionUpdater(fSelectionCategory);
      document.addPositionCategory(fSelectionCategory);
      document.addPositionUpdater(fSelectionUpdater);
    }

    try {
      final Position position;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.