|
|
Through Eclipse Mars, the Java Reverse Engineering was available in the Papyrus extra plugins. Since Eclipse Neon, they are now in a separate Papyrus component, called Papyrus software designer.
|
|
|
|
|
The Java reverse tools allow Java files or packages to be reverse-engineered into a Papyrus class diagram.
|
|
|
|
|
|
|
|
|
|
[[installation_instructions]]
|
|
[[installation_instructions]]
|
|
|
== Installation instructions
|
|
== Installation instructions
|
|
|
|
|
|
|
|
The Java features of Papyrus are available as part of the http://wiki.eclipse.org/Papyrus_Software_Designer[Papyrus Software Designer] extra feature.
|
|
The reverse engineering capabilities are part of the Java feature of Papyrus SW designer. Java reverse is available, once the Java feature is installed via update site or marketplace. See link:../getting-started
|
|
|
|
|
|
|
|
You can install it by using the Papyrus Software Designer update-site (for Oxygen):
|
|
|
|
|
|
|
|
|
|
* http://download.eclipse.org/modeling/mdt/papyrus/components/designer/
|
|
|
|
|
|
|
|
|
|
Or you can use the nightly build update site for Oxygen (paste following url in eclipse update site):
|
|
|
|
|
|
|
|
|
|
* https://hudson.eclipse.org/papyrus/job/papyrus-designer-photon/lastSuccessfulBuild/artifact/releng/org.eclipse.papyrus.designer.p2/target/repository/
|
|
|
|
|
|
|
|
|
|
Then select "Papyrus Java profile, library and code generation (Incubation)" feature. You need JDT installed (which comes with most Eclipse packages).
|
|
|
|
|
|
|
|
|
|
image:figs/JastallSWDesignerJavaFeature.png[Java feature]
|
|
|
|
|
|
|
|
|
|
[[how_to_use_reverse]]
|
|
[[how_to_use_reverse]]
|
|
|
== How to use Reverse
|
|
== How to use Reverse
|
| ... | @@ -33,7 +18,7 @@ A Java class can be reverse-engineered into a Papyrus class diagram: |
... | @@ -33,7 +18,7 @@ A Java class can be reverse-engineered into a Papyrus class diagram: |
|
|
* select a Java package from a project
|
|
* select a Java package from a project
|
|
|
* click the Reverse button image:figs/ReverseButton.jpg[Reverse button]
|
|
* click the Reverse button image:figs/ReverseButton.jpg[Reverse button]
|
|
|
|
|
|
|
|
A UML class is created in Model Explorer. You can now add it into your diagram.
|
|
A UML class is created in Model Explorer. You can now add it to your diagram.
|
|
|
Note that all associated classes have also been added to the model.
|
|
Note that all associated classes have also been added to the model.
|
|
|
|
|
|
|
|
[[reverse_engineer_a_package]]
|
|
[[reverse_engineer_a_package]]
|
| ... | @@ -41,9 +26,9 @@ Note that all associated classes have also been added to the model. |
... | @@ -41,9 +26,9 @@ Note that all associated classes have also been added to the model. |
|
|
|
|
|
|
|
A Java package (and all classes included) can be reverse-engineered into a Papyrus class diagram:
|
|
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 Java package from a project,
|
|
* Select a Java package from a project,
|
|
|
* click the Reverse button image:figs/ReverseButton.jpg[Reverse button]
|
|
* Click the Reverse button image:figs/ReverseButton.jpg[Reverse button]
|
|
|
|
|
|
|
|
Packages and classes have been created in Model Explorer. Your can now add them to your 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.
|
|
Note that all associated classes have also been added to the model.
|
| ... | @@ -51,7 +36,7 @@ Note that all associated classes have also been added to the model. |
... | @@ -51,7 +36,7 @@ Note that all associated classes have also been added to the model. |
|
|
[[reverse_engineering_settings]]
|
|
[[reverse_engineering_settings]]
|
|
|
==== Reverse-engineering settings
|
|
==== Reverse-engineering settings
|
|
|
|
|
|
|
|
By default, a package named "generated" is created for reverse-engineering. You can choose another package name on the options menu.
|
|
By default, a package named "generated" is created for reverse-engineering. You can choose another package name in the options menu.
|
|
|
|
|
|
|
|
image:figs/JavaReverseOptionsMenu.jpg[Reverse options menu]
|
|
image:figs/JavaReverseOptionsMenu.jpg[Reverse options menu]
|
|
|
|
|
|
| ... | @@ -72,11 +57,11 @@ You can reverse-engineer a class or a package by just dragging & dropping it on |
... | @@ -72,11 +57,11 @@ You can reverse-engineer a class or a package by just dragging & dropping it on |
|
|
image:figs/JavaReverseDragAndDrop.png[Reverse drag and drop]
|
|
image:figs/JavaReverseDragAndDrop.png[Reverse drag and drop]
|
|
|
|
|
|
|
|
A settings dialog is opened. You can modify settings (please see Reverse settings).
|
|
A settings dialog is opened. You can modify settings (please see Reverse settings).
|
|
|
When you're reverse-engineering via the drag & drop method, you can also choose to display model, packages, and classes / interfaces / enumerations in the Papyrus diagram. To enable display, just click the check-boxes:
|
|
When you are reverse-engineering via the drag & drop method, you can also choose to display model, packages, and classes / interfaces / enumerations in the Papyrus diagram. To enable display, just click the check-boxes:
|
|
|
|
|
|
|
|
image:figs/JavaReverseDnDPopUp.png[Reverse drag and drop popup]
|
|
image:figs/JavaReverseDnDPopUp.png[Reverse drag and drop popup]
|
|
|
|
|
|
|
|
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 selected, but not in the Papyrus diagram are displayed.
|
|
When you click the _OK_ button, your components are displayed in the Papyrus diagram. Note: while all selected components are reversed-engineered, only components which are selected, but not in the Papyrus diagram are displayed.
|
|
|
|
|
|
|
|
image:figs/JavaReverseDnDResult.png[Reverse drag and drop results]
|
|
image:figs/JavaReverseDnDResult.png[Reverse drag and drop results]
|
|
|
|
|
|
| ... | @@ -103,26 +88,16 @@ image:figs/JavaCodeReversePreferences.png[Reverse preferences] |
... | @@ -103,26 +88,16 @@ image:figs/JavaCodeReversePreferences.png[Reverse preferences] |
|
|
|
|
|
|
|
* Git repo: https://gitlab.eclipse.org/eclipse/papyrus/org.eclipse.papyrus-designer
|
|
* Git repo: https://gitlab.eclipse.org/eclipse/papyrus/org.eclipse.papyrus-designer
|
|
|
* Java plugins path: plugins/languages/java/
|
|
* Java plugins path: plugins/languages/java/
|
|
|
* Java reverse plugins:
|
|
|
|
|
** org.eclipse.papyrus.designer.languages.java.reverse.ui
|
|
* Java reverse plugins, in the sequel we use the abbreviation oepd for the package prefix org.eclipse.papyrus.designer
|
|
|
|
|
|
|
|
** oepd.languages.java.reverse.ui - plugin for the UI part of the Java reverse mechanism
|
|
|
*** Starting points when called from toolbar UI:
|
|
*** Starting points when called from toolbar UI:
|
|
|
*** org.eclipse.papyrus.designer.languages.java.reverse.ui.handlers.JavaCodeReverseInJobHandler.doPrepareExecute(ExecutionEvent)
|
|
*** Class oepd.languages.java.reverse.ui.handlers.JavaCodeReverseInJobHandler - the methods doPrepareExecute(ExecutionEvent) and doExecuteTransactionInJob(IProgressMonitor) are called first
|
|
|
*** org.eclipse.papyrus.designer.languages.java.reverse.ui.handlers.JavaCodeReverseInJobHandler.doExecuteTransactionInJob(IProgressMonitor)
|
|
*** Project explorer walker
|
|
|
** org.eclipse.papyrus.designer.languages.java.reverse
|
|
*** Class oepd.languages.java.reverse.ui.ProjectExplorerNodeWalkerWithIProgress - the methods doSwitch(Object, SubMonitor) and visitICompilationUnit(ICompilationUnit, SubMonitor) traverse the project explorer resources recursively until reaching a compilation unit (called a "node" in this context).
|
|
|
*** Project explorer walker visits the project explorer resources recursively, until we reach a compilation unit called a "node" in this context.
|
|
*** Class oepd.languages.java.reverse.ui.ReverseSelectedNodeVisitor - the method visitICompilationUnit(ICompilationUnit) examines JDT elements of a compilation unit.
|
|
|
**** org.eclipse.papyrus.designer.languages.java.reverse.ui.ProjectExplorerNodeWalkerWithIProgress.doSwitch(Object, SubMonitor)
|
|
|
|
|
**** org.eclipse.papyrus.designer.languages.java.reverse.ui.ProjectExplorerNodeWalkerWithIProgress.visitICompilationUnit(ICompilationUnit, SubMonitor)
|
|
** org.eclipse.papyrus.designer.languages.java.reverse - plugin for the Java reverse mechanism
|
|
|
*** Then we use a node visitor to visit its JDT elements.
|
|
*** package oepd.languages.java.reverse.javaparser - Parse Java code
|
|
|
**** {blank}
|
|
*** Class oepd.languages.java.reverse.umlparser.CompilationUnitAnalyser - analyze a compilation unit and create associated UML elements. The compilation unit analyzer uses other classes of the package oepd.languages.java.reverse.umlparser |
|
|
***** org.eclipse.papyrus.designer.languages.java.reverse.ui.ReverseSelectedNodeVisitor.visitICompilationUnit(ICompilationUnit)
|
|
\ No newline at end of file |
|
|
*** Which uses its compilation unit analyzer to analyze and create UML elements
|
|
|
|
|
**** org.eclipse.papyrus.designer.languages.java.reverse.umlparser.CompilationUnitAnalyser.processCompilationUnit(CompilationUnit)
|
|
|
|
|
*** The compilation unit analyzer uses other classes which are all in the following package:
|
|
|
|
|
**** org.eclipse.papyrus.designer.languages.java.reverse.umlparser
|
|
|
|
|
** Java Parser and JDT Parser
|
|
|
|
|
*** To reverse Java code, it is parsed by Java Parser and an AST is built.
|
|
|
|
|
*** Java Parser is embedded in: org.eclipse.papyrus.designer.languages.java.reverse.javaparser
|
|
|
|
|
*** We are also experimenting with JDT Parser (currently deactivated for the user)
|
|
|
|
|
*** JDT Parser files are in: org.eclipse.papyrus.designer.languages.java.reverse.jdt
|
|
|
|
|
|
|
|
|
|
Category:Modeling Category:Papyrus Category:Papyrus-Software-Designer |
|
|