Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 108338 - [quick fix] Add "add abstract method" QuickFix
Summary: [quick fix] Add "add abstract method" QuickFix
Status: RESOLVED DUPLICATE of bug 38201
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-30 05:06 EDT by Oyvind Harboe CLA
Modified: 2008-07-10 04:45 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oyvind Harboe CLA 2005-08-30 05:06:20 EDT
When working w/e.g. Tapestry, it would be convenient to have a "add abstract
method" QuickFix as the actual implementation is provided by the framework's
subclass....

Øyvind
Comment 1 Oyvind Harboe CLA 2005-08-30 05:37:32 EDT
A bit more background:

This PR ties into the Web Tools Project at some level.

There is a plugin that I use "Spindle" that knows *why* a method is missing in
my .java class.

If the Spindle plugin was allowed to offer a QuickFix which applies to certain
.java files(those that are tied into a web application via various .xml files),
Spindle could also make the necessary modifications to the Tapestry XML files as
well as adding the approperiate abstract method.

http://jakarta.apache.org/tapestry/
http://spindle.sourceforge.net/
Comment 2 Dirk Baeumer CLA 2005-08-31 08:19:33 EDT
Øyvind,

the quick fix/assist infrastrucuture is open. Other plug-ins can provide their
own quick fixes and quick assist (for example JUnit contributed the "Add JUnit
Library" quick fix). The extension point is
org.eclipse.jdt.ui.quickFixProcessors and
org.eclipse.jdt.ui.quickAssistProcessors. So Spindle is able to provide this
quick fix.

I will close this as works for me since the infrastructure is there and I don't
see what else JDT can do.
Comment 3 Oyvind Harboe CLA 2005-08-31 08:25:13 EDT
(In reply to comment #2)
> Øyvind,
> 
> the quick fix/assist infrastrucuture is open. Other plug-ins can provide their
> own quick fixes and quick assist (for example JUnit contributed the "Add JUnit
> Library" quick fix). The extension point is
> org.eclipse.jdt.ui.quickFixProcessors and
> org.eclipse.jdt.ui.quickAssistProcessors. So Spindle is able to provide this
> quick fix.
> 
> I will close this as works for me since the infrastructure is there and I don't
> see what else JDT can do.

Add "Add abstract method" QuickFix?

This quickfix is generally useful for Java programs.
Comment 4 Dirk Baeumer CLA 2005-08-31 08:40:42 EDT
But what should it fix ? Can you please provide a use case.
Comment 5 Oyvind Harboe CLA 2005-08-31 08:44:47 EDT
(In reply to comment #4)
> But what should it fix ? Can you please provide a use case.


void foo(String t)
{
   bar(t); // this method does not exist. 
}

QuickFix will add:

abstract void bar(String);
Comment 6 Dirk Baeumer CLA 2005-08-31 13:33:43 EDT
Stupid me ;-).
Comment 7 Oyvind Harboe CLA 2005-09-11 08:17:08 EDT
If this is added to Eclipse(eventually), is there a reasonable way for the
Spindle plugin to copy & paste the "add abstract method" quickfix into the plugin?

Perhaps this PR could be put to bed by creating and publishing an example of how
to add a quickfix to a plugin? 

There are other less general QuickFixes that the Spindle plugin could grow, and
a copy&paste example would be a great catalalyst, I'd think. :-)
Comment 8 Geoff Longman CLA 2005-09-11 12:34:23 EDT
Spindle is about to release a new version that contains this quickfix. Not an
ideal solution as it uses stuff that's internal to JDT. Would prefer that
Eclipse provide this and then I can remove what I have (which will invetiably
break as Eclispe 3.2 evolves).
Comment 9 Dani Megert CLA 2008-07-10 04:45:07 EDT

*** This bug has been marked as a duplicate of bug 38201 ***