views:

224

answers:

2

I am trying to use Delphi 2009's refactoring to extract an interface from a class. The class looks something like this:

Type
  TMyClass = class(TObject)
  private
    FPrivateVar: Integer;
  public
    procedure MyPublicProc(Value: String); 
    function MyPublicFunc(Value: String): String;
  end;

If I place the cursor in the public section, right click and select Refactoring|Extract interface, there is a slight pause then... nothing. What am I doing something wrong?

A: 

In D2007 it works OK. (I had to enable/add model support, it auto asks for it). When I click a procedure (place cursor somewhere in for example MyPublicProc) it works OK.

Do you see an error if you open the refectoring view? (Delphi -> View -> Refactorings)

André
There are no error messages at all. Just a short pause then nothing. I already tried enabling model support, but the same thing still happens (or doesn't).
norgepaul
I just tried it in RAD Studio 2007 and it works as expected!
norgepaul
+2  A: 

I'm using Delphi 2009 Version 12.0.3210.17555 (Update 1 and 2 installed), and I checked the feature on your class...

As long as I had only your class interface, and method were not implemented, I was receiving this error message:

Selection should contain either one or several classes or one or several class members.

I pressed Ctrl+Shift+C to complete the class implementation, and tried again, and It worked just fine:

http://www.picoodle.com/view.php?img=/2/5/13/kykl1zna1e5r/f_ExtractIntem_4aaede9.png&srv=img30

vcldeveloper