Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 134648 - Create Method hint: Wrong position of method and cursor
Create Method hint: Wrong position of method and cursor
Status: NEW
Product: java
Classification: Unclassified
Component: Hints
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Svata Dedic
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-07 07:33 UTC by Jan Becicka
Modified: 2013-09-02 14:25 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Becicka 2008-05-07 07:33:12 UTC
.
.

    public String getName() {
(o)     test();
        return NbBundle.getMessage(QuickSearchAction.class, "CTL_QuickSearchAction");
    }

    @Override
    protected String iconResource() {
        return "org/netbeans/modules/jumpto/resources/edit_parameters.png";
    }

    public HelpCtx getHelpCtx() {
        return HelpCtx.DEFAULT_HELP;
    }

    @Override
    protected boolean asynchronous() {
        return false;
    }

    @Override
    public java.awt.Component getToolbarPresenter() {
        return retValue;
    }

| <--cursor
    private void test() {
        throw new UnsupportedOperationException("Not yet implemented");
    }

I would expect, that test() method should be generated right after getName(), not at the end of class. User will lose
context of editing. And method body should be preselected. Otherwise user is forced to go into method, delete body and
then start coding.
Comment 1 Max Sauer 2008-07-01 13:59:45 UTC
Method body preselection has been fixed as part of
http://hg.netbeans.org/main/rev/25b7ec83be0c

Comment 2 Max Sauer 2008-07-08 09:17:40 UTC
The method position is not easy to correct and changes would be possibly inconsistent with other generation behaviour -- currently, we insert the method 
at the end of block of class members with same priority (GeneratorUtilities ClassMemberComparator).


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo