182 GenerateToString Editor 25 Claus Ibsen 4.5 94672 davsclaus 2008-07-10 4.0.7


Compatible with  IntelliJ IDEA
94 672
Adds a new action 'toString()' in the generate menu (alt + ins). The action generates a toString() method that dumps the classes fields. Java body code is generated using Velocity Macro and you can change this to fit your needs. The plugin has it's own settings (ctrl + alt + s). Full documentation included (Click hyperlink from Settings).

Download plugin

Recent change notes

  • ID22 - Compiled with JDK1.5 so Mac users can use it again - sorry please give me a macbook pro ;)

General usage instructions

press \'alt + ins\' to active the generate mini menu and chose toString().
For followers, on mac normal Intellij insert menu is "ctrl+n"
It seems that this project needs a new maintainer..
Not compatible with IDEA 13
Thank you very much! It was not easy to find settings =)

I was confused by the fact that Copyright settings are presented in the Setting dialog box.
The plugin is now bundled with IDEA and Jetbrains have taken over the maintenance of the plugin.

The settings have moved, eg press CTRL + INS and select toString() then a dialog shows the members to choose and there should be a Settings button on this popup window.

Nice plugin but I have one problem with it. I have updated it and enabled from plugins menu in IDEA 8. Now I see generate toString menu when I press Alt+Ins but there is no plugin configuration dialog in settings. Anyone has the same problem?
Is it compatible with IDEA 8?
When the plugin starts up it tries to locate itself and extract the documentation that is included in the .jar.

It seems as it has trouble reading the .jar from this location:
C:\Documents and Settings\019gus\.IntelliJIdea70\config\plugins\GenerateToString.jar

The path is returned by IDEA itself, the path is not computed by the plugin.

However its just a WARNING and the plugin should work fine. Only the link in the settings to the plugin documentation will fail.

You should be fine to use all its features to generate the toString() methods.

when installing I have this bug:
IO error while extracting plugin documentation - documentation disabled. Filename = 'C:\Documents and Settings\019gus\.IntelliJIdea70\config\plugins\GenerateToString.jar': C:\Documents and Settings\019gus\.IntelliJIdea70\config\plugins\GenerateToString.jar (Íå óäàåòñÿ íàéòè óêàçàííûé ôàéë)
java.io.FileNotFoundException: C:\Documents and Settings\019gus\.IntelliJIdea70\config\plugins\GenerateToString.jar (Íå óäàåòñÿ íàéòè óêàçàííûé ôàéë)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:114)
at java.util.jar.JarFile.(JarFile.java:133)
at java.util.jar.JarFile.(JarFile.java:70)
at generate.tostring.GenerateToStringUtils
at generate.tostring.GenerateToStringPlugin
at com.intellij.openapi.components.impl.ComponentManagerImpl
at com.intellij.openapi.components.impl.ComponentManagerImpl
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter
at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:199)
at com.intellij.util.pico.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:186)
at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:168)
at org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer
at com.intellij.openapi.components.impl.ComponentManagerImpl
at com.intellij.openapi.components.impl.ComponentManagerImpl
at com.intellij.openapi.components.impl.ComponentManagerImpl
at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl
at com.intellij.openapi.application.impl.ApplicationImpl
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:24)
at com.intellij.idea.MainImpl$3.run(MainImpl.java:3)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:131)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:132)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:136)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

how to fix?
Sorry I have uploaded a new version target for jdk 1.5. I don't yet have a macbook pro, but I am aiming for one later this year.
please dont compile with JDK6, otherwise you will lose all mac intellij users out there.
How about a generator for clone() ? for some reason it hasn't been done yet...
I would love to see a version of this plugin for generating hashCode() and equals() based on a template. Thanks!
Easy to see why its the #2 downloaded plug-in: 1) Well written; 2) provides necessary functionality that is surprisingly missing from IDEA; 3) easy to configure with great default templates 4) *Amazing* documentation that should be the standard that all other plug-ins should aim for.

I wholeheartedly agree with other reviewers that this plug-in should be included with the standard IDEA distribution. My sincere thanks to Claus for having written this plug-in.
Please  sign in  to leave a comment.