Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Generating ArrayList, Getters, Setters and public constructors in Java
Generating ArrayList, Getters, Setters and public constructors in Java [message #1804851] Tue, 02 April 2019 10:30 Go to next message
Mohamed Ismail is currently offline Mohamed IsmailFriend
Messages: 9
Registered: March 2019
Junior Member
Hi,

I am starting to like Papyrus Designer mainly because it honors the inheritance hierarchy and adds comments for the fields. Thanks guys. However, I would like clear steps to do the following:
1- Generate Lists/ArrayLists instead of arrays.
2- Generate getters and setters.
3- Generate public constructors.
4- Create macros that can apply model wide changes e.g. add a stereotype to all fields.

I hope this isn't too much to ask for :)

Regards,
Mohamed Ismail
Re: Generating ArrayList, Getters, Setters and public constructors in Java [message #1804853 is a reply to message #1804851] Tue, 02 April 2019 10:50 Go to previous messageGo to next message
Mohamed Ismail is currently offline Mohamed IsmailFriend
Messages: 9
Registered: March 2019
Junior Member
One more thing. After a quick review of the designer's code I found that it uses Xtend for M2T. Can I change/add Xtend files without have to recompile everything? Just recompiling the module org.eclipse.papyrus.designer.languages.java ?
Re: Generating ArrayList, Getters, Setters and public constructors in Java [message #1804887 is a reply to message #1804853] Tue, 02 April 2019 19:02 Go to previous messageGo to next message
Mohamed Ismail is currently offline Mohamed IsmailFriend
Messages: 9
Registered: March 2019
Junior Member
Hi,

After lots of searches I found the below link to a video that describes how to do a workaround for generating a List<> of items. It is not very nice but it does the trick. I am not sure whether this solution is outdated and there is a more updated one or not:
https://www.youtube.com/watch?v=wqvbXFrHCrU&list=PLCTWqbu-D5bMQDDrbgRWoVxUqtiSx4V34&index=12

If this is the only solution available then my list of updated inquiries are:
1- Generate getters and setters.
2- Generate public constructors.
3- Create macros that can apply model wide changes e.g. add a stereotype to all fields.

Thanks
Re: Generating ArrayList, Getters, Setters and public constructors in Java [message #1805286 is a reply to message #1804887] Thu, 11 April 2019 08:55 Go to previous message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

if you want to change xtend files, it is sufficient to have only the concerned plugin in your workspace (provided that the required plugins are installed). In order to become effective, you need to either export the plugin to your eclipse installation or start a 2nd eclipse instance.

Concerning the workaround shown in the video: yes, that is an option although not very clean. Since we have a similar request in the context of C++, i..e. user defined ways to handle multiplicities > 1, we plan to add this possibility in the future, but I do not have an exact release date yet.
Previous Topic:Importing UML profile in an Architecture model
Next Topic:Papyrus Oxygen new local palette unavailable
Goto Forum:
  


Current Time: Tue Apr 16 07:42:41 GMT 2024

Powered by FUDForum. Page generated in 0.11058 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top