Examples of replaceText()


Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

    if (isEmptyElement(element)) {
      IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
      IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
      ITextRegionList regions = startStructuredDocumentRegion.getRegions();
      ITextRegion lastRegion = regions.get(regions.size() - 1);
      structuredDocument.replaceText(structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), lastRegion.getLength(), EMPTY_TAG_CLOSE);

      if (regions.size() > 1) {
        ITextRegion regionBeforeTagClose = regions.get(regions.size() - 1 - 1);

        // insert a space separator before tag close if the previous
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

        ITextRegion regionBeforeTagClose = regions.get(regions.size() - 1 - 1);

        // insert a space separator before tag close if the previous
        // region does not have extra spaces
        if (regionBeforeTagClose.getTextLength() == regionBeforeTagClose.getLength())
          structuredDocument.replaceText(structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), 0, " "); //$NON-NLS-1$
      }
    } else {
      String tagName = node.getNodeName();
      String endTag = END_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

        // if this node does not has children, insert the end tag
        // after the start tag
        endTagStartOffset = node.getEndOffset();

      IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
      structuredDocument.replaceText(structuredDocument, endTagStartOffset, 0, endTag);
    }

    newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
    // new
    // node
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

    String startTag = START_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
    int startTagStartOffset = node.getStartOffset();

    IDOMModel structuredModel = node.getModel();
    IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
    structuredDocument.replaceText(structuredDocument, startTagStartOffset, 0, startTag);
    newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
    // new
    // node

    return newNode;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

            IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();

            // insert ">" after lastRegion of flatNode
            // as in "<a</a>" if flatNode is for start tag, or in
            // "<a></a" if flatNode is for end tag
            structuredDocument.replaceText(structuredDocument, flatNode.getTextEndOffset(lastRegion), 0, ">"); //$NON-NLS-1$
          }
        }
      }
    }
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

                // String(buffer, 0, nRead));
              }
            }
            // ignore read-only settings if reverting whole
            // document
            innerdocument.replaceText(this, 0, originalLengthToReplace, stringBuffer.toString(), true);
            model.setDirtyState(false);

          }
          catch (CoreException e) {
            Logger.logException(e);
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

          }
          else {
            stringBuffer.append(buffer, 0, nRead);
          }
        }
        innerdocument.replaceText(this, 0, originalLengthToReplace, stringBuffer.toString(), true);
      }
      catch (CoreException e) {
        Logger.logException(e);
      }
      catch (IOException e) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

                // String(buffer, 0, nRead));
              }
            }
            // ignore read-only settings if reverting whole
            // document
            innerdocument.replaceText(this, 0,
                originalLengthToReplace,
                stringBuffer.toString(), true);
            model.setDirtyState(false);

          } catch (CoreException e) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

            eof = true;
          } else {
            stringBuffer.append(buffer, 0, nRead);
          }
        }
        innerdocument.replaceText(this, 0, originalLengthToReplace,
            stringBuffer.toString(), true);
      } catch (CoreException e) {
        Logger.logException(e);
      } catch (IOException e) {
        Logger.logException(e);
View Full Code Here

Examples of org.fxmisc.richtext.CodeArea.replaceText()

        codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea, format, stylesheet));
        codeArea.textProperty().addListener((obs, oldText, newText) -> {
            codeArea.setStyleSpans(0, computeHighlighting(newText));
        });
        codeArea.replaceText(0, 0, sampleCode);

        Scene scene = new Scene(new StackPane(codeArea), 600, 400);
        scene.getStylesheets().add(stylesheet);
        primaryStage.setScene(scene);
        primaryStage.setTitle("Java Keywords Demo");
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.