Chapter 7 Working with Eclipse
Example of synchronization
The following example is developed from the synchronized OOM, demo.oom. (See "Activating synchronization")
To create and delete an attribute in a synchronized model:
- Double-click the printer symbol, select the Attributes tab, and add a usbPort attribute with a boolean data type and a public visibility.
- Click OK.
The usbPort attribute is displayed in the printer symbol.
- In the class diagram, right-click the printer symbol, and select Edit Source Code.
or
In the Model Explorer, right-click the printer item, and select Edit Source Code.
The source code file of the printer class is displayed in a view right under the diagram.
Note that the usbPort attribute is displayed in the synchronized source code.
- Delete the code concerning the usbPort attribute.
- Select File→Save in the Eclipse menu bar.
The usbPort attribute disappears from the printer symbol.
The printer class in the OOM has been synchronized with its source code.
Refresh source code
If you change generation templates, you can regenerate source code manually with the Refresh Source Code feature:
- In the Model Explorer, right-click a class, an interface, a synchronized package or model item, and select Refresh Source Code
- In a class diagram, right-click a class, an interface or a package symbol, and select Refresh Source Code
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|