Examples of selectAndReveal()


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

  private void gotoSelectedElement() {
    Object element = getSelectedElement();
    dispose();
    ITextEditor editor = getActiveTextEditor();
    if (editor != null) {
      editor.selectAndReveal(((IndexedRegion) element).getStartOffset(), ((IndexedRegion) element).getEndOffset() - ((IndexedRegion) element).getStartOffset());
    }
  }

  private ITextEditor getActiveTextEditor() {
    IWorkbench wb = PlatformUI.getWorkbench();
View Full Code Here

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

            SelectionHistory history = (SelectionHistory) editor.getAdapter(SelectionHistory.class);
            if (history != null) {
              history.remember(new Region(textSelection.getOffset(), textSelection.getLength()));
              try {
                history.ignoreSelectionChanges();
                textEditor.selectAndReveal(newSelectionRegion.getOffset(), newSelectionRegion.getLength());
              }
              finally {
                history.listenToSelectionChanges();
              }
            }
View Full Code Here

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

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

        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

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

                    // 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

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

            } 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

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

    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

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

        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

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

                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

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

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