Difference between revisions of "Java reverse engineering"
(→Installation Instructions) |
m (Capitalization, spelling, and grammar edits only.) |
||
Line 1: | Line 1: | ||
− | The Java Reverse Engineering is available in the extra plugins of Papyrus. It allows | + | The Java Reverse Engineering is available in the extra plugins of Papyrus. It allows Java files or packages to be reverse-engineered into a Papyrus class diagram. |
== Installation Instructions== | == Installation Instructions== | ||
− | + | Java Reverse Engineering is available as a Papyrus extra plugin. | |
− | You can install it by using the Papyrus update site | + | You can install it by using the Papyrus update site corresponding to your Papyrus version: |
*https://www.eclipse.org/papyrus/updates/ | *https://www.eclipse.org/papyrus/updates/ | ||
− | Or you can use the nightly build update site (paste following | + | Or you can use the nightly build update site (paste following URL in eclipse update site): |
*http://download.eclipse.org/modeling/mdt/papyrus/updates/nightly/luna/extra/ | *http://download.eclipse.org/modeling/mdt/papyrus/updates/nightly/luna/extra/ | ||
Then : | Then : | ||
− | * | + | *Unselect 'Group item by category' |
*Select ' Papyrus Java Reverse (Incubation)' | *Select ' Papyrus Java Reverse (Incubation)' | ||
*Finish | *Finish | ||
Line 15: | Line 15: | ||
== How to use Reverse == | == How to use Reverse == | ||
=== Using Command === | === Using Command === | ||
− | ==== Reverse a Java class ==== | + | ==== Reverse-engineer a Java class ==== |
− | A | + | A Java class can be reverse-engineered into a Papyrus class diagram: |
*open the class diagram, | *open the class diagram, | ||
− | *select a | + | *select a Java package from a project |
− | * click | + | * click the Reverse button [[File:ReverseButton.jpg]] |
− | A UML class has been created | + | A UML class has been created in Model Explorer. You can now add it into your diagram. |
− | Note that all associated classes | + | Note that all associated classes have also been added to the model. |
− | ==== Reverse a package ==== | + | ==== Reverse-engineer a package ==== |
− | A | + | A Java package (and all classes included) can be reverse-engineered into a Papyrus class diagram: |
*open the class diagram, | *open the class diagram, | ||
− | *select a | + | *select a Java package from a project, |
− | *click | + | *click the Reverse button [[File:ReverseButton.jpg]] |
− | + | Packages and classes have been created in Model Explorer. Your can now add them to your diagram. | |
− | Note that all associated classes | + | Note that all associated classes have also been added to the model. |
− | ==== Reverse settings ==== | + | ==== Reverse-engineering settings ==== |
− | By default, a package named "generated" is created for | + | By default, a package named "generated" is created for reverse-engineering. You can choose another package name on the options menu. |
[[Image:JavaReverseOptionsMenu.jpg]] | [[Image:JavaReverseOptionsMenu.jpg]] | ||
This options menu allows to: | This options menu allows to: | ||
− | * change the default package of the reverse engineering, | + | * change the default package of the reverse-engineering, |
− | * add or remove search path. The reverse generator search existing | + | * add or remove search path. The reverse generator search existing UML classes and regenerate them. |
− | * add or remove creation path. The reverse generator search on existing | + | * add or remove creation path. The reverse generator search on existing Java classes to generate a UML class. Useful for creating Java imports (e.g.: String, Integer). |
=== Using Drag & Drop === | === Using Drag & Drop === | ||
− | You can reverse a class or a package | + | You can reverse-engineer a class or a package just by dragging & dropping it on a Papyrus diagram: |
− | * Drag one or more classes/packages, | + | * Drag one or more classes and/or packages, |
− | * Drop the selection into an | + | * Drop the selection into an open diagram. |
[[Image:JavaReverseDragAndDrop.png]] | [[Image:JavaReverseDragAndDrop.png]] | ||
Line 55: | Line 55: | ||
[[Image:JavaReverseDnDPopUp.png]] | [[Image:JavaReverseDnDPopUp.png]] | ||
− | When you | + | When you click on the ''OK'' button, your components are displayed in the Papyrus diagram. Note: while all selected components are reversed-engineered, only components which are in selection, but not in the Papyrus diagram are displayed. |
[[Image:JavaReverseDnDResult.png]] | [[Image:JavaReverseDnDResult.png]] | ||
− | == Change default reverse settings == | + | == Change default reverse-engineering settings == |
− | The | + | The Java code reverse-engineering plugin allows you to change default settings on eclipse preferences: |
*Open ''Eclipse Preferences'', | *Open ''Eclipse Preferences'', | ||
− | *Search for ''Papyrus'' section, | + | *Search for the ''Papyrus'' section, |
*Choose ''Java Code Reverse'' sub-section | *Choose ''Java Code Reverse'' sub-section | ||
Revision as of 14:11, 15 January 2015
The Java Reverse Engineering is available in the extra plugins of Papyrus. It allows Java files or packages to be reverse-engineered into a Papyrus class diagram.
Contents
Installation Instructions
Java Reverse Engineering is available as a Papyrus extra plugin.
You can install it by using the Papyrus update site corresponding to your Papyrus version:
Or you can use the nightly build update site (paste following URL in eclipse update site):
Then :
- Unselect 'Group item by category'
- Select ' Papyrus Java Reverse (Incubation)'
- Finish
How to use Reverse
Using Command
Reverse-engineer a Java class
A Java class can be reverse-engineered into a Papyrus class diagram:
A UML class has been created in Model Explorer. You can now add it into your diagram. Note that all associated classes have also been added to the model.
Reverse-engineer a package
A Java package (and all classes included) can be reverse-engineered into a Papyrus class diagram:
Packages and classes have been created in Model Explorer. Your can now add them to your diagram. Note that all associated classes have also been added to the model.
Reverse-engineering settings
By default, a package named "generated" is created for reverse-engineering. You can choose another package name on the options menu.
This options menu allows to:
- change the default package of the reverse-engineering,
- add or remove search path. The reverse generator search existing UML classes and regenerate them.
- add or remove creation path. The reverse generator search on existing Java classes to generate a UML class. Useful for creating Java imports (e.g.: String, Integer).
Using Drag & Drop
You can reverse-engineer a class or a package just by dragging & dropping it on a Papyrus diagram:
- Drag one or more classes and/or packages,
- Drop the selection into an open diagram.
A settings dialog is opened. You can modify settings (please see Reverse settings). In case when you're reversing by using drag & drop way, you can also choose to display model, packages, and classes / interfaces / enumerations into the papyrus diagram. To enable displaying, just click into the check-boxes:
When you click on the OK button, your components are displayed in the Papyrus diagram. Note: while all selected components are reversed-engineered, only components which are in selection, but not in the Papyrus diagram are displayed.
Change default reverse-engineering settings
The Java code reverse-engineering plugin allows you to change default settings on eclipse preferences:
- Open Eclipse Preferences,
- Search for the Papyrus section,
- Choose Java Code Reverse sub-section
In this preferences page, you can change:
- default search path values,
- default creation path values.
Note that there are default values; if you have changed these values for a project, your changes are saved, and default values are not used.