Community
Participate
Working Groups
When Platform/Text detects a field plus a getter plus a setter grouped together, there should be an option to fold the entire JavaBean property down to one line--probably the first line present. This should be intelligent so that if a property is bound or vetoable (has property change support), that will be folded in as well. This would make the code folding much more useful to me (not that I dislike it now) and would make my code much more readable as a result.
s/Platform\/Text/JDT\/Text/g;
fyi, the platform text layer knows _nothing_ about java beans. it only understands text. even jdt text knows nothing about java beans - it only understands standard java. this request should really be entered against a component that does understand java beans - but i think there is currently none in eclipse sdk.
Adam, Please note my request to substiture JDT/Text for Platform/Text and the fact that the bug is logged against JDT/Text. Allowing navigation and editing of higher-level conceptual constructs than the bare Java code is one of the features that makes the JDT stand out from other IDEs. For example, this is the whole purpose of the refactoring and template-based editing features. Extending this support to Java Beans is just a natural evolution of what Eclipse has been doing all along. With EJB3 moving to a Java Beans model + metadata annotations, this is also in keeping with the direction that Java itself is evolving. This is one of several bugs I've logged in this same vein. See also bug 26618 and bug 55763.
Maybe JDT/UI should own this? I'll let someone else make the call...
Getters and setters might not be grouped together and hence sinmple folding would not do the trick.
Added property change support to the summary as per my initial comment (don't want that part of the JavaBeans spec to get lost/unsupported and it was in my original request).
Maybe to solve this we could use some sort of comment-tag solution. Example: // region<myField> public String getMyField(){ return myField; } public void setMyField(String t){ myField = t; } // endregion<myField> everything between region and endregion would be folded. This would be sort of like C#'s regions and would since I have the comment '//'s then this won't intefere or need a compiler change only an IDE that supports these comment tags... sort of like javadoc.
If you want comment-based folding, I'd support that, but that's a different subject than the one I brought up here. JDT has enough metadata to be able to detect these things without inserting comments into the code, so I would not favor that solution for this bug. That solution could go it its own bug report, though, IMO.
agree with comment 8
*** Bug 212845 has been marked as a duplicate of this bug. ***
*** Bug 63391 has been marked as a duplicate of this bug. ***