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.

Bug 87015 - Generate Code menu item needed for inner elements
Summary: Generate Code menu item needed for inner elements
Status: NEW
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-12 15:39 UTC by Alexandr Scherbatiy
Modified: 2007-10-19 21:11 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2006-10-12 15:39:39 UTC
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
Comment 1 Craig Conover 2006-10-12 17:42:51 UTC
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.

Comment 2 Alexandr Scherbatiy 2006-10-13 10:17:55 UTC
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. 
  

 
 
Comment 3 Craig Conover 2006-10-13 13:45:05 UTC
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.
Comment 4 Andrew Korostelev 2006-10-13 15:25:36 UTC
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".
Comment 5 Craig Conover 2006-10-19 20:18:02 UTC
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.