Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.DocumentRewriteSession


        {
          final Point selection= rememberSelection();
          final IRewriteTarget target= getRewriteTarget();
          final IDocument document= getDocument();
          IFormattingContext context= null;
          DocumentRewriteSession rewriteSession= null;

          if (document instanceof IDocumentExtension4) {
            IDocumentExtension4 extension= (IDocumentExtension4) document;
            DocumentRewriteSessionType type= (selection.y == 0 && document.getLength() > 1000) || selection.y > 1000
              ? DocumentRewriteSessionType.SEQUENTIAL
View Full Code Here


    private void doShiftLeft() {
        if (fUndoManager != null)
            fUndoManager.beginCompoundChange();

        IDocument d = getDocument();
        DocumentRewriteSession rewriteSession = null;
        try {
            if (d instanceof IDocumentExtension4) {
                IDocumentExtension4 extension = (IDocumentExtension4) d;
                rewriteSession = extension.startRewriteSession(DocumentRewriteSessionType.SEQUENTIAL);
            }
View Full Code Here

            throws BadLocationException, SyntaxErrorException {
        final IFormatter participant = getFormatter();
        final IDocument doc = ps.getDoc();
        final SelectionKeeper selectionKeeper = new SelectionKeeper(ps);

        DocumentRewriteSession session = null;
        try {

            if (regionsToFormat == null || regionsToFormat.length == 0) {
                if (doc instanceof IDocumentExtension4) {
                    IDocumentExtension4 ext = (IDocumentExtension4) doc;
View Full Code Here

            PyEdit pyEdit = getPyEdit();

            PySelection ps = new PySelection(pyEdit);
            String endLineDelim = ps.getEndLineDelim();
            final IDocument doc = ps.getDoc();
            DocumentRewriteSession session = null;

            try {
                if (ps.getStartLineIndex() == ps.getEndLineIndex()) {
                    //let's see if someone wants to make a better implementation in another plugin...
                    List<IOrganizeImports> participants = ExtensionHelper
View Full Code Here

        {
          final Point selection= rememberSelection();
          final IRewriteTarget target= getRewriteTarget();
          final IDocument document= getDocument();
          IFormattingContext context= null;
          DocumentRewriteSession rewriteSession= null;

          if (document instanceof IDocumentExtension4) {
            IDocumentExtension4 extension= (IDocumentExtension4) document;
            DocumentRewriteSessionType type= (selection.y == 0 && document.getLength() > 1000) || selection.y > 1000
              ? DocumentRewriteSessionType.SEQUENTIAL
View Full Code Here

    protected void processAction(final ITextEditor textEditor,
            final IStructuredDocument document, ITextSelection textSelection)
    {

        IStructuredModel model = null;
        DocumentRewriteSession session = null;
        boolean changed = false;

        try {
            // get text selection lines info
            int selectionStartLine = textSelection.getStartLine();
View Full Code Here

                if (s.contains(proposalReplacementString.trim())) {
                  proposal.setCursorPosition(shortened.length());
                  document.replace(proposal.getReplacementOffset(), proposal.getReplacementLength(), shortened);
                } else {
                  DocumentRewriteSession rewriteSession = null;
                  try {
                    if (document instanceof IDocumentExtension4) {
                      rewriteSession = ((IDocumentExtension4) document).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED_SMALL);
                    }
View Full Code Here

      ITextViewerExtension viewerExtension = null;
      if (viewer instanceof ITextViewerExtension) {
        viewerExtension = (ITextViewerExtension) viewer;
        viewerExtension.setRedraw(false);
      }
      DocumentRewriteSession rewriteSession = null;
      try {
        if (document instanceof IDocumentExtension4) {
          rewriteSession = ((IDocumentExtension4) document).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED_SMALL);
        }
        // compute import statement's offset
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.DocumentRewriteSession

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.