Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.TextSelection


    JavaEditor editor = closeAndOpenEditor();

    // Set the editor to select the package declaration:
    int offset = getDocument(editor).get().indexOf(pkg.getElementName());
    int len = pkg.getElementName().length();
    editor.getSelectionProvider().setSelection(new TextSelection(offset, len));

    // Run the tracker to capture the event:
    long preStart = System.currentTimeMillis();
    tracker.setEnabled(true);
    long postStart = System.currentTimeMillis();
View Full Code Here


    JavaEditor editor = closeAndOpenEditor();

    // Set the editor to select the package declaration:
    int offset = getDocument(editor).get().indexOf(pkg.getElementName());
    int len = pkg.getElementName().length();
    editor.getSelectionProvider().setSelection(new TextSelection(offset, len));

    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    try {
      // Now run the tracker to capture the event:
      long preStart = System.currentTimeMillis();
View Full Code Here

        textEditor.setHighlightRange(fDestRegion.getOffset(), fDestRegion.getLength(), true);

        if (!sameHighlightRange)
          // mark the location in navigation history
          textEditor.getSelectionProvider().setSelection(new TextSelection(fDestRegion.getOffset(), 0));
      } catch (IllegalArgumentException x) {
        textEditor.resetHighlightRange();
      }
    }
  }
View Full Code Here

            // get designated document
            IDocumentProvider documentProvider = javaEditor.getDocumentProvider();
            IDocument document = documentProvider.getDocument(javaEditor.getEditorInput());

            // change selection
            final ISelection selection = new TextSelection(document, start - 1, end - start + 1);
            final IWorkbench workbench = PlatformUI.getWorkbench();
            Display display = workbench.getDisplay();
            display.syncExec(new Runnable() {
                public void run() {
                    selectionProvider.setSelection(selection);
View Full Code Here

        MaudeEditor maudeEditor= (MaudeEditor)editor;
        IDocument documento=maudeEditor.getDocumentProvider().getDocument(maudeEditor.getEditorInput());
     
        int offSet=documento.getLineOffset(numLinea-1);
               
        TextSelection seleccion = new TextSelection(offSet,0);
             
        maudeEditor.getSelectionProvider().setSelection(seleccion);
       
      }
   
View Full Code Here

   
    //selecciona el n�mero de l�nea que se encuentra con error en el documento.
    scriptTextViewer.addPostSelectionChangedListener(new ISelectionChangedListener(){

      public void selectionChanged(SelectionChangedEvent event) {
        TextSelection selec= (TextSelection)event.getSelection();
       
       
        int numLinea=0;
        try{
          numLinea=Integer.parseInt(selec.getText());
          numLinea--;
       
          IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
          if(editor instanceof MaudeEditor){
            MaudeEditor maudeEditor= (MaudeEditor)editor;
            IDocument documento=maudeEditor.getDocumentProvider().getDocument(maudeEditor.getEditorInput());
         
            int offSet=documento.getLineOffset(numLinea);
                   
            TextSelection seleccion = new TextSelection(offSet,documento.getLineLength(numLinea));
                 
            maudeEditor.getSelectionProvider().setSelection(seleccion);
           
          }
       
View Full Code Here

    return result;
  }

  @Override
  public void createSelection(int start, int end) {
    editor.getEditorSite().getSelectionProvider().setSelection(new TextSelection(start, end - start));
  }
View Full Code Here

  public FormEntryAdapter() {
  }

  public void focusGained(FormEntry entry) {
    ITextSelection selection = new TextSelection(1, 1);
  }
View Full Code Here

   */
  public void linkActivated(HyperlinkEvent e) {
  }

  public void selectionChanged(FormEntry entry) {
    ITextSelection selection = new TextSelection(1, 1);
  }
View Full Code Here

      try {
        IJavaElementDelta[] affectedChildren = delta.getAffectedChildren();
        if (affectedChildren.length == 1 &&
                affectedChildren[0].getElement() instanceof IImportContainer) {
          IJavaElement elem = SelectionConverter.getElementAtOffset(ast.getTypeRoot(),
                  new TextSelection(selectedRange.x, selectedRange.y));
          if (!(elem instanceof IImportDeclaration))
            return false;

        }
      } catch (JavaModelException e) {
View Full Code Here

TOP

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

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.