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

  • SEARCH
  • Home
  • 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 7649963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:07:43+00:00 2026-05-31T11:07:43+00:00

Eclipse already has very impressive and useful what I call source code modifiers (please

  • 0

Eclipse already has very impressive and useful what I call “source code modifiers” (please suggest a better name).

For example, it has “Quick Fix”, “Word Completion”, “Externalize Strings” and other functions that modify source code via menu (or key-combination).

Now, I am looking to add my own “source code modifier” function: I would like to:

  1. Highlight (select) an arbitrary string.
  2. Right-click on it
  3. Invoke a menu item that would “translate” that string to a different string, using a function that I wrote (preferably in Java). Similar to “Quick Fix” or “Replace With” currently on the default context menu.

Is this possible in Eclipse?

If so, what do I need to do to accomplish this?

  • 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-31T11:07:45+00:00Added an answer on May 31, 2026 at 11:07 am

    The short answer:

    The quick assist will have to modify the AST of the Java code. Essentially you will have to replace a org.eclipse.jdt.core.dom.SimpleName node with one that you want.

    The long answer:

    The org.eclipse.jdt.ui.quickAssistProcessors extension point enables you to contribute your own Java code quick assists.

    To create a new extension for the extension point you need to first provide the required extension in the plugin.xml. For example, JDT defines the following processor

       <extension
             point="org.eclipse.jdt.ui.quickAssistProcessors">
          <quickAssistProcessor
                name="%defaultQuickAssistProcessor"
                class="org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor"
                id="org.eclipse.jdt.ui.text.correction.QuickAssistProcessor">
          </quickAssistProcessor>
       </extension>
    

    (For a description of the individual attributes, please refer to the extension point documentation)

    Then you need to create the class that implements the org.eclipse.jdt.ui.text.java.IQuickAssistProcessor interface, and modify the AST in this class. (This class is the same as the one you specified while declaring the extension)

    Supplying the right IJavaCompletionProposal

    JDT provides the following default implementations for correction proposals that can be used to contribute quick fixes and quick assists.

    • ChangeCorrectionProposal
    • CUCorrectionProposal
    • ASTRewriteCorrectionProposal

    If you use an ASTRewrite, you should create an ASTRewriteCorrectionProposal.

    ASTView Plugin

    This is something that will help you visualize the AST of a Java source file http://www.eclipse.org/jdt/ui/astview/index.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've already got Eclipse for PHP-developers installed. Must I install a new version for
I am currently developing an android application using eclipse and I already have a
Eclipse does not highlight matching variables for me: I've already tried to change Mark
i'm using eclipse platform and window builder pro within. I've already created new project
I'm building an application that already has it's Iphone version. I must build the
I apologize if this has already been asked a different way but I couldn't
I just started a new project which has previously been developed in Eclipse. I
Does anyone has a good resource on embedding a Silverlight application in an Eclipse
I've already written a game engine in java using eclipse and opengl es, I
(Eclipse 3.4, Ganymede) I have an existing Dynamic Web Application project in Eclipse. When

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.