Package org.rstudio.studio.client.workbench.views.console.shell.editor

Examples of org.rstudio.studio.client.workbench.views.console.shell.editor.InputEditorSelection


  
   void doReflowComment(String commentPrefix, boolean multiParagraphIndent)
   {
      docDisplay_.focus();

      InputEditorSelection originalSelection = docDisplay_.getSelection();
      InputEditorSelection selection = originalSelection;

      if (selection.isEmpty())
      {
         selection = selection.growToIncludeLines("^\\s*" + commentPrefix + ".*$");
      }
      else
      {
         selection = selection.shrinkToNonEmptyLines();
         selection = selection.extendToLineStart();
         selection = selection.extendToLineEnd();
      }
      if (selection.isEmpty())
         return;

      reflowComments(commentPrefix,
                     multiParagraphIndent,
                     selection,
View Full Code Here


   }
  
   @Override
   public Position search(Position startPos, String regex)
   {
      InputEditorSelection sel = docDisplay_.search(regex,
                                                    false,
                                                    false,
                                                    false,
                                                    false,
                                                    startPos,
                                                    null,
                                                    true);
      if (sel != null)
         return docDisplay_.selectionToPosition(sel.getStart());
      else
         return null;
   }
View Full Code Here

            return string;
      }
     
      private void applyValueRmdOption(final String value)
      {
         input_.setSelection(new InputEditorSelection(
               selection_.getStart().movePosition(-token_.length(), true),
               input_.getSelection().getEnd()));

         input_.replaceSelection(value, true);
         token_ = value;
View Full Code Here

          * logic works the second time, we need to reset the
          * selection.
          */

         // Move range to beginning of token
         input_.setSelection(new InputEditorSelection(
               selection_.getStart().movePosition(-token_.length(), true),
               input_.getSelection().getEnd()));

         if (insertParen && !overrideInsertParens_ && !textFollowingCursorHasOpenParen)
         {
            // Don't replace the selection if the token ends with a ')'
            // (implies an earlier replacement handled this)
            if (token_.endsWith("("))
            {
               input_.setSelection(new InputEditorSelection(
                     input_.getSelection().getEnd(),
                     input_.getSelection().getEnd()));
            }
            else
            {
               input_.replaceSelection(value + "()", true);
               InputEditorSelection newSelection = new InputEditorSelection(
                     input_.getSelection().getEnd().movePosition(-1, true));
               token_ = value + "(";
               selection_ = new InputEditorSelection(
                     input_.getSelection().getStart().movePosition(-2, true),
                     newSelection.getStart());

               input_.setSelection(newSelection);
            }
         }
         else
View Full Code Here

TOP

Related Classes of org.rstudio.studio.client.workbench.views.console.shell.editor.InputEditorSelection

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.