score:73
With Eclipse 3.6, this seems doable by configuring your custom Java > Code Style > Formatter profile. Edit it and go to the Line Wrapping tab and select Function Call > Qualified invocations. Then, in the Settings for qualified invocations, configure things like this:
This will (should) produce the expected result:
SomeEntity e1 = new SomeEntity.Builder()
.age(10)
.amount(10.0d)
.firstname("foo")
.lastname("bar")
.build();
But this will obviously affect all the code, which I personally don't like. So I'm using the new Off/On Tags from Eclipse 3.6 (last tab when editing a profile):
And enclose the parts that don't get formatted as I want and do it myself:
// @formatter:off
SomeEntity e2 = new SomeEntity.Builder()
.age(10)
.amount(10.0d)
.firstname("foo")
.lastname("bar")
.build();
// @formatter:on
Pick your poison :)
Source: stackoverflow.com
Related Query
- How to indent the fluent interface pattern "correctly" with eclipse?
- How to create the pom.xml for a Java project with Eclipse
- How to use the "sysout" snippet in Eclipse with selected text?
- How do you automate the installation of Eclipse plugins with command line?
- How to install the GlassFish 3 server adapter with Eclipse Helios 3.6
- how to sum @retainedHeapSize with oql in the Eclipse Memory Analyzer Tool
- How to set up the Eclipse for remote C debugging with gdbserver?
- How to run maven from eclipse with the -e switch
- How to choose the Eclipse interface language?
- How to have eclipse add line comments at the indent instead at the beginning of the line?
- How to solve "Secure storage was unable to save the master password" in Eclipse CDT remote application with SSH password debug connection?
- How do I force eclipse to update the apk on my hardware device with each build?
- How to use Tomcat with maven correctly in Eclipse
- How to use scope "test" and junit correctly with maven and eclipse
- Integrating Unity with Eclipse - How to follow the "official" tutorial's instructions?
- How to do standalone on-the-fly in-memory compilation with the eclipse compiler?
- When you get a stack trace in Eclipse with SDK classes in the stack, how can you see the SDK sources?
- How to use eclipse with ssh, so that the remote projects can be edited by local eclipse?
- How to change the optimization level with Eclipse + CDT + MinGW?
- How can I scroll left and right in Eclipse editor with the keyboard without moving the cursor?
- How can I switch to the other pane of editors in Eclipse with a shortcut?
- How does Eclipse show the startup interface so fast
- How to include the jars referenced in "Java Build Path" section of an Eclipse project in a jar file generated with Ant using a build.xml file
- How does the m2e eclipse plugin interact with eclipse?
- How to Jump to the next tag while working with Eclipse or Aptana Studio?
- In Eclipse 3.5 (and with the Aptana plugins), how do I get a view that I can use to show my project, including "dot" files?
- How to make the runnable jar file for a maven eclipse project with hibernate configuration
- How to make Eclipse work with the snippet macro in maven doxia files?
- How to set up/view PHP server pages in Eclipse with the PDT plugin (for php)
- How do you get the Eclipse Package Explorer to show files whose names begins with a . (period)?
More Query from same tag
- Deployed Maven project to Tomcat 7, still getting 404
- Java beginner assign.: insert user controlled random numbers in a file and sum it
- What does UnsatisfiedLinkError mean?
- Create a new console for each thread in java
- How to Make Eclipse Java Set Project Dependency to Solution Project Instead of Reference JAR
- No checkbox for conditional breakpoint in eclipse debugger
- Android: Rename Package in Eclipse
- How do I switch the first term and the last term of an array?
- How can I disable a form with javascript onchange function?
- android username login questions
- Shortcut to get rid of full class names
- Can I use Visual Studio as an IDE for cocos2d-x 3.0rc2, c++ development?
- sdk platform tools component is missing when i copied the android sdk path
- Internal error for Jetty plugin in Eclipse
- Eclipse - Java - UniProtJapi import problem
- Android Wear: How to integrate in existing "older App" (minSDK 2.3)
- Eclipse 2018-12 (4.10.0) Version not showing Spring Framework default logs in console?
- How do I target 1280x720 WXGA720 resolution (like new Galaxy Nexus) in Android Layout folders?
- Can you force eclipse to run/debug another project when a particular one is ran/debugged?
- Eclipse "Java was started but returned exit code=1" with OpenJDK
- How to avoid appending webapp name in the url?
- Maven install transitive dependencies
- I could not debug using goclipse plugin, windows environment
- Eclipse not finding main method when trying to export to runnable JAR
- Javafx setMaximized on OSX
- Google cloud sql connection error from localhost (Java eclipse)
- How to stop debugging in Android application in Eclipse
- How to create a servlet in an existing package of a project
- How to solve "No Activity found to handle Intent" error
- Eclipse Jboss Tools - Deploying parent child project