- This topic has 7 replies, 3 voices, and was last updated 11 years, 4 months ago by Tony Herstell.
-
AuthorPosts
-
Tony HerstellParticipantHi Guys,
This may be more of an eclipse request; but a nice feature for MyEclipse anyhow.
From my old Ada days we always force the code through the formatter before checking it in.
I still enforce this “good habit” myself and with the collaborative nature of MyEclipse starting to really get good… well the formatter needs a fixup… for Java anyhow.
If you use it you will see what I mean!!!!
This is what I suggest it does to REALLY rock:
All below in alphabetic order unless specified
AND… if possible… all below in folding areas unless specified
Static logging stuff at the top. e.g.
private final Logger logger = Logger.getLogger(GroupingManagementActionController.class.getName());
(Scan for the word log?Next “contextual” stuff like:
@Inject
private Conversation conversation;@PersistenceContext(type = PersistenceContextType.EXTENDED)
private EntityManager em;Next “contextual” Event stuff like:
// Events
@Inject
@GroupingCreateEvent
private Event<Grouping> createEvent;The other @injects…
@Inject
GroupingManagementActionController groupingManagementActionController;Next “leading” (Cruffy) stuff like ID and Version for Entities
@XmlAttribute
@XmlID
@XmlJavaTypeAdapter(IdAdapter.class)
@Id
@GeneratedValue
private Long id;@NotNull
@Version
@Column(name = “version4OptLock”)
private long optlock;Next the “simple” private members
@XmlElement(name = “nots”)
@Column(name = “notes”, length = 1000)
@Length(max = 1000)
private String notes;Next the Lists/Sets …
1..*
@XmlElement(name = “tasks”)
@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, mappedBy = “grouping”)
private Set<GroupingTask> tasks;*..*
@NotNull
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH })
private Set<OrganisationRole> organisationRoles;*..1 (generally backlinks)
@XmlElement(name = “parent_organisation”)
@XmlIDREF
@NotNull
@ManyToOne(fetch = FetchType.EAGER)
// -> DO NOT ADD IN AS BREAKS CREATE!// , cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }
private Organisation parentOrganisation;Next Constructors
Next @Overridden methods from parent classes
Next methods with names like init, create etc. (that logically would come first)
Next the putters/getters that match the members by public/private
Next other putters/getter for non members by public/private
Next the public methods (followed by any truly private methods they (or their neighbours) completely “own”)
Next the private methods (followed by any truly other private methods they (or their neighbours) completely “own”)
Finally methods life @Destroy, cancel, done or similar.
I am sure you can think of more!
Cheers.
(Still waiting for Wildfly!)… Hint!
support-swapnaModeratorbalanceofpower,
I am afraid we cannot really make any enhancements to the Java Formatter. I suggest you post to Eclipse forums to raise a request for the Formatter.
Tony HerstellParticipantDone (went for Moderation).
Hint about adding WildFly though to server list…
support-swapnaModeratorbalanceofpower,
We already have an Enhancement Request filed for the WildFly support. We will update you when the dev team comes up with a specific timeline for the support.
Let us know if you see any other issues.
Tony HerstellParticipantSee the comments.
support-tonyKeymasterTony,
Thanks for the suggestions but we can’t make changes to the Java formatter. I don’t know if some of what you’d like is possible with existing eclipse code formatting capabilities. Note that some reordering of members is possible on Save. Go to Window->Preferences->Java->Editor->Save Actions to set certain formatting, including reordering, actions when a file is saved. Maybe this, along with some of the formatting preferences (Window->Preferences->Java->Code Style, particularly Formatter), can give you at least some of what you want, if you haven’t already explored all the possibilities.
Also, there may be some plugins out there that can help.
Sorry we can’t help any further on this.
Tony HerstellParticipantOk
Thx. -
AuthorPosts