|
SDE for Eclipse facilitate the generation and reverse of Java by the Java Round-Trip Engineering.
![]() |
|
Figure 11.1 - Generate code
|
![]() |
| Figure 11.2 - Class diagram used as an example |
![]() |
| Figure 11.3 - Clicking Update Code |
![]() |
| Figure 11.4 - Selecting Update Code |
![]() |
| Figure 11.5 - Selecting Update Project to Code |
![]() |
| Figure 11.6 - Selecting Update to Code |
![]() |
| Figure 11.7 - Selecting Update to Code from the popup menu of a package on diagram |
![]() |
| Figure 11.8 - Selecting Update to Code |
![]() |
| Figure 11.9 - Selecting Update to Code |
![]() |
| Figure 11.10 - Reverse code |
![]() |
| Figure 11.11 - Java source of Professor.java |
![]() |
|
Figure 11.12 - Selecting Update UML Model
|
![]() |
|
Figure 11.13 - Selecting Update UML Model
|
![]() |
|
Figure 11.14 - Selecting Update UML Model
|
![]() |
|
Figure 11.15 - Selecting Update UML Model
|
![]() |
|
Figure 11.16 - Selecting Update UML Model
|
![]() |
|
Figure 11.17 - Selecting Update UML Model
|
![]() |
| Figure 11.18 - Drag and drop to add a class model to diagram |
![]() |
|
Figure 11.19 - Selecting code from class model
|
![]() |
|
Figure 11.20 - Selecting code from operation
|
| Selection cannot be made to project and package. |
![]() |
|
Figure 11.21 - Selecting class model from code
|
![]() |
|
Figure 11.22 - Selecting class model from code
|
| Selection cannot be made to project, package, attribute and operation. |
![]() |
| Figure 11.23 - Java round-trip Engineering |
![]() |
| Figure 11.24 - Statement amended |
![]() |
| Figure 11.25 - Class added |
![]() |
| Figure 11.26 - Signature amended |
![]() |
|
Figure 11.27 - Source changed
|
![]() |
|
Figure 11.28 - Class changed
|
![]() |
|
Figure 11.29 - Change to UML perspective
|
![]() |
| Figure 11.30 - Code tab |
| Name | Description |
|---|---|
| Default attribute prefix | Configure the default prefix of attribute. |
| Default operation return type |
Configure the default return type of operation. |
| Default parameter type |
Configure the default prefix of parameter. |
| Remove method body after changes to abstract method |
Check the check box to remove method body after change to abstract method. |
| Add import statement instead of using fully qualified type name |
Check the check box to add import statement. |
| Import fully qualified type name for referenced type | Check the check box to import fully qualified type name. |
| Auto realize interface |
Check the check box to realize interface automatically. |
| Collection type |
Select a collection type from the drop down menu. |
| Use generic collections | Check the check box to use generic collections. |
| Generate annotation on | Specify the code generator to generate the annotation in field-based or property-based access type. |
| Generate annotation in code convention | Check the checkbox so that before updating the code, SDE for Eclipse will select suitable placement strategy on either field-based or property-based access type. |
| System default | Select the system default type of text file encoding to type. |
| Other | Select other types of text file encoding to type. |
| Apply Eclipse code formatting | Check the check box to make the generated code follow Eclipse's code formatting. Otherwise, user can defined the code formatting on Brace and Indentation and New Lines tabs. |
![]() |
| Figure 11.31 - Example illustrating options in Code tab about default type setting |
![]() |
| Figure 11.32 - Example illustrating options in Code tab about Remove method body |
![]() |
| Figure 11.33 - Example illustrating options in Code tab about Add import statement |
![]() |
| Figure 11.34 - Example illustrating options in Code tab about Auto realize interface |
![]() |
| Figure 11.35 - Example illustrating options in Code tab about Java Collection |
![]() |
| Figure 11.36 - Brace and Indentation tab |
| Name | Description |
|---|---|
| Class declaration |
Select the position of Class declaration from the drop-down menu. You can place it on the same line or the next line. |
| Constructor declaration |
Select the position of Constructor declaration drop-down menu. You can place it on the same line or the next line. |
| Method declaration |
Select the position of Method declaration drop-down menu. You can place it on the same line or the next line. |
| Enum declaration |
Select the position of Enum declaration drop-down menu. You can place it on the same line or the next line. |
| Annotation type declaration |
Select the position of Annotation type declaration drop-down menu. You can place it on the same line or the next line. |
| All Same Line |
Select to set all the brace positions to be on the same line. |
| All Next Line |
Select to set all the brace positions to be on the same line. |
| Indentation policy |
Select a way of indentation. You may choose Tabs and space to be the indentation. |
| Indentation size |
If you select space as indentation, you can select the size of it. |
![]() |
| Figure 11.37 - Example illustrating options in Brace and Indentation tab |
![]() |
| Figure 11.38 - New Lines Tab |
| Name | Description |
|---|---|
| Before package declaration |
Type in the number of blank lines place before package declaration. |
| After package declaration |
Type in the number of blank lines place after package declaration. |
| Before import declaration |
Type in the number of blank lines place before import declaration. |
| After import declaration |
Type in the number of blank lines place after import declaration. |
| Before first declaration |
Type in the number of blank lines place before first declaration. |
| Before different kind declaration |
Type in the number of blank lines place before different kind declaration. |
| Before field declaration |
Type in the number of blank lines place before field declaration. |
| Before method declaration |
Type in the number of blank lines place before method declaration. |
| Before inner type declaration |
Type in the number of blank lines place before inner type declaration. |
| Number of lines to empty body | Type in the number of blank lines place to the empty body. |
![]() |
| Figure 11.39 - Example illustrating options in New Lines tab |
![]() |
| Figure 11.40 - Example illustrating option in New Lines tab |
|
|
|||||||