This example is developed from the example synchronized OOM, demo.oom, and demonstrates the creation and deletion of attributes in a synchronized model.
Note: If you change generation templates, you can regenerate source code manually by right-clicking a class, interface, synchronized package, or model, in the Model Explorer or in a class diagram, and selecting Refresh Source Code.
- Open the property sheet of the printer class, click the Attributes tab, and add a usbPort attribute with a boolean data type and public visibility.
- Click OK to return to the class diagram, where the usbPort attribute is displayed in the printer symbol:
- Right-click the printer symbol or the printer item in the Model Explorer and select to open the source code file of the printer class in a pane directly under the diagram:
Note that the usbPort attribute is displayed in the synchronized source code.
- Delete the code concerning the usbPort attribute.
- Select in the Eclipse menu bar.
The usbPort attribute disappears from the printer symbol because the printer class in the OOM has been synchronized with its source code.