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 269740 - Add more functionality to Insert code->Generate
Summary: Add more functionality to Insert code->Generate
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 8.2
Hardware: PC All
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-03 15:34 UTC by mambu
Modified: 2017-08-09 08:43 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Current list of actions (20.51 KB, image/png)
2017-02-03 15:34 UTC, mambu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mambu 2017-02-03 15:34:15 UTC
Created attachment 163563 [details]
Current list of actions

Hi,

currently "Source -> Insert code... -> Generate" inside a class gives some very useful options when writing code. See attachment for the list of actions that can be done on an empty class that derives from another class with pure virtual methods.

However I believe some more may be added. Here are some suggestions.

#1. Implement pure virtual method from base class
Name: "Implement pure virtual base method"
Enabled if: the class derives from another class which has pure virtual methods
Example:

class InterfaceA
{
public:
    virtual ~InterfaceA() {}

    virtual void SetInt(int i) = 0;
};

class ConcreteA : public InterfaceA
{
    // this can be auto generated
    virtual void SetInt(int i) override;
    // note 1: virtual is optional
    // note 2: override is for C++11 and above
};

#2. override virtual method
Name: "Override base class method"
Enabled if: the class derives from another class which has virtual methods
Example:
Same as above, but for non-pure virtual methods.

#3. Add destructor
Name: "Add destructor"
Enabled if: always, or at least when there are pure virtual functions in this class
Example:

class InterfaceA
{
public:
    // this can be auto generated
    virtual ~InterfaceA() {}
    // note 1: virtual is optional but would be good if it was added when there are pure virtual functions in the class

    virtual void SetInt(int i) = 0;
};

Thanks,
Marco
Comment 1 mambu 2017-08-09 08:42:45 UTC
In netbeans 8.2 the functionality above is available using CTRL + <space>.
Comment 2 mambu 2017-08-09 08:43:41 UTC
Closing. Functionality already available.