Package org.eclipse.ui.texteditor

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


              if(editor == null) {
                JavaPlugin.logErrorMessage("Can't open an editor for " + dl.getASTNode());
                return;
              }
             
              editor.selectAndReveal(
                  dl.getASTNode().getStartPosition(),
                  dl.getASTNode().getLength());             
             
              // activate the new window if necessary
              if(editor != fEditor) {
View Full Code Here


        try {
//          System.out.println("Double-clicked on " + match.getMember().getClass());
          EditorUtility.openInEditor(match.getMember(), true);
          if(match.getUnit() != null) {
            ITextEditor editor = (ITextEditor) EditorUtility.openInEditor(match.getMember());
            editor.selectAndReveal(
                match.getAST().getStartPosition(),
                match.getAST().getLength());
          }
        } catch (PartInitException e) {
          log(e.getMessage(), e);
View Full Code Here

                    // System.out.println("Double-clicked on " +
                    // match.getMember().getClass());
                    EditorUtility.openInEditor(match.getMember(), true);
                    if (match.getLineNumber() != -1) {
                        ITextEditor editor = (ITextEditor) EditorUtility.openInEditor(match.getMember());
                        editor.selectAndReveal(match.getAST().getStartPosition(), match.getAST().getLength());
                    }
                } catch (PartInitException e) {
                    log(e.getMessage(), e);
                } catch (Exception e) {
                    log(e.getMessage(), e);
View Full Code Here

            } catch (BadLocationException e) {
                // ignored because line number may not really exist in document,
                // we guess this...
            }
            if (lineInfo != null) {
                editor.selectAndReveal(lineInfo.getOffset(), lineInfo.getLength());
            }
        }
    }
}
View Full Code Here

    IEditorPart editorPart = this.getActiveEditor();
    if (editorPart == null || !(this.getActiveEditor() instanceof ITextEditor)) {
      return;
    }
    ITextEditor textEditor = (ITextEditor) editorPart;
    textEditor.selectAndReveal(offset, length);
  }

  public String getTitleToolTip() {
    String componentName = null;
    IEditorInput[] editorInputArray = componentEditorInput.getInput();
View Full Code Here

        IDocument document = documentProvider.getDocument(textEditor.getEditorInput());
        // it's deprecated but the sse does not provide a
        // FindReplaceDocumentAdapter
        int offset = document.search(0, string, true, true, false);
        if (offset >= 0) {
          textEditor.selectAndReveal(offset, string.length());
        }
        // if (document instanceof IAdaptable) {
        // IAdaptable adaptable = (IAdaptable) document;
        // FindReplaceDocumentAdapter findReplaceDocumentAdapter =
        // (FindReplaceDocumentAdapter)
View Full Code Here

                if (editorPart != null && editorPart instanceof ITextEditor) {
                  ITextEditor textEditor = (ITextEditor) editorPart;
                  IDocumentProvider documentProvider = textEditor.getDocumentProvider();
                  IDocument document = documentProvider.getDocument(textEditor.getEditorInput());
                  int lineOffset = document.getLineOffset(lineNumber - 1);
                  textEditor.selectAndReveal(lineOffset, 0);
                }
              } catch (Throwable t) {
                t.printStackTrace(System.out);
              }
            }
View Full Code Here

            lineInfo = document.getLineInformation(hit.getLineno() - 1);
          } catch (BadLocationException e) {
            e.printStackTrace();
          }
          if (lineInfo != null) {
            textEditor.selectAndReveal(lineInfo.getOffset(),
                lineInfo.getLength());
          }
        }
      }
    } else {
View Full Code Here

        }
        ITextEditor textEditor = (ITextEditor) editor;

        int offset = calculateOffset(textEditor, userPosition);

        textEditor.selectAndReveal(offset, 0);
      }

      private int calculateOffset(ITextEditor editor, SourcePosition userPosition) {
        IDocumentProvider provider = editor.getDocumentProvider();
        IDocument document = provider.getDocument(editor.getEditorInput());
View Full Code Here

          IEditorInput input = part.getEditorInput();
          provider.connect(input);
          IDocument document = provider.getDocument(input);
          try {
            IRegion line = document.getLineInformation(lineNumber);
            textEditor.selectAndReveal(line.getOffset(), line.getLength());
          } catch (BadLocationException e) {

          }
          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.