This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Steps to reproduce: - Create a Java-Platform UML project - Create a Class diagram - Put a Class element on the diagram and name it - Insert 'private int a' ittribute into the element - Right-click the attribute The context menu does not have 'Generate Code' menu item
Not sure what the use case is here. Attributes and operation are not supposed to have the Generate Code action. You can't just generate code for a single operation or attribute. You need the whole class to be generated so that the ops and attrs have a file to live in.
Let's suppose I need to write an operation - I put a class element on the diagram - I insert an into the class element I need to look at the source code, change the operation and generate code again Steps are: 1) - Select the class element (because operation is selected) 2) - Right-click and invoke 'Generate code' - look at the code 3) - Select the operation (because class element is selected) - Insert an argument into the operation 4) - Select the class element - Right-click and invoke 'Generate Code' - look at the code 5) - Select the operation - Change the type of operation 6) - Select the class element - Right-click and invoke 'Generate Code' - look at the code There are a lot of actions. I need to select class element after operation selection to generate code and select the operation after class element selection to edit an operation. I only want to change an operation and generate the code after that.
You can not just reverse engineer a single operation or attribute or any subset of a class in the current implementation of the Generate Code feature. It was not designed for this and does not have the ability to do this. This was not a feature in any previous version of the UML module. This issue can be marked as an enhancement that may be addressed in a future release but is beyond the scope of this release.
Decided to make it an enhancement. iteam should decide if it is possible to realize without confusing user. quotation from emails: -- me: Bug is not about generating code for one operation without touching other parts of source file. It is about including Class element's menu item 'Generate Code' into popup menu opened for operation or attribute compartment. -- craig: We just need to be careful about which menu actions we push down into the finer grained elements and the impression that you give the end user. If a user does Generate Code on an operation, will they expect just the operation to be "updated".
Generate Code for inner elements (attributes, operations and even inner classes/enums/interfaces) suggest an update code gen type action as opposed to the complete file regeneration that happens now. When source file merging is implemented, this action will be added to inner elements to update just that element in the source file.