Examples of TextSelection


Examples of org.eclipse.jface.text.TextSelection

                        final ISelectionChangedListener listener) {
                }

                @Override
                public ISelection getSelection() {
                    return new TextSelection(document, offset, 0);
                }

                @Override
                public void addSelectionChangedListener(
                        final ISelectionChangedListener listener) {
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

            }
          }
        }

        if (targetOffset >= 0) {
          getTextEditor().getSelectionProvider().setSelection(new TextSelection(targetOffset, 0));
        }
      }
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

  {
    if (isel instanceof TextSelection)
    {
      try
      {
        TextSelection   selection = (TextSelection)isel;
        ISourceRange   sourceRange = element.getSourceRange();
       
        if (sourceRange == null)
          return false;
       
        if ((sourceRange.getOffset() <= selection.getOffset()) &&
          (sourceRange.getOffset() + sourceRange.getLength() >= selection.getOffset() + selection.getLength()))
        {
          return true;
        }
      }
      catch (JavaModelException e)
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

    return fSite.getShell();
  }
 
  @Override
  public void run() {
    TextSelection sel = EditorUtils.getSelection(deeEditor);
    final int offset = sel.getOffset();
   
    new FindReferencesOperation(offset).executeAndHandle();
   
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

  public void run(IAction action) {
    IDocumentProvider dp = editor.getDocumentProvider();
    IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
    TextSelectionNavigationLocation navloc = (TextSelectionNavigationLocation) editor.createNavigationLocation();
    TextSelection selection=(TextSelection) editor.getSelectionProvider().getSelection();
    int line=selection.getStartLine();
    try {
      String text=document.get(document.getLineOffset(line),document.getLineLength(line));
      org.jbehave.plugin.eclipse.model.StoryLine storyLine = StoryLine.parseLine(text);
      if (storyLine!=null){
        findAndOpenClass(storyLine);
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

    if (delim != null && document.getLineLength(endLine) == delim.length())
      fAddDelimiter= true;
    else
      fAddDelimiter= false;

    return new TextSelection(document, low, high - low);
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

      return null;
    try {
      if (fCopy && skippedLineN == -1)
        skippedLineN= 0;
      IRegion line= document.getLineInformation(skippedLineN);
      return new TextSelection(document, line.getOffset(), line.getLength());
    } catch (BadLocationException e) {
      // only happens on concurrent modifications
      return null;
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

    // get selection
    Point p= viewer.getSelectedRange();
    if (p == null)
      return;

    ITextSelection sel= new TextSelection(document, p.x, p.y);

    ITextSelection skippedLine= getSkippedLine(document, sel);
    if (skippedLine == null)
      return;
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

      ISelectionProvider provider= editor.getEditorSite().getSelectionProvider();
      if (provider == null)
        return;

      provider.setSelection(new TextSelection(pos.offset, pos.length));
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

   
    Integer length= memento.getInteger(TAG_SELECTION_LENGTH);
    if (length == null)
      return;
   
    doSetSelection(new TextSelection(offset.intValue(), length.intValue()));
   
    // XXX: https://bugs.eclipse.org/bugs/show_bug.cgi?id=168524
    Integer horizontalPixel= memento.getInteger(TAG_SELECTION_HPIXEL);
    if (horizontalPixel == null)
      return;
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.