Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 940627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:59:14+00:00 2026-05-15T21:59:14+00:00

A qustion about Eclipse PDE development: I write a small plugin for Eclipse and

  • 0

A qustion about Eclipse PDE development: I write a small plugin for Eclipse and have the following
* an org.eclipse.ui.texteditor.ITextEditor
* a line number

How can I automatically jump to that line and mark it? It’s a pity that the API seems only to support offsets (see: ITextEditor.selectAndReveal()) within the document but no line numbers.

The best would be – although this doesn’t work:

ITextEditor editor = (ITextEditor)IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), file, true );
editor.goto(line);
editor.markLine(line);

It this possible in some way? I did not find a solution

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:59:15+00:00Added an answer on May 15, 2026 at 9:59 pm

    on the class DetailsView I found the following method.

    private static void goToLine(IEditorPart editorPart, int lineNumber) {
      if (!(editorPart instanceof ITextEditor) || lineNumber <= 0) {
        return;
      }
      ITextEditor editor = (ITextEditor) editorPart;
      IDocument document = editor.getDocumentProvider().getDocument(
        editor.getEditorInput());
      if (document != null) {
        IRegion lineInfo = null;
        try {
          // line count internaly starts with 0, and not with 1 like in
          // GUI
          lineInfo = document.getLineInformation(lineNumber - 1);
        } 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());
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about the eclipse. I want to write JSP by using
This is a question specifically about plugin development for the Eclipse platform: I need
Question about the m2 eclipse plugin. Currently I have Eclipse Java EE IDE for
Please note: This is a question about the Eclipse plugin Subversive , and not
small question about C++ replace function. I'm parsing every line of text input line
Hi I am new to php eclipse and I have a question about my
Background: I've got a new eclipse installation and have installed the m2eclipse plugin. After
I have a question about RAD & WAS Spring MVC development. So that we
Today I have question about Eclipse . I use this IDE very long and
I have a question about the automatically deploying from Eclipse to Glassfish. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.