Create multiple Java classes from an eclipse pattern in one go

Eclipse has features for templates that make re-coding (with slight variations) easier and more efficient.

I often find myself doing a template as follows:

  • XXXView
  • XXXViewInterface
  • XXXViewListener
  • XXXViewPresenter

According to the MVP pattern https://vaadin.com/web/magi/home/-/blogs/model-view-presenter-pattern-with-vaadin

Then these classes interact and refer to each other, but always the same.

My question is: can I define these 4 classes as a template, so all I have to do is enter "XXX" and generate four Java classes from this

+5
source share
1 answer

You can define several classes inside another class as static inner classes. This works great with Eclipse templates. But a cleaner solution could be to create a plugin for it, as suggested by @AleksandrM above.

0
source

Source: https://habr.com/ru/post/1240518/


All Articles