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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:46:00+00:00 2026-05-26T17:46:00+00:00

I need the exact same effect as in this question but in Eclipse. It

  • 0

I need the exact same effect as in this question but in Eclipse.

It should only do the alignment if I explcitly insert a new line before the “:” or if the second operand (the “true” expression) is too long.

Example:

a = cond ? "a veeeeeeeeeeeeeeeery loooooooooooooooooooooooooooong string"
         : "";
      // ^ put the colon here
  • 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-26T17:46:01+00:00Added an answer on May 26, 2026 at 5:46 pm

    This original answer was for Galileo which is well over a decade ago, so I’m updating it to be a little more current. Original answer remains below.

    For Eclipse 2021-12 (under Window though I hope it would be the same across platforms):

    1. Go into Project, Properties on the menu.
    2. Under Java Code Style, choose Formatter.
    3. For the current project only, enable project-specific settings. For workspace settings, simply click on the Configure workspace settings. Then click the edit button.
    4. In the selection pane, under Line Wrapping, Wrapping settings, Other expressions, there is a Conditionals item that you can edit.

    The options you want are:

    • wrap before operators;
    • wrap where necessary;
    • no force split; and
    • indent on column.

    They give this as an example:

    enter image description here



    This is the dated answer for Galileo:

    1. Go into Project, Properties.
    2. Under Java Code Style, choose Formatter.
    3. For the current project only, enable project-specific settings. For workspace settings, simply click on the Configure workspace settings. Then click the edit button.
    4. On the line-wrapping tab, choose Expressions, Conditionals.
    5. Choose the relevant line wrapping policy and indentation policy.

    I have "wrap only when necessary" and "indent on column" which appears to be close to what you want.

    If you’re not running Galileo, other versions of Eclipse should at least be close to that process. If my settings aren’t quite what you want, you may need to fiddle with them a bit, but that Formatter section is pretty well the entire exposed interface so, if it can’t be done with that, it can’t be done (short of writing your own plug-in or finding a more configurable third-party one).

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

Sidebar

Related Questions

I don't understand this error it's written the exact same in the tutorial but
My question looks like a classic one, but I cannot find the exact same
Duplicate: This is the exact same question, from the exact same person, as Issue
So this question has the exact same symptoms of my problem. Security settings for
In SQL Server (2005+) I need to index a column (exact matches only) that
I have the exact same problem as this guy , since no one has
I need the exact same font in my app, with the exact same size.
I know this is not a straight up question, so if you need me
I need to get the exact same thing the jqGrid passes on the GET/POST
I need to associate different methods of the control with exact same code. I'm

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.