One of the frustrating things about a clean install of DDE or Eclipse is trying to remember what settings you had and where to set them. For example, on a laptop I had when I opened a Custom Control, the Custom Controls section in the Applications pane was expanded; when I opened a view, the Views section was expanded. I found that extremely annoying and somehow had turned it off on my PC. For the life of me I couldn’t remember how I’d done it. Then, Nathanb Freeman blogged about making Designer work how you want and I remembered what I had forgotten.

Since I’ve been getting more and more into Java in XPages, one of the things which annoyed me was how Java wrapped my code to small line lengths. Like most developers, I suspect, I work on rather a large resolution. And I like to see as much of my code on the screen at once, while still having it readable with blank lines separating it up into meaningful chunks. So I don’t want my lines wrapped at 80 characters.

Typically of me, I found the setting, changed it on my PC and couldn’t then find it a week or two later when I wanted to change it on a laptop. So I’m blogging about it, partially in case it helps others but as much so that when I google it, I find this article which I’d forgotten I’d written (been there, done that!). Because the Domino Designer preferences are numerous  and labyrinthine, with ‘secret passages’ jumping off to other preference pages. And as soon as you’re through, the door slams shut behind you, revealing a perfectly smooth stone wall with no way back. As I was wandering around in the preferences, ball of thread in hand, I’m sure I saw an aged man who looked a bit like Theseus lost inside, but that’s a different story!

So, not surprisingly, the start point for me was the Java root menu and the Editor sub-menu. After looking through the various options I tried the Save Actions page, from which there is a link to the Formatter page. If you’ve not done anything here, then you’ll see the default profile “Eclipse [built-in]“. There is the option to Import a profile, of which more later. But the start point will be to edit the default profile.

Before being able to save any changes, you’ll need to rename it. But instantly you’ll see a myriad of options, which I’ll let you investigate at your leisure. With 8 tabs of goodness you’ll need some time. I accept no responsibility for those of you who finally re-emerge to find your children have grown up and left home (which some might consider a good thing)!

The setting which concerns me here is on the Line Wrapping tab, Maximum line width. There are also settings for line wrapping and indentation for various levels of code.

Make the change, save and select the profile, and your lines will be as long as you wish. From this page you can also Export your profile, useful for backups or if you change you machine. Dig in and enjoy!

3 thoughts on “XPages/Eclipse: Java Editor Line Wrap”

  1. I’ve found the filter to be extremely handy: when you first launch the preferences dialog, it actually highlights the filter field, so you can just start typing… so if you search for “wrap” it gets you a lot closer to the setting you describe (though the profile renaming still confused me at first).

  2. Paul.

    Please note that you can export your Domino Designer preferences! If you go to a ‘non default’ perspective (e.g. the Plugin development perspective) you can choose File->Export and choose to export your Eclipse/Designer preferences.

    On the flip side when you set up a new machine with Domino Designer you can import these preferences to get uniform behavior across all machines.

    Good luck.


  3. Paul, make sure you change the line width both for code and for comments. If you’re going to choose 120 characters for your code, it’s pretty lame to have your comment wrap at 80.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top