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 33529 - Enable generation of method calls for event handling to be abstract
Summary: Enable generation of method calls for event handling to be abstract
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker with 1 vote (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 89785 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-10 15:09 UTC by brviking
Modified: 2008-08-12 13:49 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 brviking 2003-05-10 15:09:57 UTC
I love to work with NetBeans for designer. But one
thing I have (not NetBeans, but every form
designer I seen today), is mixing form design code
AND logic code.
To address this issue, the method calls for event
handling should have a config option to be
generated abstract. So, I will extend the UI class
and implement logic code, implementing all calls.
Actually the variables already can be declared
protected, so I can access them. The only piece
are missed is abstract methods.

Example:

btnCancel.addActionListener(new
java.awt.event.ActionListener() {
      public void
actionPerformed(java.awt.event.ActionEvent evt) {
        btnCancelActionPerformed(evt);
      }
    });
.
.
.
  private void
btnCancelActionPerformed(java.awt.event.ActionEvent
evt) {
    // Add your handling code here:
    this.documento = null;
    doClose();
  }

should be

btnCancel.addActionListener(new
java.awt.event.ActionListener() {
      public void
actionPerformed(java.awt.event.ActionEvent evt) {
        btnCancelActionPerformed(evt);
      }
    });
.
.
.
  protected abstract void
btnCancelActionPerformed(java.awt.event.ActionEvent
evt);

(The method could be protected, or public... It
should be configurable too).

This will solve my trouble regarding guarded
blocks too.

Thanks,

Edson Richter
Comment 1 Tomas Pavek 2005-05-16 14:27:38 UTC
This is a reasonable requirement, however it would require some additional
configuration to be introduced for the event handling (i.e. type of the event
handler method). That is rather big change, e.g. from UI point of view, which I
am not sure when we could implement. There is still a workaround - to call from
the private method your own method that can be of any type.

From this point of view, a better enhancement would be probably to allow the
user to specify their own event handling method directly - not generating a
guarded method skeleton if the user can provide a suitable method by themselves.
Comment 2 Tomas Pavek 2005-05-16 16:25:22 UTC
See also issue 25010.
Comment 3 Tomas Pavek 2006-11-22 09:27:53 UTC
*** Issue 89785 has been marked as a duplicate of this issue. ***
Comment 4 jgawera 2008-08-12 13:49:53 UTC
Gets my vote,