Bug 171023 - [source generation] generate default implementation of iface/abstract class refactoring
Summary: [source generation] generate default implementation of iface/abstract class r...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-19 05:16 EST by Benno Baumgartner CLA
Modified: 2007-02-13 05:44 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2007-01-19 05:16:47 EST
I20061102-1715

Given an abstract class or interface like:

public abstract class AuditRuleProvider {
  public abstract String getLabel();
  public abstract String getDescription();
  public abstract String getHelp();
}

I would like to have a refactoring called 'Generate Default Implementation' or so. The outcome of the refactoring would be something like:

public class DefaultAuditRuleProvider extends AuditRuleProvider {
  private final String fLabel;
  private final String fDescription;
  private final String fHelp;

  public DefaultAuditRuleProvider(String label, String description, String help) {
    super();
    fLabel= label;
    fDescription= description;
    fHelp= help;
  }

  public String getLabel() {
    return fLabel;
  }
  public String getDescription() {
    return fDescription;
  }
  public String getHelp() {
    return fHelp; 
  }
}

At the moment I write the fields from hand, then Generate Getter/Setters, then Generate Constructor using fields.