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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:24:29+00:00 2026-06-08T21:24:29+00:00

I am writing a custom Eclipse editor by subclassing TextEditor , and I can’t

  • 0

I am writing a custom Eclipse editor by subclassing TextEditor, and I can’t use the Format action that I configured.

I read the 3 parts in Creating a commercial quality IDE, and I know about SourceViewerConfiguration. I implemented the required method:

  override def getContentFormatter(viewer: ISourceViewer) = {
    val formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(viewer), IDocument.DEFAULT_CONTENT_TYPE)
    formatter.setMasterStrategy(new ScalaFormattingStrategy(textEditor))
    formatter
  }

However, I can’t find Format anywhere in the menu, contextual menu, toolbar, etc. The Java shortcut (CMD-Shift-F) does not work either.

Edit: I have implemented other methods in the SourceViewerConfiguration subclass I created, and everything else works as expected in my editor (completion, hyperlinking, reconciliation).

What is the preferred way to expose the formatter? Do I need to do anything more?

  • 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-06-08T21:24:31+00:00Added an answer on June 8, 2026 at 9:24 pm

    Quoting the Eclipse formatter FAQ:

    Finally, you will need to create an action that invokes the formatter.
    No generic formatting action is defined by the text infrastructure,
    but it is quite easy to create one of your own. The action’s run
    method can simply call the following on the source viewer to invoke
    the formatter:

    sourceViewer.doOperation(ISourceViewer.FORMAT);

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

Sidebar

Related Questions

I'm writing an eclipse editor plugin for a custom file format and want to
I'm currently writing an Eclipse text editor plugin for a custom language. The problem
I am writing a custom binding to use $.expandingTextarea with Knockout.js . Following the
I am writing a custom .pac script for use with Firefox. Following numerous examples
I'm writing a custom deserializer that will deserialize a list by deserializing each of
I'm writing an Eclipse plug-in... In my custom label decorator, I want to overlay
As part of writing custom command (COM-Visible dll with class that implements Interwoven command
I know I can do this by writing custom type descriptors etc., however given
I am writing a custom app that requires a help system. The app is
I'm writing an Eclipse plugin with a custom launch configuration, i.e. a launch() method

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.