Examples of replaceTextRange()


Examples of org.eclipse.jface.text.IDocumentAdapter.replaceTextRange()

          IDocumentAdapter documentAdapter = textViewer
              .getDocumentAdapter();
          IDocument document = phpEditor.getDocument();
          String content = document.get();
          if (documentAdapter != null) {
            documentAdapter.replaceTextRange(0, content.length(),
                ""); //$NON-NLS-1$
            documentAdapter.replaceTextRange(0, 0, content);
          }

        }
View Full Code Here

Examples of org.eclipse.jface.text.IDocumentAdapter.replaceTextRange()

          IDocument document = phpEditor.getDocument();
          String content = document.get();
          if (documentAdapter != null) {
            documentAdapter.replaceTextRange(0, content.length(),
                ""); //$NON-NLS-1$
            documentAdapter.replaceTextRange(0, 0, content);
          }

        }
        if (!isDirty) {
          phpEditor.doSave(null);
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText.replaceTextRange()

      Position caret= new Position(insertionOffset, 0);
      document.addPosition(caret);
      st.setSelectionRange(widgetInsertionOffset, 0);

      // operate directly on the widget
      st.replaceTextRange(widgetInsertionOffset, 0, st.getLineDelimiter());

      // restore caret unless an auto-indenter has already moved the caret
      // then leave it alone
      document.removePosition(caret);
      if (updateCaret && st.getSelection().x == widgetInsertionOffset) {
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText.replaceTextRange()

            Point newSelection= st.getSelection();
            int length= fSelection.y - fSelection.x;
            int delta= 0;
            if (newSelection.x < fSelection.x)
              delta= length;
            st.replaceTextRange(fSelection.x + delta, length, ""); //$NON-NLS-1$
           
            if (fTextDragAndDropToken == null) {
              // Move in same editor - end compound change
              IRewriteTarget target= (IRewriteTarget)getAdapter(IRewriteTarget.class);
              if (target != null)
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText.replaceTextRange()

    {
      execRegion(0);
    }
    dst.append(analyzer.getSpace());

    widget.replaceTextRange(begin, end - begin, dst.toString());
  }
 
  private void execRegion(int level)
  {
    boolean isStart = true;
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText.replaceTextRange()

   
    //remove the comment field from the beginning of the line
    region = Pattern.compile("^"+commentString,Pattern.MULTILINE).matcher(region).replaceAll("");
   
    //replace the selection
    widget.replaceTextRange(begin, end - begin, region.toString());
  }
}


View Full Code Here

Examples of org.eclipse.swt.custom.StyledText.replaceTextRange()

   
    //some fancy foot work to replace the beginning of each line with the comment character
    region = Pattern.compile("^",Pattern.MULTILINE).matcher(region).replaceAll(commentString);
   
    //replace the selection
    widget.replaceTextRange(begin, end - begin, region.toString());
  }
}


View Full Code Here

Examples of org.eclipse.swt.custom.StyledText.replaceTextRange()

      selectedText=alignBefore(selectedText,new int[]{VhdlParserCoreTokenManager.COMMENT});
    }
   
   
    //replace the text
    widget.replaceTextRange(begin, end - begin, selectedText);
   
    //set caret and the part shown in the editor
    //mg
    if ( topLineIndex <= widget.getLineCount() ) {
      widget.setCaretOffset( widget.getOffsetAtLine( topLineIndex ) );
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText.replaceTextRange()

            Point newSelection= st.getSelection();
            int length= fSelection.y - fSelection.x;
            int delta= 0;
            if (newSelection.x < fSelection.x)
              delta= length;
            st.replaceTextRange(fSelection.x + delta, length, ""); //$NON-NLS-1$

            if (fTextDragAndDropToken == null) {
              // Move in same editor - end compound change
              IRewriteTarget target= (IRewriteTarget)getAdapter(IRewriteTarget.class);
              if (target != null)
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.