Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.ITextEditor.selectAndReveal()


                        textEditor.selectAndReveal(offset + col[0] - 1, col[1] - col[0] + 1);
                      } else {
                        if (col[0] < lineLength) {
                          textEditor.selectAndReveal(offset + col[0] - 1, lineLength - col[0]);
                        } else {
                          textEditor.selectAndReveal(offset, lineLength);
                        }
                      }
                    } else {
                      textEditor.selectAndReveal(offset, lineLength);
                    }
View Full Code Here


                        } else {
                          textEditor.selectAndReveal(offset, lineLength);
                        }
                      }
                    } else {
                      textEditor.selectAndReveal(offset, lineLength);
                    }
                  }
                  catch (Throwable T) {
                    CFECallPlugin.log(T);
                  }
View Full Code Here

    try
    {
      IEditorPart iep = IDE.openEditor(page, file, true);
      ITextEditor ite = (ITextEditor)iep;
      //ite.setHighlightRange(start,end,true);
      ite.selectAndReveal(start,length);
      ite.setFocus();
     
    }
    catch (PartInitException e)
    {
View Full Code Here

      try  {
        IEditorPart iep = IDE.openEditor(page,CFCMethodsFile,true);
        //IEditorPart iep = this.getViewSite().getWorkbenchWindow().getActivePage().getActiveEditor();
       
        ITextEditor ite = (ITextEditor)iep;
        ite.selectAndReveal(selectedMethod.getDocumentOffset(),selectedMethod.getSize(ite));
        ite.setFocus();
      }
      catch (Exception e) {
          MessageBox msg = new MessageBox(page.getActivePart().getSite().getShell());
              msg.setText("Error!");
View Full Code Here

    try
    {
      IEditorPart iep = IDE.openEditor(page, file, true);
      ITextEditor ite = (ITextEditor)iep;
      //ite.setHighlightRange(start,end,true);
      ite.selectAndReveal(start,length);
      ite.setFocus();
     
    }
    catch (PartInitException e)
    {
View Full Code Here

               
          // Select the line number
          ITextEditor textEditor = (ITextEditor)editor;
          lineNumber--; // document is 0 based
          IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
          textEditor.selectAndReveal( document.getLineOffset(lineNumber), document.getLineLength(lineNumber));
          page.activate(textEditor);
         
        } catch (Exception ex) {
                ex.printStackTrace();
            }
View Full Code Here

     
            } catch (BadLocationException e) {
            }

            if (lineInfo != null) {
              editor.selectAndReveal(lineInfo.getOffset(), lineInfo.getLength());
            }
          }

        } catch (Exception e) {
          // Put your exception handler here if you wish to
View Full Code Here

            editor = showWithoutReuse(file, wbPage, editorId, activate);
        }

        if (editor instanceof ITextEditor) {
            ITextEditor textEditor = (ITextEditor) editor;
            textEditor.selectAndReveal(offset, length);
        } else if (editor != null) {
            showWithMarker(editor, file, offset, length);
        }
        return editor;
    }
View Full Code Here

        IDocumentProvider documentProvider = editor.getDocumentProvider();
        IDocument document = documentProvider.getDocument(editor.getEditorInput());
        int line = resource.getLine() - 1;
        if(line < 0)
          line = 0;
        editor.selectAndReveal(document.getLineOffset(line), document.getLineLength(line));
      }
    }
    catch(Exception e) {
      UIPlugin.logException("Unable to open editor", e);
    }
View Full Code Here

        return;
      }
      IDocument document = provider.getDocument(input);
      try {
        IRegion lineRegion = document.getLineInformation(line - 1);
        textEditor.selectAndReveal(lineRegion.getOffset(), lineRegion.getLength());
      }
      catch (BadLocationException e) {
        // ignore if specified line is not available in document
      }
      provider.disconnect(input);
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.