| Summary: | [generate delegate][refactoring] Generate Decorator Class | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Nathan Reynolds <numeralnathan> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | deepakazad |
| Version: | 3.8 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Nathan Reynolds
You can do most of the heavy lifting already.
- Start with
------------------------------------------------
interface MyInterface {
void foo();
void bar();
}
class Decorator {
private MyInterface obj;
}
------------------------------------------------
- Select 'obj'
- Source > Generate delegate methods
- Select 'obj' again
- Source > Generate Constructor using fields
- Final result is
------------------------------------------------
interface MyInterface {
void foo();
void bar();
}
class Decorator {
private MyInterface obj;
public Decorator(MyInterface obj) {
super();
this.obj = obj;
}
public void foo() {
obj.foo();
}
public void bar() {
obj.bar();
}
}
------------------------------------------------
Closing as WONTFIX.
|