GenerateToString

Compatible with  IntelliJ IDEA
10.07.2008
94 410
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

Version

Update date

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().
06.05.2015
For followers, on mac normal Intellij insert menu is "ctrl+n"
meo
31.07.2014
It seems that this project needs a new maintainer..
06.12.2013
Not compatible with IDEA 13
Anonymous
15.04.2009
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.
Anonymous
14.04.2009
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.

Anonymous
13.04.2009
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?
Anonymous
29.10.2008
Is it compatible with IDEA 8?
10.07.2008
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.

Anonymous
10.07.2008
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
.extractDocumentation(GenerateToStringUtils.java:303)
at generate.tostring.GenerateToStringPlugin
.initComponent(GenerateToStringPlugin.java:56)
at com.intellij.openapi.components.impl.ComponentManagerImpl
.a(ComponentManagerImpl.java:68)
at com.intellij.openapi.components.impl.ComponentManagerImpl
.access$1100(ComponentManagerImpl.java:112)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1
.getComponentInstance(ComponentManagerImpl.java:5)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter
.getComponentInstance(ComponentManagerImpl.java:6)
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
.getComponentInstance(AbstractDelegatingMutablePicoContainer.java:75)
at com.intellij.openapi.components.impl.ComponentManagerImpl
.a(ComponentManagerImpl.java:178)
at com.intellij.openapi.components.impl.ComponentManagerImpl
.a(ComponentManagerImpl.java:12)
at com.intellij.openapi.components.impl.ComponentManagerImpl
.initComponents(ComponentManagerImpl.java:162)
at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl
.load(ApplicationStoreImpl.java:5)
at com.intellij.openapi.application.impl.ApplicationImpl
.load(ApplicationImpl.java:235)
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?
10.07.2008
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.
Anonymous
09.07.2008
please dont compile with JDK6, otherwise you will lose all mac intellij users out there.
Anonymous
02.07.2008
How about a generator for clone() ? for some reason it hasn't been done yet...
Anonymous
13.02.2008
I would love to see a version of this plugin for generating hashCode() and equals() based on a template. Thanks!
09.01.2008
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.