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 195670 - Create Wrapper/ Decorator Action and File Template
Summary: Create Wrapper/ Decorator Action and File Template
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-18 17:57 UTC by puce
Modified: 2013-09-02 14:23 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 puce 2011-02-18 17:57:39 UTC
Provide an action from the context menu of interfaces (e.g. New->Wrapper) and a file template (in the New File dialog) to create a Wrapper class from an interface.

e.g.

public interface MyInterface{
  void setBor(Bar bar);
  Bar getBar();
  void foo();
}

should create:

public class MyInterfaceWrapper{
  private final MyInterface myInterface;

  public MyInterfaceWrapper(MyInterface myInterface){
    this.myInterface = myInterface;
  }

  @Override
  public void setBoo(Bar bar){
    myInterface.setBar(bar);
  }
  
  @Override
  public Bar getBar(){
    return myInterface.getBar();
  }

  @Override
  public void foo(){
    myInterface.foo();
  }

}