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 319133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:38:00+00:00 2026-05-12T08:38:00+00:00

please can you help me to catch the buffered text present into the editor,

  • 0

please can you help me to catch the buffered text present into the editor, I have this code:

System.out.println( Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getTitle() );
System.out.println( Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput() );

I can not follow the path indicated by the first line, and pratically re-reading the file because I need exactly the text buffer.

In the second line instead I receive always a path from the casted class
org.eclipse.ui.examples.rcp.texteditor.editors.PathEditorInput
(which I don’t want to include @runtime in my app)

Please help me, tnx

  • 1 1 Answer
  • 0 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-12T08:38:01+00:00Added an answer on May 12, 2026 at 8:38 am

    IEditorPart.getEditorInput() returns an IEditorInput representing the editor input. If the active editor is using PathEditorInput as an input you’ll need to either bundle it or refactor the code to not use the example rcp editor input – the PathEditorInput you mention is an rcp example.

    For example you can use one of the standard editors like org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor or org.eclipse.ui.editors.text.TextEditor and a org.eclipse.ui.part.FileEditorInput.

    Did you create your project with an example wizard? If so that would explain where the example usage has come from.

    as far as getting the text, the following snippet will obtain the Editor if it is an instance of AbstractTextEditor, then will retrieve the content from the document.

    Note there are some discouraged accesses in this call, if you register as a listener on the SelectionService, you can keep track of the active selection and avoid having to query the workbench for the active Editor.

    AbstractTextEditor part = (AbstractTextEditor) Workbench.getInstance()
            .getActiveWorkbenchWindow().getActivePage().getActiveEditor()
            .getAdapter(AbstractTextEditor.class);
    
    if (part != null) {
    
        IDocument document = part.getDocumentProvider().getDocument(
                part.getEditorInput());
    
        String content = document.get();
    
        //do something with the text
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 156k
  • Answers 157k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You must write a filter driver. There is no other… May 12, 2026 at 10:58 am
  • Editorial Team
    Editorial Team added an answer Instead of storing the entire entity in the Session, just… May 12, 2026 at 10:58 am
  • Editorial Team
    Editorial Team added an answer You are correct. Note that modal dialogs are not automatically… May 12, 2026 at 10:58 am

Related Questions

Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = connect timeout=9999999; & _
Little silly question, but got stuck for a long time. I have written two
Can you please help me to understand where is the problem? SELECT mz_t_NaznExec.p_Services FROM
I need to wrap an IE ajax request to notify me when it happens.
Okay, I have ran in to a problem with VB.NET. So all those defenders

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.